Agent:🆕 tool definitions from caller's tool list

The system prompt was advertising all tools to every agent, but
the runtime only dispatched the agent's actual subset. This caused
unconscious agents to call tools that returned "Unknown tool."

Agent::new now takes the tool list explicitly. Each caller passes
its own tools — the prompt and runtime always match. MCP tool
definitions are still appended for agents that use them.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-11 19:43:24 -04:00
parent 28e564aeb2
commit 1c0967c4ec
5 changed files with 12 additions and 3 deletions

View file

@ -282,11 +282,11 @@ impl Unconscious {
client, system_prompt, personality,
app, String::new(), None,
crate::agent::tools::ActiveTools::new(),
auto.tools.clone(),
).await;
{
let mut st = agent.state.lock().await;
st.provenance = format!("unconscious:{}", auto.name);
st.tools = auto.tools.clone();
st.priority = Some(10);
}