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
Closed
common : fix gpt-oss Jinja error with content and thinking on tool-call messages#19702abhijitb11 wants to merge 1 commit intoggml-org:masterfrom
abhijitb11 wants to merge 1 commit intoggml-org:masterfrom
Conversation
…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>
Contributor
Author
|
Closing — rewriting to comply with the project's AI usage and contributing guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--reasoning-format autoin multi-turn tool-call conversationscontentfrom the adjusted message after copyingreasoning_contenttothinkingincommon_chat_params_init_gpt_oss()Fixes #19701
Details
When a client sends back conversation history containing assistant messages with
content,reasoning_content, andtool_calls, the gpt-oss input processing copiesreasoning_content→thinkingbut leavescontentin place. The gpt-oss Jinja template forbids having bothcontentandthinkingon tool-call messages (they render to the same<|channel|>analysisslot), causing an HTTP 500 error.The fix is a single line:
adjusted_message.erase("content")after settingthinking.Test plan
ggml-org/gpt-oss-120b-GGUFwith--reasoning-format auto --jinja🤖 Generated with Claude Code