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