Repository navigation
Conversation
llama.cpp forces \n</think> for the Qwen3-Coder XML family; a bare </think> let Qwen3.5 keep thinking or leak the raw call as content.
This was referenced Nov 11, 2026
leehack
added a commit
that referenced
this pull request
Nov 11, 2026
Owner
Author
Contributor
|
Chat app preview removed for |
This was referenced Nov 11, 2026
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
When a thinking budget runs out, llamadart forced a bare
</think>. llama.cpp (cd959bae9) forces\n</think>for the Qwen3-Coder XML family, and without the line break Qwen3.5 keeps thinking or leaks the raw call as content. A budget onChatFormat.qwen3CoderXml(Qwen3.5, Nemotron 3 Nano, StepFun 3.5 Flash) now appends\nto the forced message. Fixes #1914; lane 1 of #1918.ChatFormatTraits.budgetThoughtClosePrefix(default'','\n'for qwen3CoderXml), read through a top-levelbudgetThoughtClosePrefix(formatIndex); publicthinkingTagsForis unchanged.forcedMessageonly when the caller set noendTagand the plan renders the prompt (not native-chat, not schema backend): LiteRT-LM throws on any forced message.ThinkingBudget.forcedMessageDartdoc. Also fixed the stale claim that WebGPU and LiteRT-LM reject a budget.Production-readiness scope
forcedMessage.<tool_call>, DSML) as a single native end sequence; budget tags for gpt-oss, Apriel and the Gemma 4 start tag.Completeness checklist
PR type guidance
Test Plan
dart run tool/prepare_workspace.dartdart format --output=none --set-exit-if-changed .dart analyzeandcheck_platform_boundaries.dartdart test -p vmon the changed tests andtest/unit/tooling/(all pass except 6windows_registry_qualification_testcases that needpwsh, absent locally)dart test -p chrome test/unit/core/engine/chat_completion_request_planner_test.dartcoverage-lib: 93.79% lines (threshold 70%); the only failures in the full VM run were 6windows_registry_qualification_testcases needingpwsh./tool/testing/run_template_parity_suites.shrun_local_e2e.dart --scenario gguf-chat-features-smokewith Qwen3.5-2B-Q4_K_M./tool/docs/build_site.sh: not run locally (port 8080 in use by another lane); left to CIMatrix Evidence
static-format-analyzeroot-vmroot-chromecoverage-libtemplate-parityrun_template_parity_suites.shstructured-output-adversarialthinking_budget_close_parity_test.dartagainsttest/fixtures/thinking_budget_close_upstream.json(llama.cppcd959bae9); fails first on the three Qwen3-Coder XML templatesgguf-chat-features-smoketoolCallWithThinkingBudgetfinishtool_calls, 1 call, no content leakdocs-siteReview Notes
388678c575bfce28139b1b3c3deda78e0e6c5c2aHigh-risk regression review
388678c575bfce28139b1b3c3deda78e0e6c5c2a/edaf8b5629llama-serveremissions recorded in the fixture; Nemotron 3 Nano and StepFun weights unavailable, covered by upstream thinking-tag fixtures for their vendored templates