Dashboardopencode-loreToken-budget and long-context accounting

Token-budget and long-context accounting

Category: gotcha
Confidence: 0.90
ID: 01a0a4b2-8b6a-7700-9b47-549b673a95a4
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 1
Source session: 06zbSzpOmtTDyRpgH
Created: 2026-06-15 09:57:29
Updated: 2026-09-15 10:52:39

Cross-Project Recalls

ProjectHitsLast recalled
opencode 1 8d ago

Content

Anthropic max_tokens covers thinking plus visible output. For non-Claude-Code clients, floor it at thinkingBudget + THINKING_OUTPUT_HEADROOM (8192), clamped by model output capacity; an EMA-only floor can let reasoning consume everything and silently end the agent loop with finish:length. Claude Code is excluded; OpenCode does not send x-claude-code-session-id. Thread longContext uniformly through every usage-cap path, even where the current cap appears unreachable, so accounting remains consistent as models and context limits change.

Move to: