Repository navigation
fix(agent): send no tools with the LLM connection test - #538
Conversation
TestConnection passes an empty Tools slice so the model gets a bare chat request, but agentcore still appends its background-task tools (TaskOutput, TaskStop, TaskList, Monitor) unless DisableBackgroundTasks is set. The request therefore carried four tool definitions, and models answered the "ping" with a TaskOutput call or tool-like text instead of OK (BaaRai#526). Against a local gemma4:e4b the streaming test spent its whole 30 s budget reasoning about those tools and failed; with them gone it answers OK in under a second. Set DisableBackgroundTasks, as goal decomposition already does, and add a test that checks the request body has no tools.
|
Review notes Looks good to merge. |
|
Thanks for checking it against #573. |
|
Merged, thanks @Phantom-IN. I reproduced both sides locally: the new test passes with the option set, and fails with exactly four tools (TaskOutput, TaskStop, TaskList, Monitor) when the line is removed. |
|
The original issue is no longer reproducible in my tested configuration after applying PR #538. The fix successfully resolves the unexpected background-task tool injection observed during the Ollama connection test. The existing database and configuration were preserved throughout the update. This retest covers the connection diagnostic only, not autonomous agent execution. Response latency was not recorded. Thank you both for your excellent support, investigation, and fix! |
Fixes the cause behind #526.
TestConnectionpassesTools: []actool.CoreTool{}, but agentcore still appends its background-task tools unlessDisableBackgroundTasksis set. I put a logging proxy in front of my local Ollama and the "ping" request carried four tool definitions:TaskOutput,TaskStop,TaskListandMonitor. That matches the report: a much bigger prompt than a direct call, and replies that areTaskOutput-like text or a realtool_calls.With
gemma4:e4bthe streaming test never got to OK. The model spent the full 30 s reasoning about whether to use those tools and the test failed withcontext deadline exceeded. With the tools off it answersOKin about 0.6 s, streaming and non-streaming.The fix sets
DisableBackgroundTasks: true, asagent/goals.goalready does. The newTestConnectionSendsNoToolsreads the request body from an httptest server and checks it has notools. It fails on main with "sent 4 tools".I didn't change the "any non-empty reply is Connected" check the issue also mentions. That felt like a separate decision.
go vet ./agent/andgo test ./agent/pass.