Skip to content

fix(agent): send no tools with the LLM connection test - #538

Open
Phantom-IN wants to merge 1 commit into
BaaRai:mainfrom
Phantom-IN:fix/conntest-no-background-tools
Open

Phantom-IN wants to merge 1 commit into
BaaRai:mainfrom
Phantom-IN:fix/conntest-no-background-tools

Conversation

@Phantom-IN

Copy link
Copy Markdown
Contributor

Fixes the cause behind #526.

TestConnection passes Tools: []actool.CoreTool{}, but agentcore still appends its background-task tools unless DisableBackgroundTasks is set. I put a logging proxy in front of my local Ollama and the "ping" request carried four tool definitions: TaskOutput, TaskStop, TaskList and Monitor. That matches the report: a much bigger prompt than a direct call, and replies that are TaskOutput-like text or a real tool_calls.

With gemma4:e4b the streaming test never got to OK. The model spent the full 30 s reasoning about whether to use those tools and the test failed with context deadline exceeded. With the tools off it answers OK in about 0.6 s, streaming and non-streaming.

The fix sets DisableBackgroundTasks: true, as agent/goals.go already does. The new TestConnectionSendsNoTools reads the request body from an httptest server and checks it has no tools. 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/ and go test ./agent/ pass.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant