Repository navigation
fix(docs-sync): raise output token cap to 16384 for Sonnet 5.5 - #2071
Merged
Merged
Conversation
Each page call returns the full regenerated page. Under Sonnet 5.5 the 4096-token cap truncated seize-and-cancel-units.mdx (8,955 chars), so the page was rejected and dropped from the sync PR (#2069 vs #2054). - DEFAULT_MAX_TOKENS: 4096 -> 16384 (CLAUDE_MAX_TOKENS still overrides) - MAX_REGENERABLE_CHARS: 10000 -> 32000 to match the new budget (~2.2 chars/token measured on Sonnet 5.5) Co-authored-by: Toshi <toshi-noreply@coinbase.com>
Collaborator
✅ Heimdall Review Status
|
youssefea
approved these changes
Oct 5, 2026
4 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.
Why
#2068 switched the docs sync to Sonnet 5.5. On the first real run (run 37331981837), the re-sync of base-std@3820cf0 dropped a page:
seize-and-cancel-units.mdx(8,955 chars) hit the 4096-token output cap (stop_reason=max_tokens), and the truncation guard rejected it. That's why #2069 touches 8 files where #2054 touched 10.introduction.mdxused 4,093 of 4,096 tokens, so it nearly failed too.Sonnet 5.5's tokenizer uses more tokens per char than 4.6, so the old 4096 budget (measured on 4.6 at 10.7k–14k chars) no longer fits pages the route table sends to the model.
Changes
llm/client.mjs:DEFAULT_MAX_TOKENSgoes from 4096 to 16384.CLAUDE_MAX_TOKENSstill overrides it.release-utils.mjs:MAX_REGENERABLE_CHARSgoes from 10000 to 32000 to match. This is the pre-call skip for pages too large to regenerate (~2.2 chars/token measured on Sonnet 5.5, with margin).index.mjs: doc comment updated.The truncation guard is unchanged. If a page still overflows, it is rejected rather than committed partially.
Cost and risk
max_tokens: 16384forclaude-sonnet-5-5.Tests
npm --prefix scripts run test:base-std-sync: 166 pass, 1 fail. The failure (upstream docs tree routes to the pages the IA guidelines assign, an extraevents.mdxroute) also fails onmasterbefore this change and is unrelated.Follow-up (separate PR)
Re-running a sync briefly resets its branch to
master, which makes GitHub auto-close the open PR (that's how #2054 was closed and replaced by #2069). The fix is to commit on a temporary ref and move the PR branch in one step.