ISSUE DESCRIPTION Subagent toolcalls not handled when using LiteLLM proxy Summary When…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it uses to get the changes that need to be submitted. Assistant
This all looks consistent already. Let's check gemini adapter since issue mentions "gemini-pro via LiteLLM proxy". Let's check that provider used - actually LiteLLM proxy is OpenAI-compatible so it goes through openai provider client, not gemini adapter. Let's check client.go for how requests built, especially tool_choice or stream=true setting.
Assistant
Now let's build and run relevant tests.
Assistant
Build succeeds. Now let's run the runtime package tests.
Assistant
Let's find which tests failed exactly.
Assistant
Good — this test failure is pre-existing and unrelated to my change. Now let's write a quick reproduction test for the actual bug scenario using a mock stream to confirm the fix works.
Assistant
Good,
EventSinkFuncexists. Let's write a temporary test to reproduce and verify.Assistant
Now let's confirm this test fails against the original (unfixed) code, to prove it actually reproduces the issue.
Assistant
Confirmed: this exactly reproduces the reported bug, and my fix resolves it. Now let's remove the temp test file (per instructions not to add tests) and run the full test suite once more.
Assistant
Only the pre-existing unrelated failure remains. Let's also run the broader test suite for model providers to be safe, and run full repo tests quickly for regressions in related packages.
Assistant
All good. Let's view final diff.
Assistant
The diff is clean and minimal. Let's clean up temp files and do a final check of git status.
Assistant
These already passed in the full test run. Let's do one more full test run of the whole repo to be thorough.
Assistant
All 5 failures are pre-existing and unrelated to my change (environment-specific issues like sqlite/directory permissions, unrelated hooks test, config example parsing). My fix introduces no new failures.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.