WIP: Agent/AgentState — 36 errors remaining, all .lock() → .state.lock() or .context.lock()

Bulk replaced Arc<Mutex<Agent>> with Arc<Agent> across all files.
Fixed control.rs, memory.rs tool handlers. Fixed oneshot Backend.
Remaining errors are all agent.lock() → agent.state.lock() or
agent.context.lock() in mind/, user/, and a few in mod.rs.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 15:40:36 -04:00
parent e73135a8d0
commit 1d61b091b0
9 changed files with 30 additions and 30 deletions

View file

@ -63,11 +63,11 @@ pub struct AutoAgent {
}
/// Per-run conversation backend — wraps a forked agent.
struct Backend(std::sync::Arc<tokio::sync::Mutex<Agent>>);
struct Backend(std::sync::Arc<Agent>);
impl Backend {
async fn push_node(&mut self, node: AstNode) {
self.0.lock().await.push_node(node);
self.0.push_node(node).await;
}
}
@ -149,7 +149,7 @@ impl AutoAgent {
/// Arc to read entries live during the run.
pub async fn run_forked_shared(
&mut self,
agent: &std::sync::Arc<tokio::sync::Mutex<Agent>>,
agent: &std::sync::Arc<Agent>,
memory_keys: &[String],
state: &std::collections::BTreeMap<String, String>,
) -> Result<String, String> {