You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running through LM Studio, it seems the new template for tools that the OpenAI OSS models use is different and causes premature reasoning to end. Not sure if this is an issue for LM Studio to solve or for Opencode to support.
AFAIK opencode uses AI SDK which handles the final formatting of the prompts for the used mode/provider. Wouldn’t be surprised if they release an update soon, they seem quite active
harmony formats is not only about model output, which is cater by the provider.
but also the application prompt requirements to achive best result when using gpt-oss.
If application required tool call using XML format, it most will failed at first shot as it mostly add <|constrain|>json before message, causing the model response in json format when tool call.
If application expect xml tool call foramt, add following to the prompt will help
1. USE XML format for all tool calls
2. DON'T add <|constrain|>json for tool calls
Activity
cksac commentedon Aug 6, 2025
looks like gpt-oss is trained with https://cookbook.openai.com/articles/openai-harmony#function-calling?
the final prompt should follow openai-harmony format to achieve better result.
jgontrum commentedon Aug 6, 2025
AFAIK opencode uses AI SDK which handles the final formatting of the prompts for the used mode/provider. Wouldn’t be surprised if they release an update soon, they seem quite active
Ronuhz commentedon Aug 6, 2025
Yeah either something goes very wrong with tool calls in OpenCode or the AI SDK, or this model sucks at tool calling.
thdxr commentedon Aug 6, 2025
it's both - the model sucks at tool calling but parsing these harmony formats is up to the provider - in this case LM Studio
i did think they pushed an update for it though?
cksac commentedon Aug 7, 2025
harmony formats is not only about model output, which is cater by the provider.
but also the application prompt requirements to achive best result when using gpt-oss.
If application required tool call using XML format, it most will failed at first shot as it mostly add
<|constrain|>jsonbefore message, causing the model response in json format when tool call.If application expect xml tool call foramt, add following to the prompt will help
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!