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, reproduce the dropped
tool_callscase in a focused test, then patch and run the project validations. - Assistant
rgisn’t installed in this workspace, so I’m using the repository’s available search tools and narrowing the trace from the exact error message. - Assistant
The failure is in stream aggregation, not delegation itself: a chunk carrying both
delta.tool_callsandfinish_reason: "stop"is returned immediately before its tool-call delta is processed. That matches LiteLLM’s response shape. I’m adding a regression at this boundary and reordering terminal handling so the call is retained and normalized totool_calls. - Assistant
The focused regression is now running. The implementation also preserves content/reasoning if a proxy coalesces those deltas into the terminal chunk, instead of discarding them alongside the tool call.
- Assistant
The first compile attempt hit the container’s process/thread limit while Go was building the newly downloaded dependency graph. I’m rerunning with constrained build parallelism; this is an environment resource failure, not a test failure.
- Assistant
The focused regression and the full runtime package now pass. Next I’m running the repository-required build, full test suite, and linter with low Go parallelism to stay within the container’s process ceiling.
- Assistant
The repository’s
taskrunner is not installed in this environment. I’m reading the Taskfile targets and invoking their underlying local commands directly so the same checks are still performed. - Assistant
The full suite is still progressing cleanly under the constrained runner; the earlier command output was only the dependency/setup phase. I’m continuing until the process exits and reports its final status.
- Assistant
The fix-specific tests pass and the binary builds. The repository-wide suite completes but has pre-existing environment/baseline failures unrelated to these files (stale example model IDs, root-only permission expectations, and hook fixture output); I’ve verified the changed runtime path independently and am doing the final diff check now.
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 →