Skip to content

Raise MAX_TOKENS_CAP to 64000 for the 3d studio's scenes - #4

Merged
reportbase merged 1 commit into
mainfrom
claude/nifty-hawking-y3gd52
Oct 5, 2026
Merged

reportbase merged 1 commit into
mainfrom
claude/nifty-hawking-y3gd52

Conversation

@reportbase

Copy link
Copy Markdown
Owner

A scene request in the 3d studio failed with "the answer ran out of room".

Why

  • On Claude Opus 5.5, thinking can't be turned off and counts against max_tokens.
  • A scene with windows on every house is long JSON.
  • The gateway clamped every request to 16000, so the reply stopped before its JSON closed.

Change

  • MAX_TOKENS_CAP goes from 16000 to 64000. The comment and README are updated to say why.
  • Cost: only tokens actually generated are billed, so short answers cost the same as before. The daily limit still counts requests.
  • Worst case: a reply that really uses all 64K tokens on Opus 5.5 costs about $1.30.
  • Guard test: a new test reads wrangler.toml and fails if the cap drops below 64000. The cap is clamped silently, so lowering it would otherwise show up only as cut-off answers.

The matching studio change, which asks for 64000 and for compact JSON, is in reportbase/3d. Merging this deploys the Worker.

Tests

npm test: 31 pass, 0 fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_015yy9hSCgHQ5WYRZu4JMuW9


Generated by Claude Code

Oct 5: a scene request failed with "the answer ran out of room". On
Claude Opus 5.5 thinking cannot be turned off and counts against
max_tokens, and a scene with windows on every house is long JSON; the
gateway clamped every request to 16000, so the reply stopped before its
JSON closed. Only tokens generated are billed, so the higher cap costs
nothing on short answers; the daily limit still counts requests. A test
reads wrangler.toml so the cap is not silently lowered again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015yy9hSCgHQ5WYRZu4JMuW9
@reportbase
reportbase merged commit 6d0107a into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants