Agent:🆕 stop unconditionally adding all MCP tools

Each agent is passed its own tool list — that's the list it should
advertise. The line that appended all_mcp_tool_definitions() was
causing unconscious agents to see bash/read_file/etc in their prompt
even though they couldn't execute them.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-12 01:21:01 -04:00
parent f408bb5d86
commit 090c8e4d35

View file

@ -198,8 +198,7 @@ impl Agent {
context.conversation_log = conversation_log;
context.push_no_log(Section::System, AstNode::system_msg(&system_prompt));
let mut tool_defs: Vec<String> = agent_tools.iter().map(|t| t.to_json()).collect();
tool_defs.extend(tools::all_mcp_tool_definitions().await);
let tool_defs: Vec<String> = agent_tools.iter().map(|t| t.to_json()).collect();
if !tool_defs.is_empty() {
let tools_text = format!(