scaleway/gpt-oss-120b unable to call tools with chat/completions endpoint
Description
As stated in this documentation.
We can read that tool calling in that model is only supported with the /responses API
Most supported Generative API models can be used with both Chat Completions and Responses API. For the gpt-oss-120b model, use of the Responses API is recommended, as it will allow you to access all of its features, especially tool-calling.
I could also confirm that in a langchain app I built: /chat/completions failed to call tools with the gpt-oss-120b model whereas using the /responses api works
Moreover, when I ran the following command
opencode --log-level DEBUG --print-logs run --model scaleway/gpt-oss-120b "ping" with a wrong API key (in purpose to see the API URL being used). I can see it's using the chat/completions API.
this confirms that opencode uses the /chat/completions API.
Moreover, I also tested with another model from scaleway and tool calling worked well.
Now to be very precise, what fails is not calling the tool itself, the model is able to discover tools and trigger a tool call, yet it "crashes" when it's about receiving a tool call message to then process it and formulate a follow up response.
the easy fix here is to switch to responses endpoint
Plugins
none
OpenCode version
1.1.8
Steps to reproduce
- Configure Scaleway
- Start a session with the scaleway/gpt-oss-120b model
- Send a prompt that generates a tool call (beware of not prompting on a specific file as it can simply inject its content in the context without calling a tool)
- Observe the tool being called and then a silent failure
Screenshot and/or share link
Operating System
macOS 14.4.1
Terminal
vscode terminal / webUI
This issue might be a duplicate of existing issues. Please check:
- #7185: When use gpt-oss-120B by vLLM locally, opencode doesn't call the tools
Both issues involve the same model (gpt-oss-120b) failing to properly handle tool calls. This issue specifically identifies that Scaleway's gpt-oss-120b requires the /responses API endpoint instead of /chat/completions, which may be a root cause worth investigating for the other tool calling issues with this model.
Feel free to ignore if this doesn't address your specific case.
This issue might be a duplicate of existing issues. Please check:
- When use gpt-oss-120B by vLLM locally, opencode doesn't call the tools #7185: When use gpt-oss-120B by vLLM locally, opencode doesn't call the tools
Both issues involve the same model (gpt-oss-120b) failing to properly handle tool calls. This issue specifically identifies that Scaleway's gpt-oss-120b requires the /responses API endpoint instead of /chat/completions, which may be a root cause worth investigating for the other tool calling issues with this model.
Feel free to ignore if this doesn't address your specific case.
I saw this issue but it refers to not calling the tool, moreover it's on a different provider and my understanding is that implementations are provider dependent
@thdxr I’d like to take this and wire Scaleway gpt-oss-120b to the responses endpoint so tool-calling works.
Proposed plan:
- Add a provider override for scaleway in packages/opencode/src/provider/provider.ts so getModel returns sdk.responses(modelID) (can scope to gpt-oss-120b if preferred, but I’ll default to all Scaleway models unless advised otherwise).
- Keep the existing base URL https://api.scaleway.ai/v1 and API key handling; no auth changes.
- Add a regression test to assert Scaleway models instantiate via responses (and thus support tool calls).
- If desired, add a brief docs note that gpt-oss-120b requires responses.
Please confirm whether you want the responses routing for all Scaleway models or only gpt-oss-120b; I can proceed accordingly.
@thdxr I’d like to take this and wire Scaleway gpt-oss-120b to the responses endpoint so tool-calling works.
Proposed plan:
- Add a provider override for scaleway in packages/opencode/src/provider/provider.ts so getModel returns sdk.responses(modelID) (can scope to gpt-oss-120b if preferred, but I’ll default to all Scaleway models unless advised otherwise).
- Keep the existing base URL https://api.scaleway.ai/v1 and API key handling; no auth changes.
- Add a regression test to assert Scaleway models instantiate via responses (and thus support tool calls).
- If desired, add a brief docs note that gpt-oss-120b requires responses.
Please confirm whether you want the responses routing for all Scaleway models or only gpt-oss-120b; I can proceed accordingly.
@kaizen403 thanks for the initiative.
I just want to add a precision that most models at Scaleway are fully supported with the completions API.
Scaleway initially added the responses API only to support gpt-oss-120b with tool calling (as the model doesn't play nice with tool calling on the completions API, I'm citing one of their team members) and their support is flagged as beta for now.
If you want my opinion, it would be safer to have the ability to specify which API endpoint to hit (through the config) so it can be decided by the user instead of forcing anything.
Hello @kaizen403
Please confirm whether you want the responses routing for all Scaleway models or only gpt-oss-120b; I can proceed accordingly.
The analysis from @jfayad is correct, this API was specifically added to support gpt-oss-120b so you should opt in to use it, instead of using it by default for all models.
Thanks for your valuable feedback
@kaizen403 note that I tried to workaround the problem by declaring the following provider
"scaleway-responses": {
"npm": "@ai-sdk/openai",
"name": "Scaleway (Responses via AI SDK OpenAI)",
"options": {
"baseURL": "https://api.scaleway.ai/v1"
},
"models": {
"gpt-oss-120b": {
"name": "scaleway/gpt-oss-120b (Responses)",
"limit": {
"context": 128000,
"output": 8192
}
}
}
}
using the openai package is using the response API by default
but the model is failing with the following "truncated" error
[{'type': 'string_type', 'loc': ('body', 'input', 'str'), 'msg': 'Input should be a valid string', 'input': [{'content': 'You are opencode, an agent - please keep going until the u...
@Gnoale could that be because the responses API implementation on Scaleway isn't 100% ISO to OpenAI's one ?