Repository navigation
genkit_llamadart: resolve the thinking budget through core (#1929) - #1952
Merged
Merged
Conversation
This was referenced Nov 12, 2026
Qwen3.5: constrained JSON with a thinking budget ignores the grammar after the forced </think>
#1953
Closed
Contributor
|
Chat app preview removed for |
This was referenced Nov 12, 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
genkit_llamadartbuilds itsThinkingBudgetwithChatTemplateEngine.resolveThinkingBudget(template.format, budget)instead of hand-built tags, so Qwen3.5 / Qwen3-Coder XML closes a spent budget with\n</think>rather than a bare</think>.llamadart: ^0.19.7and the matching lower-bound pins (ci.yml,publish_genkit_pubdev.yml,genkit-package.md,ci_workflow_selection_test.dart); adds anUnreleasedpackage changelog entry. No genkit version bump (separate release-prep PR).Fixes #1929
Production-readiness scope
\n</think>instead of a bare</think>. This does not make Qwen3.5 constrained-JSON output with a budget work end to end: a separate pre-existing bug, Qwen3.5: constrained JSON with a thinking budget ignores the grammar after the forced </think> #1953, still breaks that._runStructuredModel), where Genkit renders the prompt itself (rendersPrompt: true).endTaggets no prefix.Completeness checklist
CHANGELOG.md). The genkit docsusage.md,migration.mdandtool-input-schemas.mdare updated for the\nclose prefix and the^0.19.7floor. No public API change, so no skills change.endTagpath.PR type guidance
model_action.dartduplicating, and missing, core's\nclose prefix for Qwen3-Coder XML. Regression test:inference_controls_test.dart, "Qwen3-Coder XML thinking budget". Platforms: all that run the structured path.Test Plan
dart run tool/prepare_workspace.dart(N/A: only the independently resolved adapter changed)dart format --output=none --set-exit-if-changed .(root: 0 changed)dart analyze(adapter:dart analyze --fatal-infos, no issues)dart test -p vm -j 1 --exclude-tags local-onlyN/A: no root code changed; root tests skippackages/dart test -p chrome --exclude-tags local-onlyN/A: samecoverage-libN/A: nolib/changedart format,python3 .github/check_docs.py,dart test -x real-model(474 passed)Matrix Evidence
genkit-contractsstructured-output-adversarialparams.thinkingBudget\n,\nalone, none with callerendTag; no real modelgenkit-native-cpu,genkit-releaseMutation check: reverting to the old construction fails the two prefix tests;
rendersPrompt: falsefails the same two.Review Notes
f46824cc; delta re-audit PASS atd8b49b28High-risk regression review
rendersPrompt: falseboth fail the test)llamadart-evidence/pr-1952/prior-f46824cc/qwen35-raw-probe.log). End-to-end constrained JSON with a budget still fails until Qwen3.5: constrained JSON with a thinking budget ignores the grammar after the forced </think> #1953 is fixed.