Subagent toolcalls not handled when using LiteLLM proxy Summary When using cagent with a…
- User
Subagent tool_calls not handled when using LiteLLM proxy
Summary
When using cagent with a LiteLLM proxy (OpenAI-compatible API), a subagent can return a valid
tool_callsresponse, but the host agent reports “no response from subagent” and does not execute the tool call.Environment
- cagent: v1.19.7
- OS: Linux (WSL2) x86_64
- LLM: gemini-pro via LiteLLM proxy (OpenAI-compatible)
Expected
Host agent receives the subagent response and executes the tool call(s), then continues the conversation with the tool result.
Actual
Host agent reports there is “no response from subagent” even though the subagent response contains a valid
tool_callsentry. The requested tool call is not executed.Minimal reproduction
- Configure cagent to use LiteLLM as the model provider (OpenAI-compatible API).
- Run a workflow where the subagent is asked to use tools.
- The subagent returns a tool call (e.g.,
company_searchwith JSON arguments) and finishes withfinish_reason: "stop". - The host agent logs “no response from subagent” and does not invoke the tool.
Notes
- The subagent response includes a valid tool call object (
type: function,name: company_search,arguments: {"datasources": ["confluence", "github", "gdrive"], "query": "LiteLLM usage teams integrations standards"}). - I can reproduce consistently with LiteLLM as the proxy in front of an OpenAI-compatible endpoint.
Please let me know if you want a sanitized example payload or a minimal agent config.
Interface
No new interfaces are introduced.
- Assistant
I’ll trace the OpenAI-compatible response conversion and subagent execution path, add a focused regression test for
tool_callspaired withfinish_reason: "stop", then run the project validation commands. - Assistant
rgisn’t installed in this checkout, so I’m falling back to repository-localgrep/findsearches and narrowing from the relevant message text. - Assistant
The failure is in stream aggregation: it returns as soon as it sees
finish_reason: "stop"before reading tool calls carried in that same chunk. LiteLLM can legally co-locate both fields, so I’m changing the ordering to aggregate the delta first and then finalize the stream. - Assistant
The regression test exercises the full runtime: a single LiteLLM-style chunk contains both the complete
company_searchcall and"stop", the handler must run, and the model must receive the tool result and produce its follow-up response. Dependencies are being populated for the focused test run. - Assistant
The first compile attempt hit the container’s process limit (
fork/exec … resource temporarily unavailable) while Go built dependencies in parallel, not a code failure. I’m rerunning with serialized package compilation, then I’ll run the prescribed build/test/lint checks with constrained parallelism if needed. - Assistant
The serialized focused test is still compiling the large runtime dependency graph; it has produced no errors so far. The implementation change is deliberately scoped to chunk ordering and preserves the existing behavior for separately streamed tool-call and finish chunks.
- Assistant
The focused regression now passes. I’ve also confirmed the diff is limited to the stream aggregator and one end-to-end runtime test; next are the repository-required
task build,task test, andtask lintvalidations. - Assistant
The repository’s
taskrunner is not installed in this environment. I’ll mirror the commands defined in the Taskfile directly so build, tests, and lint still receive equivalent coverage, and I’ll report the runner limitation explicitly. - Assistant
Build has passed, and the full test suite is progressing successfully through the CLI, E2E, and example packages. I’m keeping Go package concurrency at one only to avoid the environment’s process ceiling.
- Assistant
The full suite has exposed unrelated environment/baseline failures in config example model resolution, hook shell behavior, and an invalid-path SQLite expectation. The runtime package and new regression remain green; I’m letting the suite finish to capture the complete result before linting.
- Assistant
The full suite is near completion. Its failures are pre-existing/environment-sensitive categories (obsolete example model IDs, root-user permission checks, and shell-hook behavior); the affected runtime package also has unrelated full-package failures, so I’ll isolate and rerun the changed regression once more after the suite completes.
- Assistant
The final regression is also being checked under Go’s race detector because the test verifies actual asynchronous tool execution. Lint’s repository-specific checks and module tidiness have passed; the only unavailable lint component is the missing
golangci-lintbinary. - Assistant
The race-enabled build is taking substantially longer than the normal build due to instrumenting the runtime’s dependency graph, but it remains active with no diagnostics. The ordinary focused regression and production build have already passed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →