[codex] fix Gemma 4 thinking generation prompt#1
Draft
romgenie wants to merge 1 commit into
Draft
Conversation
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.
What changed
Fixes the Gemma 4 generation prompt in both shipped Gemma 4 templates so thinking mode opens the thought channel for generation instead of closing an empty thought block. Non-thinking mode now leaves the model turn open without injecting
<|channel>thought\n<channel|>.Why
The previous guard was inverted: it emitted a closed empty thought channel when
enable_thinkingwas false. In practice this prevented Gemma 4 from producing visible reasoning when thinking was enabled and leaked the wrong control tokens into non-thinking prompts.Validation
test-chatin an Ubuntu 24.04 Podman container and ran./build-test/bin/test-chat --template google-gemma-4../build-test/bin/test-chatsuite..devops/vulkan.DockerfileusingUBUNTU_VERSION=24.04aslocalhost/llama.cpp:server-vulkan-latest-gemma4-test.llama-server --version, which loaded the Vulkan backend and reportedversion: 8981 (d77599234).