Skip to content

common : fix gpt-oss Jinja error with content and thinking on tool-call messages#19702

Closed
abhijitb11 wants to merge 1 commit intoggml-org:masterfrom
abhijitb11:fix/gpt-oss-thinking-content-conflict
Closed

common : fix gpt-oss Jinja error with content and thinking on tool-call messages#19702
abhijitb11 wants to merge 1 commit intoggml-org:masterfrom
abhijitb11:fix/gpt-oss-thinking-content-conflict

Conversation

@abhijitb11
Copy link
Copy Markdown
Contributor

Summary

Fixes #19701

Details

When a client sends back conversation history containing assistant messages with content, reasoning_content, and tool_calls, the gpt-oss input processing copies reasoning_contentthinking but leaves content in place. The gpt-oss Jinja template forbids having both content and thinking on tool-call messages (they render to the same <|channel|>analysis slot), causing an HTTP 500 error.

The fix is a single line: adjusted_message.erase("content") after setting thinking.

Test plan

  • Served ggml-org/gpt-oss-120b-GGUF with --reasoning-format auto --jinja
  • Sent multi-turn chat completions with tool calls — confirmed no more 500 errors
  • First-turn requests continue to work as before

🤖 Generated with Claude Code

…ent and thinking with tool calls

Erase `content` from the adjusted message after copying `reasoning_content`
to `thinking`, so the gpt-oss template does not see both fields on
tool-call messages.

Regression from ggml-org#16937.

Fixes ggml-org#19701

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abhijitb11 abhijitb11 requested a review from pwilkin as a code owner February 18, 2026 04:25
@abhijitb11
Copy link
Copy Markdown
Contributor Author

Closing — rewriting to comply with the project's AI usage and contributing guidelines.

@abhijitb11 abhijitb11 closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Jinja template error on multi-turn tool calls with reasoning_content (gpt-oss)

1 participant