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,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),
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue