Repository navigation
Keep the Seed-OSS required-call grammar applied through a budgeted thought - #1962
Merged
Merged
Conversation
…ought (#1958) Seed-OSS's required-call root starts with seed-thought?. The native budget sampler paused it when the model opened the thought, resumed it inside seed-thought-text and left the call after the forced close unconstrained. A grammar that models the thought it opens now stays applied, as upstream llama-server applies every eager grammar.
Contributor
|
Chat app preview removed for |
This was referenced Nov 12, 2026
Merged
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.
Fixes #1958
Summary
ThinkingBudgetwithToolChoice.requiredon Seed-OSS no longer leaves the call unconstrained after the budget closes a thought the model opened.seed-thought? text-before-calls (...)accepts<seed:think>, then the budget sampler paused it (its root is notthink-body), so it resumed insideseed-thought-textand the forced close and call were unconstrained.ToolCallGrammarUtils.keepsAppliedThroughThought(the Keep the response-format grammar applied through a budgeted forced-open thought #1956think-bodypredicate plus aseed-thoughtroot) replacestakesForcedOpenThoughtin the pause decision inllama_cpp_service.dart. Chosen over teaching the paused grammar to accept the forced close: it is one predicate, and it matches upstream, which only pauses lazy grammars (grammar_should_applyincommon/sampling.cpp).Production-readiness scope
Completeness checklist
PR type guidance
Test Plan
dart run tool/prepare_workspace.dartdart format --output=none --set-exit-if-changed .dart analyzedart run tool/testing/check_platform_boundaries.dartdart test -p vm -j 1 --exclude-tags local-only(macOS, isolated TMPDIR; 14237 passed) withcoverage-lib: 93.87% linesdart test -p chrome --exclude-tags local-only: left to CI (no Web code changed)tool/testing/run_template_parity_suites.sh,dart test -p vm test/unit/tooling/Matrix Evidence
run_template_parity_suites.shFailing-first and mutations (stories15M integration test
test/integration/thinking_budget_grammar_test.dart, plus unit tests):takesForcedOpenThought(pre-fix)seed-thoughtwithout?Cross-format probe (460 template x mode combinations from every
.jinjafixture, before vs after pause decision): exactly 2 change, both Seed-OSS required (thinkon and off). Ling3, Kimi K3, MiniMax M3, DeepSeek R1/V32/V4, Laguna, Qwen3-Coder XML and every other format are unchanged.Upstream comparison: upstream
llama-servernever pauses an eager grammar under a reasoning budget (common/sampling.cppgrammar_should_apply: lazy grammars only), so the Seed-OSS grammar stays applied there. A live run was not possible: the Seed-OSS weights are too large to run locally, andllama-serverb12110 refuses to initialise the Seed-OSS required grammar on stories15M (common_sampler_init: error initializing grammar sampler). The evidence is the durable template fixture (ByteDance-Seed-OSS.jinja), the grammar-acceptance unit test (forced budget close accepted, free text after it rejected) and the stories15M test with aseed-thought-rooted grammar. The test uses<s>as the start tag because the model's greedy tokenization of a grammar-forced<seed:think>never equals the tag's own tokens.Review Notes
High-risk regression review
69a7e217af221d7950c9327e028bf2aace8baad6/083166ef; readiness evaluator exit 2 (unverifiedPrerequisites)grammar_should_applycomparison used