Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Subagent toolcalls not handled when using LiteLLM proxy Summary When…

  1. 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_calls response, 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_calls entry. The requested tool call is not executed.

    Minimal reproduction

    1. Configure cagent to use LiteLLM as the model provider (OpenAI-compatible API).
    2. Run a workflow where the subagent is asked to use tools.
    3. The subagent returns a tool call (e.g., company_search with JSON arguments) and finishes with finish_reason: "stop".
    4. 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /docker-agent, current file: none) bash-$

  2. Assistant

    I'll start by exploring the repository structure and searching for code related to subagent tool_calls handling.

  3. Assistant

    Searching for the "no response from subagent" message and related tool_calls handling.

  4. Assistant

    rg is not available, let me use grep instead.

  5. Assistant

    Hmm no matches. Let me try different search terms related to tool_calls and subagents.

  6. Assistant

    Looking at agent delegation and how subagent responses are processed.

  7. Assistant

    Let me look at agent_delegation.go more carefully and the GetLastAssistantMessageContent function - the issue says "no response from subagent".

  8. Assistant

    The "No response from agent" message appears in a few places — reading those and the streaming finish-reason handling next.

  9. Assistant

    The problem could be in how the OpenAI-compatible provider parses LiteLLM stream responses — I'll inspect that path next.

  10. Assistant

    Let me look at the CHANGELOG for recent related fixes and also search for LiteLLM related issues.

  11. Assistant

    Suspecting finish_reason and tool_calls arrive in the same chunk and get skipped — checking OpenAI stream parsing next.

  12. Assistant

    Let me look at the oaistream package which handles stream conversion.

  13. Assistant

    There's something interesting in adapter.go around lines 142-156 - when finishReason is stop. Let me read the full adapter.go file.

  14. Assistant

    Let me see the rest of the file, especially around tool calls and the finish reason stop handling.

  15. Assistant

    Checking git history and tests for similar finish_reason/tool_calls bugs:

  16. Assistant

    The issue mentions argumments may be JSON objects rather than strings—checking how those are unmarshaled.

  17. Assistant

    Where is "no response from subagent" literally? The issue says that phrase. Let me search more broadly.

  18. Assistant

    The issue says "no response from subagent" - might be paraphrased from "No response from agent". Or it might come from the agent tool itself.

  19. Assistant

    Let me look at transfer_task which is the synchronous single tool path, and also GetLastAssistantMessageContent.

  20. Assistant

    I'll look at existing streaming tests to reproduce the same-chunk finish_reason + tool_calls bug.

  21. Assistant

    Let me look at the streamBuilder and how tool calls with finish reason are handled, and also check git blame or issues related to this.

  22. Assistant

    Writing a quick reproduction test for the same-chunk finish_reason + tool_calls bug.

  23. Assistant

    Need to set up Go environment.

  24. Assistant

    Need to find the correct sink and telemetry types.

  25. Assistant

    Let me find Telemetry interface and noop implementation.

  26. Assistant

    I'll update the test to use defaultTelemetry{} and EventSinkFunc.

  27. Assistant

    Confirmed. I'll also check whether non-delta message.tool_calls need handling.

  28. Assistant

    Refactoring handleStream so deltas are applied before handling finish_reason.

  29. Assistant

    Rewriting the stream loop so delta content (including tool calls) is processed before finish_reason handling.

  30. Assistant

    Running the reproduction tests to verify the fix:

  31. Assistant

    Removing the temporary test file and running broader runtime tests.

  32. Assistant

    Some tests failed—checking which ones.

  33. Assistant

    Only one test failed - let me see the full failure.

  34. Assistant

    This failure might be unrelated to my changes - checking whether it fails on the original code too.

  35. Assistant

    Verifying the partial tool-call + finish_reason edge case:

  36. Assistant

    Reviewing the final diff and file structure:

  37. Assistant

    Confirming the file is formatted and does a final tool-call test pass:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.