core: refactor tool system to remove agent context from initialization (#21052)

This commit is contained in:
Dax
2026-04-07 19:48:12 -04:00
committed by GitHub
parent 7afb517a1a
commit 463318486f
25 changed files with 468 additions and 513 deletions

View File

@@ -71,7 +71,10 @@ export const AgentCommand = cmd({
async function getAvailableTools(agent: Agent.Info) {
const model = agent.model ?? (await Provider.defaultModel())
return ToolRegistry.tools(model, agent)
return ToolRegistry.tools({
...model,
agent,
})
}
async function resolveTools(agent: Agent.Info, availableTools: Awaited<ReturnType<typeof getAvailableTools>>) {