Tool whitelist from agent header filters native tools

The tools field in agent headers now filters which native tools
the agent receives. Empty = all tools (default). Non-empty =
whitelist. Journal agent can list only journal_tail/journal_new/
journal_update. Log shows actual tool names instead of "no tools".

Threaded tools list through call_api_with_tools → sync wrapper →
llm caller.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-01 15:18:42 -04:00
parent 834247fa53
commit 8eabeab8eb
3 changed files with 20 additions and 9 deletions

View file

@ -294,8 +294,11 @@ fn run_one_agent_inner(
_llm_tag: &str,
log: &(dyn Fn(&str) + Sync),
) -> Result<AgentResult, String> {
let tools_desc = if def.tools.is_empty() { "no tools".into() }
else { format!("{} tools", def.tools.len()) };
let tools_desc = if def.tools.is_empty() {
"all tools".into()
} else {
def.tools.join(", ")
};
let n_steps = agent_batch.steps.len();
for key in &agent_batch.node_keys {