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 subagent response handling for OpenAI-compatible providers, add a focused regression test for
tool_callspaired withfinish_reason: "stop", then run the project’s validation commands. - Assistant
The failure is in stream aggregation: it returns immediately on
finish_reason: "stop"before readingtool_callsfrom that same chunk. LiteLLM’s response shape exposes this ordering bug; I’m adjusting aggregation so every delta is consumed before its finish reason is acted on. - Assistant
The focused test reached a host process-limit failure during Go compilation (
resource temporarily unavailable), not a code failure. Dependencies are now cached, so I’m rerunning with constrained build parallelism before the full build/test/lint checks. - Assistant
The regression test now passes. The repository’s
taskrunner is not installed in this environment, so I’m using the equivalent commands from the Taskfile directly, with reduced Go parallelism to stay within the container’s process limit. - Assistant
The first full-suite run exposed environment-dependent baseline failures because it did not inherit Task’s
.env.testAPI-key clearing; it also includes root-user permission tests that are known to behave differently in this container. I’m rerunning with the Taskfile’s test environment exactly reproduced so the relevant result is unambiguous.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.