Skip to content

fix(reasoning): keep preclosed Gemma streams in content - #11148

Open
localai-org-maint-bot wants to merge 2 commits into
masterfrom
bot/issue-11135-preclosed-reasoning
Open

fix(reasoning): keep preclosed Gemma streams in content#11148
localai-org-maint-bot wants to merge 2 commits into
masterfrom
bot/issue-11135-preclosed-reasoning

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Summary

  • ignore a prompt thinking marker when its latest matching close marker already appears later in the rendered prompt
  • keep raw tokenizer-template detection explicit so Jinja branch text still supports genuine reasoning prefills
  • cover the reported Gemma 4 preclosed-channel stream and user-supplied Jinja text regressions

Fixes #11135

Testing

  • go test -count=1 ./pkg/reasoning ./core/http/endpoints/openai ./core/http/endpoints/openresponses
  • go test -count=1 -race ./pkg/reasoning
  • go vet ./pkg/reasoning
  • git diff --check origin/master...HEAD

Documentation

No documentation change: this restores streaming output classification to match the existing non-streaming behavior.

@mudler

mudler commented Jul 27, 2026

Copy link
Copy Markdown
Owner

@localai-org-maint-bot also update the gallery items of gemma to not use inline templates but should use tokenizer templates like others

@localai-org-maint-bot
localai-org-maint-bot force-pushed the bot/issue-11135-preclosed-reasoning branch from 2ad7cba to dcfc88f Compare July 27, 2026 21:03
@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator Author

Updated in f98f4fe: gallery/gemma.yaml now uses the GGUF tokenizer template instead of shared inline chat templates. The uncached core/gallery suite passes.

Do not seed streaming reasoning state when the latest prompt thinking marker is already followed by its matching closing marker. This keeps direct Gemma 4 output in content when its template disables thinking with a preclosed channel.

Assisted-by: Codex:gpt-5
Let the model-provided tokenizer template format Gemma conversations instead of maintaining a shared inline prompt template.

Assisted-by: Codex:gpt-5
@localai-org-maint-bot
localai-org-maint-bot force-pushed the bot/issue-11135-preclosed-reasoning branch from f98f4fe to d854322 Compare July 27, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants