forked from kent/consciousness
user: fix hotkey_cycle_reasoning after lock_blocking revert
The revert at 09896cd dropped the try_lock() wrapper but left an extra
closing brace and the async-call site still un-awaited, leaving the tree
unbuildable. Re-flow the function body to match the new signature.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
09896cd38b
commit
91c8451f5c
1 changed files with 16 additions and 17 deletions
|
|
@ -291,8 +291,8 @@ async fn start(cli: crate::user::CliArgs) -> Result<()> {
|
||||||
ui_handle.join().unwrap_or_else(|_| Err(anyhow::anyhow!("UI thread panicked")))
|
ui_handle.join().unwrap_or_else(|_| Err(anyhow::anyhow!("UI thread panicked")))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) {
|
async fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) {
|
||||||
if let Ok(mut ag) = mind.agent.state.try_lock() {
|
let mut ag = mind.agent.state.lock().await;
|
||||||
let next = match ag.reasoning_effort.as_str() {
|
let next = match ag.reasoning_effort.as_str() {
|
||||||
"none" => "low",
|
"none" => "low",
|
||||||
"low" => "high",
|
"low" => "high",
|
||||||
|
|
@ -307,7 +307,6 @@ fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) {
|
||||||
};
|
};
|
||||||
ag.notify(format!("reasoning: {}", label));
|
ag.notify(format!("reasoning: {}", label));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async fn hotkey_kill_processes(mind: &crate::mind::Mind) {
|
async fn hotkey_kill_processes(mind: &crate::mind::Mind) {
|
||||||
let mut st = mind.agent.state.lock().await;
|
let mut st = mind.agent.state.lock().await;
|
||||||
|
|
@ -592,7 +591,7 @@ async fn run(
|
||||||
} else if key.modifiers.contains(KeyModifiers::CONTROL) {
|
} else if key.modifiers.contains(KeyModifiers::CONTROL) {
|
||||||
match key.code {
|
match key.code {
|
||||||
KeyCode::Char('c') => { app.should_quit = true; }
|
KeyCode::Char('c') => { app.should_quit = true; }
|
||||||
KeyCode::Char('r') => hotkey_cycle_reasoning(mind),
|
KeyCode::Char('r') => hotkey_cycle_reasoning(mind).await,
|
||||||
KeyCode::Char('k') => hotkey_kill_processes(mind).await,
|
KeyCode::Char('k') => hotkey_kill_processes(mind).await,
|
||||||
KeyCode::Char('p') => hotkey_cycle_autonomy(mind),
|
KeyCode::Char('p') => hotkey_cycle_autonomy(mind),
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue