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, then add a focused regression test before running the project checks.
- Assistant
rgisn’t installed in this checkout, so I’m switching to a scoped recursive search and keeping the inspection read-only. - Assistant
The failure is in stream aggregation: it handles
finish_reason: "stop"before reading tool calls from that same chunk. LiteLLM can legally place both together, so the response is discarded as empty. I’m adjusting that ordering and adding the exact combined-chunk regression case. - Assistant
The first test run hit the container’s process limit while compiling dependencies, not a code failure. I’m rerunning with constrained Go parallelism, which avoids that environmental ceiling.
- Assistant
The focused regression now passes. The test verifies the assistant message retains the tool call, normalizes the misleading
stopreason totool_calls, and reaches dispatch instead of being treated as no output. I’m moving through the repository-wide test, build, and lint gates now. - Assistant
The repository’s
taskrunner is not installed in this environment. I’ll execute the underlying commands fromTaskfile.ymldirectly, with constrained compiler parallelism. - Assistant
The unconstrained full-suite rerun exposed why the project’s test task clears provider credentials: ambient model-provider settings changed the model catalog and broke unrelated example validation. I’m rerunning with the exact
.env.testisolation specified by the repository.
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 →