Agent/AgentState split complete — separate context and state locks

Agent is now Arc<Agent> (immutable config). ContextState and AgentState
have separate tokio::sync::Mutex locks. The parser locks only context,
tool dispatch locks only state. No contention between the two.

All callers migrated: mind/, user/, tools/, oneshot, dmn, learn.
28 tests pass, zero errors.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 15:47:21 -04:00
parent 1d61b091b0
commit 0b9813431a
8 changed files with 156 additions and 159 deletions

View file

@ -14,8 +14,8 @@ use std::fs;
use std::path::PathBuf;
use std::sync::OnceLock;
use super::api::{ApiClient, Usage};
use super::context::{AstNode, Role};
use super::api::ApiClient;
use super::context::AstNode;
use super::tools::{self as agent_tools};
use super::Agent;