fix(task-board): duplicate check survives a reasoning model's answer - #7379
Merged
Merged
Conversation
In production the fast tier resolves to a reasoning model that thinks before it answers: the JSON arrived after a <think> block, after narration with braces of its own, or not at all inside 1200 output tokens. Strip the think block, take the last well-formed object, give it 8000 tokens, and put the finish reason and length in the skip reason so the next miss explains itself.
Contributor
Author
|
Production data behind this PR, from the throwaway org:
So the judgement and the confidence gate are right; the remaining failure is purely the answer format of reasoning models on the default pick, which is what this PR addresses. Orgs that pin a non-reasoning fast model already work without it. |
decocms Bot
pushed a commit
that referenced
this pull request
Sep 18, 2026
PR: #7379 fix(task-board): duplicate check survives a reasoning model's answer Bump type: patch - decocms (apps/api/package.json): 4.382.0 -> 4.382.1 - @decocms/native (apps/native/package.json): 4.382.0 -> 4.382.1 Deploy-Scope: server
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
Second production follow-up to #7365 (#7376 made the outcome visible; this fixes what it revealed).
With
duplicateCheckin the output, the throwaway-org test now showedskipped: unparseable answer from qwen/qwen3.5-flash-02-23on two of three calls. The org's fast tier resolves to a reasoning model: it thinks before it answers, so the JSON arrives after a<think>block, after narration that may itself contain braces, or not at all within the 1200-token budget.Changes
parseModelJsonstrips<think>…</think>, ignores code fences anywhere, and tries every top-level balanced{…}from the last one backwards, so narration before the answer never wins.maxOutputTokens1200 → 8000, room for the model to reason before the JSON.finishReasonand the answer length, so a truncation reads asfinish=lengthinstead of a generic "unparseable". The warn log gets the tail of the answer rather than the head.<think>block with braces inside, and narration with an earlier JSON object before the real one.Testing
28 tests in
duplicate-check.test.ts,bun run check,bun run lint,bun run knip,bun run fmt. Will re-run the production scenario on the same org once deployed and report on this PR.Summary by cubic
Fixes task-board duplicate check for reasoning models so their JSON answer is used instead of being skipped as unparseable.
Bug Fixes
parseModelJsonstripsthinkingblocks, ignores code fences, and tries top-level JSON objects from last to first.maxOutputTokensfrom 1200 to 8000, which may increase cost/latency when the extra budget is used.Written for commit b5e621d. Summary will update on new commits.