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:
Kent Overstreet 2026-05-01 17:58:32 -04:00
commit 91c8451f5c

View file

@ -291,22 +291,21 @@ 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",
_ => "none", _ => "none",
}; };
ag.reasoning_effort = next.to_string(); ag.reasoning_effort = next.to_string();
let label = match next { let label = match next {
"none" => "off (monologue hidden)", "none" => "off (monologue hidden)",
"low" => "low (brief monologue)", "low" => "low (brief monologue)",
"high" => "high (full monologue)", "high" => "high (full monologue)",
_ => next, _ => next,
}; };
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) {
@ -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),
_ => {} _ => {}