forked from kent/consciousness
Revert "replace try_lock() with lock_blocking() across UI thread"
This reverts commit 4225294d16.
This commit is contained in:
parent
4225294d16
commit
09896cd38b
28 changed files with 67 additions and 4199 deletions
|
|
@ -292,7 +292,7 @@ async fn start(cli: crate::user::CliArgs) -> Result<()> {
|
|||
}
|
||||
|
||||
fn hotkey_cycle_reasoning(mind: &crate::mind::Mind) {
|
||||
{ let mut ag = mind.agent.state.lock_blocking();
|
||||
if let Ok(mut ag) = mind.agent.state.try_lock() {
|
||||
let next = match ag.reasoning_effort.as_str() {
|
||||
"none" => "low",
|
||||
"low" => "high",
|
||||
|
|
@ -344,7 +344,7 @@ fn hotkey_cycle_autonomy(mind: &crate::mind::Mind) {
|
|||
};
|
||||
s.dmn_turns = 0;
|
||||
drop(s);
|
||||
{ let mut ag = mind.agent.state.lock_blocking();
|
||||
if let Ok(mut ag) = mind.agent.state.try_lock() {
|
||||
ag.notify(format!("DMN → {}", label));
|
||||
}
|
||||
}
|
||||
|
|
@ -419,7 +419,7 @@ async fn run(
|
|||
|
||||
terminal.hide_cursor()?;
|
||||
|
||||
{ let mut ag = agent.state.lock_blocking(); ag.notify("consciousness v0.3"); }
|
||||
if let Ok(mut ag) = agent.state.try_lock() { ag.notify("consciousness v0.3"); }
|
||||
|
||||
// Initial render
|
||||
{
|
||||
|
|
@ -526,7 +526,7 @@ async fn run(
|
|||
}
|
||||
app.walked_count = mind.subconscious_walked().await.len();
|
||||
if !startup_done {
|
||||
{ let mut ag = agent.state.lock_blocking();
|
||||
if let Ok(mut ag) = agent.state.try_lock() {
|
||||
let model = agent.model().to_string();
|
||||
ag.notify(format!("model: {}", model));
|
||||
startup_done = true;
|
||||
|
|
@ -545,7 +545,7 @@ async fn run(
|
|||
if let Some(rx_mutex) = STDERR_RX.get() {
|
||||
if let Ok(rx) = rx_mutex.try_lock() {
|
||||
while let Ok(line) = rx.try_recv() {
|
||||
{ let mut ag = agent.state.lock_blocking();
|
||||
if let Ok(mut ag) = agent.state.try_lock() {
|
||||
ag.notify(format!("stderr: {}", line));
|
||||
dirty = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue