Repository navigation
Close template audit follow-ups: Cohere2 MoE closed thought, Seed-OSS trigger, mutant tests - #1550
Merged
Merged
Conversation
Cohere2 MoE with enableThinking: false closes a thought a reasoning: true kwarg opens as the template closes its own, without a trailing newline. Seed-OSS also starts its lazy grammar on <seed:tool_call><function=, which its grammar and parse already accept, and buildGrammar builds the non-parallel grammar render uses by default. Pin the surviving mutants with tests: two openings in an unended Qwen3.5 thought (X2), content openings in a thought the model opens (X7), the Hermes and DeepSeek V3 closed-thought mark (Z2/Z5), an empty first Qwen3-Coder scope (M11/M17), Hy3's reasoning_effort error, and exact Qwen3-Coder values in the scope tests. Document the thinking-switch defaults and the enableThinking: false exceptions, and the Nemotron 3 Nano parallel-grammar fix.
This was referenced Oct 28, 2026
leehack
marked this pull request as ready for review
October 28, 2026 18:43
Contributor
|
Chat app preview removed for |
12 of 13 tasks
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
Closes #1523. Refs #1531 (lane of #922).
enableThinking: falseand areasoning: truekwarg, the prompt now ends<|START_THINKING|><|END_THINKING|>, the template's own closed form, instead of adding\n. The new upstream fixture case matches llama.cpp620d2225with{reasoning: false, skip_thinking: true}byte for byte.<seed:tool_call><function=. The grammar (xml-spaceafter the scope) and the parse already accept that form. GBNF-validated.buildGrammarnow builds the non-parallel grammar thatrenderuses by default.<tool_call>s in an unended thought. X7, a content opening inside a thought the model opens streams as it parses. Z2/Z5, a Hermes, DeepSeek V3 or Qwen3-Coder template that always opens the thought keeps parsing the reply's thought after the handler closes it. M11/M17, an empty first Qwen3-Coder scope starts no later calls (upstream returns 0). Hy3reasoning_effortnone/mediumthrowsLlamaInferenceException.cities()checks exact values again, untrimmed for Qwen3-Coder and with line breaks for Seed-OSS.llamadart-chat-streamingskill now cover the Kimi K3thinkingswitch and the defaults llamadart sets (Hy3high, MiniMax M3enabled) where llama-server rendersno_think/adaptive. They also note that underenableThinking: falsea kwarg does not fully win: llamadart still closes a thought the kwarg opens, and Cohere2 MoE still drops earlier thoughts unlessskip_thinkingis set too. The changelog notes the Nemotron 3 Nano parallel-grammar fix from Parse each Qwen3-Coder XML parallel call in its own <tool_call> block (#1530) #1539 and the Cohere change.Item status
<|START_TEXT|>/<|START_ACTION|>883376d(assetsv0.1.76) decodes every token withspecial=true(src/core/generation.inc813/875), so the preserved markers reach Dart as text, as native renders its preserved tokens. Both backends drop stop sequences that are preserved tokens (_effectiveStopSequences,webgpu_backend.dart1972), so neither stops on<|END_RESPONSE|>/<|END_ACTION|>; generation ends at the EOG token.\nmessages/toolsbut not BOS/EOS, so a test of either order would pin a divergence.enabled, Hy3 throw test, Kimi K3high); test; listedcities(), SeedbuildGrammar, Nemotron changelog, Seed triggerProduction-readiness scope
enableThinking: falseplus an openingreasoningkwarg. Seed-OSS lazy grammar also starts on<seed:tool_call><function=. Docs.LlamaInferenceExceptionfor otherreasoning_effortvalues is now tested.<think>in call arguments). Upstream dropping text after tool calls. Parse cap with parallel calls off. Dropping a partial</<tool_at the end with thinking off. Also still open on Reasoning parity follow-ups from #1524/#1525 audit: mutants X2/X7, Ling <think> in args, partial-tag drop #1531 and not in this lane: Seed whitespace leniency, unknown tool in a later Seed scope, several<function=>in one Qwen3-Coder scope, truncated later scope, and Qwen3-Coder/StepFun thinking-off handling. A Seed empty first scope is not pinned: llama.cpp reads<seed:tool_call></seed:tool_call>as text and returns the later call, which is part of the Seed whitespace leniency.Completeness checklist
PR type guidance
CommandR7BHandler.render, which Cohere2 MoE inherits, closed a thought the template left open with<|END_THINKING|>\n, while the template's own off form has no newline. Root cause, Seed: Parse each Seed-OSS parallel call in its own <seed:tool_call> block (#1540) #1542 swapped the lazy trigger for llama.cpp's<seed:tool_call>\n, which dropped the compact form the grammar and parse still accept. Failing-first: the new kwargs fixture case and both Seed handler tests fail onmain. Platforms: all.Test Plan
dart run tool/prepare_workspace.dartdart format --output=none --set-exit-if-changed .dart analyze lib test tooldart test -p vm -j 1 --exclude-tags local-only(isolatedTMPDIR): +9471 ~123, all passeddart test -p chrome test/unit/core/template test/unit/core/engine/chat_completion_stream_parser_test.dart: +1118, all passeddart run tool/testing/check_platform_boundaries.dart;./tool/testing/run_template_parity_suites.sh(b10549 templates, GBNF validator): all five suites passed; oracle, render diff and mutation runs below.Evidence (oracle built from llama.cpp
620d2225, harnesses fromllamadart-evidence/pr-1542/audit/andissue-1540/; logs inllamadart-evidence/pr-1550/):pson both). Three sequential reruns of that template give identical main and head output, so the diff comes from the timing-based partial parse under 10-way load.\nback), N2/N4 (either Seed trigger dropped), N3 (SeedbuildGrammarparallel): all killed, each by the new test. MB7 survives (moved, see above).Matrix Evidence
static-format-analyzeroot-vmTMPDIRroot-chromestructured-output-adversarial620d2225; GBNF validatorhigh-risk-exact-head-independent-qa/opt/UnitySrc/personal/llama/llamadart-evidence/pr-1550/audit/evidence-1550-5229835.jsonrelease-metadata-verificationlitert-lm-json-schemadocs-siteReview Notes
High-risk regression review
620d2225oracle renders and parses, plus durable fixtures.