From 91c8451f5cfcf933374c51f090c3cebfb89c6e0b Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 1 May 2026 17:58:32 -0400 Subject: [PATCH] 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 --- src/user/mod.rs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/user/mod.rs b/src/user/mod.rs index 80754a1..a5b7a1b 100644 --- a/src/user/mod.rs +++ b/src/user/mod.rs @@ -291,22 +291,21 @@ async fn start(cli: crate::user::CliArgs) -> Result<()> { ui_handle.join().unwrap_or_else(|_| Err(anyhow::anyhow!("UI thread panicked"))) } -fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) { - if let Ok(mut ag) = mind.agent.state.try_lock() { - let next = match ag.reasoning_effort.as_str() { - "none" => "low", - "low" => "high", - _ => "none", - }; - ag.reasoning_effort = next.to_string(); - let label = match next { - "none" => "off (monologue hidden)", - "low" => "low (brief monologue)", - "high" => "high (full monologue)", - _ => next, - }; - ag.notify(format!("reasoning: {}", label)); - } +async fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) { + let mut ag = mind.agent.state.lock().await; + let next = match ag.reasoning_effort.as_str() { + "none" => "low", + "low" => "high", + _ => "none", + }; + ag.reasoning_effort = next.to_string(); + let label = match next { + "none" => "off (monologue hidden)", + "low" => "low (brief monologue)", + "high" => "high (full monologue)", + _ => next, + }; + ag.notify(format!("reasoning: {}", label)); } async fn hotkey_kill_processes(mind: &crate::mind::Mind) { @@ -592,7 +591,7 @@ async fn run( } else if key.modifiers.contains(KeyModifiers::CONTROL) { match key.code { 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('p') => hotkey_cycle_autonomy(mind), _ => {}