Bug Description
Tool calling with gpt-oss-20b fails during response generation with parsing error. The model successfully executes tool calls, but crashes when trying to generate a response with the results.
Error Message
Failed to regenerate message
Failed to parse tool call: Expected "<|message|>", but got "to=function" at index 89.
Environment
- LM Studio Version: [Updated on Dec 12, 2024 - latest version]
- Model:
mlx-community/gpt-oss-20b-MXFP4-Q8
- Platform: macOS (Apple Silicon)
- MCP Servers Enabled:
@modelcontextprotocol/server-filesystem
@modelcontextprotocol/server-brave-search
Steps to Reproduce
- Load
gpt-oss-20b model with MCP tools enabled
- Ask a question that triggers search tools (e.g., "Search my memory for X")
- Observe: Tools execute successfully multiple times
- Observe: Model attempts to generate response
- Error occurs: Parser crashes with the error above
- No output is returned to user
Expected Behavior
The model should successfully generate a response using the tool results, as it did before the recent LM Studio update.
Actual Behavior
- Tools execute successfully ✓
- Model begins response generation ✓
- Parser encounters gpt-oss's native tool call format ✗
- Parser expects
<|message|> at position 89 but finds to=function instead ✗
- Generation crashes, no output returned ✗
Technical Details
gpt-oss uses this chat template format for tool calls:
<|start|>assistant to=functions.TOOL_NAME<|channel|>commentary json<|message|>{"args": "..."}<|call|>
The new LM Studio parser appears to expect <|message|> earlier in the sequence, causing it to fail when it encounters to=function at index 89.
Evidence of the issue
- This worked correctly before the December 12, 2024 update
- The same setup works perfectly with
Qwen3-VL-8B-Instruct-MLX-8bit model
- The gpt-oss chat template hasn't changed - it's defined in the model's
tokenizer_config.json
- Only LM Studio's parser behavior has changed
Workaround
Using Qwen3-VL-8B-Instruct-MLX-8bit instead of gpt-oss works correctly with identical MCP server configuration.
Additional Context
gpt-oss has a unique chat template that uses special tokens like <|channel|>, <|message|>, and to= syntax for tool routing. The model expects its native format, but the new LM Studio parser appears to have broken compatibility with this format.
Bug Description
Tool calling with
gpt-oss-20bfails during response generation with parsing error. The model successfully executes tool calls, but crashes when trying to generate a response with the results.Error Message
Failed to regenerate message
Failed to parse tool call: Expected "<|message|>", but got "to=function" at index 89.
Environment
mlx-community/gpt-oss-20b-MXFP4-Q8@modelcontextprotocol/server-filesystem@modelcontextprotocol/server-brave-searchSteps to Reproduce
gpt-oss-20bmodel with MCP tools enabledExpected Behavior
The model should successfully generate a response using the tool results, as it did before the recent LM Studio update.
Actual Behavior
<|message|>at position 89 but findsto=functioninstead ✗Technical Details
gpt-oss uses this chat template format for tool calls:
<|start|>assistant to=functions.TOOL_NAME<|channel|>commentary json<|message|>{"args": "..."}<|call|>
The new LM Studio parser appears to expect
<|message|>earlier in the sequence, causing it to fail when it encountersto=functionat index 89.Evidence of the issue
Qwen3-VL-8B-Instruct-MLX-8bitmodeltokenizer_config.jsonWorkaround
Using
Qwen3-VL-8B-Instruct-MLX-8bitinstead of gpt-oss works correctly with identical MCP server configuration.Additional Context
gpt-oss has a unique chat template that uses special tokens like
<|channel|>,<|message|>, andto=syntax for tool routing. The model expects its native format, but the new LM Studio parser appears to have broken compatibility with this format.