WIP: ActiveTools wrapper type, removing SharedActiveTools

New ActiveTools struct with proper methods: push, remove,
take_finished, take_foreground, iter, len. Turn loop uses
helpers instead of manual index iteration.

Removing SharedActiveTools (Arc<Mutex<Vec>>) — active tools
live directly in AgentState. A few UI callers still need
updating.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 16:41:14 -04:00
parent 14fd8c9b90
commit 9c9618d034
3 changed files with 56 additions and 52 deletions

View file

@ -103,7 +103,7 @@ struct App {
temperature: f32,
top_p: f32,
top_k: u32,
active_tools: crate::agent::tools::SharedActiveTools,
agent: std::sync::Arc<crate::agent::Agent>,
should_quit: bool,
context_info: Option<ContextInfo>,
agent_state: Vec<crate::mind::SubconsciousSnapshot>,
@ -113,7 +113,7 @@ struct App {
}
impl App {
fn new(model: String, active_tools: crate::agent::tools::SharedActiveTools) -> Self {
fn new(model: String, agent: std::sync::Arc<crate::agent::Agent>) -> Self {
Self {
status: StatusInfo {
dmn_state: "resting".into(), dmn_turns: 0, dmn_max_turns: 20,
@ -126,7 +126,7 @@ impl App {
temperature: 0.6,
top_p: 0.95,
top_k: 20,
active_tools,
agent: mind.agent.clone(),
should_quit: false,
context_info: None,
agent_state: Vec::new(),