fix(synthesis): raise reduce output cap so the breadth brief finishes#196
Merged
Merged
Conversation
The corpus-v3 breadth nudge (list EVERY holder, enumerate ALL cruxes) pushed the reduce for a large case (~125 members) past MAX_REDUCE_OUTPUT_TOKENS=16384 — runCorpusReducePass surfaced stop_reason: 'max_tokens' as "The synthesis hit its output limit before finishing." On Sonnet 5 it hit sooner: the reduce omits `thinking`, so adaptive thinking is on by default and its tokens share the same budget. Raise MAX_REDUCE_OUTPUT_TOKENS 16384 -> 32768 (far under every current model's 128k output ceiling) and CORPUS_REDUCE_TIMEOUT_MS 300000 -> 420000 so the now-larger brief can finish on the slower Opus tier instead of trading a token-cap failure for an abort. No prompt/tool/digest change, so no version bump — the cached map extracts and brief staleness keys are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
Re-running corpus synthesis on the COVID-origin case (~125 members) fails with "Synthesis failed: The synthesis hit its output limit before finishing." —
runCorpusReducePassseeingstop_reason: 'max_tokens'againstMAX_REDUCE_OUTPUT_TOKENS = 16384.Two compounding causes:
thinkingparam, so on Sonnet 5 adaptive thinking is on by default and those thinking tokens share the samemax_tokensbudget — Sonnet had less room for the brief than the earlier (pre-nudge) Opus run that fit in 16384.Fix (surgical — no prompt change, no breadth regression)
MAX_REDUCE_OUTPUT_TOKENS16384 → 32768 — far under every current model's 128k output ceiling; gives the breadth brief room plus headroom for Sonnet's adaptive-thinking overhead.CORPUS_REDUCE_TIMEOUT_MS300000 → 420000 — the now-larger brief takes longer to generate (~22k tokens × ~55 tok/s on the slower Opus tier ≈ 400s); a longer ceiling avoids trading a token-cap failure for an abort. The reduce is the one long single fetch in the corpus flow; its pendingsendResponsekeeps the MV3 service worker alive.Deliberately NOT a prompt/tool/digest change → no
MAP_PROMPT_VERSION/CORPUS_PROMPT_VERSIONbump → the ~100 cached map extracts and brief-staleness keys are untouched (the version-pinning tests stay green, and re-running only pays for the reduce, not a re-map).Verification
npm run buildcleannpm test— 1976 pass / 0 failnpm run lint— 0 errors (exit 0)🤖 Generated with Claude Code