When using gpt-oss-120b, agent replies with tool call arguments / json instead of calling the tool
** Please make sure you read the contribution guide and file the issues in the right place. ** Contribution guide.
Describe the bug When I use gpt-oss-120b as the model for my agents, I get json replies when the agent should do a tool call, such as:
{ "function": "transfer_to_agent", "arguments": { "agent_name": "manager_agent" } } and {"agent_name": "manager_agent"}
To Reproduce Unable to share code due to data rights but any multi-agent setup with ADK and a vLLM hosted gpt-oss-120b would replicate this.
Expected behavior The agent calls a tool when relevant instead of printing out the json
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Mac and Linux
- Python version(python -V): 3.12.8
- ADK version(pip show google-adk): 1.17.0
Model Information:
- Are you using LiteLLM: Yes
- Which model is being used(e.g. gemini-2.5-pro): gpt-oss-120b
Additional context Add any other context about the problem here.
Hi @hangfei
I would like to take this issue.
I plan to implement a fallback in the LiteLLM adapter to parse JSON tool-intent payloads ({"function": ..., "arguments": {...}}) when tool_calls are absent, synthesizing a proper tool call (FunctionChunk) for execution.
I will include unit tests for both transfer_to_agent and a generic tool example.
Please confirm if this direction sounds good before I open a PR.
Hello @TomOrth ,
Please update to the latest ADK version. If the problem persists, we will need to reproduce it and it would be very helpful if you could provide detailed step by step reproduction instructions. If you cannot share code please describe the exact steps you followed. Note whether the issue also occurs with Gemini models or other (non-GPT) models and include any relevant logs or error messages. A minimal code snippet or pseudocode is also appreciated when possible.
Thank you that information will help us investigate and resolve the issue more quickly.