Repository navigation
Description
Prerequisites
- I will write this issue in English (see our Language Policy)
- I have searched existing issues to avoid duplicates
- I am using the latest version of oh-my-opencode
- I have read the documentation or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer
Bug Description
Steps to Reproduce
Issue Report: Prompt exceeds model context limit
Error
{
type: error,
error: {
type: invalid_request_error,
message: prompt is too long: 217905 tokens > 200000 maximum
},
request_id: req_vrtx_011CY5g2rB83xX4CoVEvdoHg
}
Description
The conversation prompt reached 217,905 tokens, exceeding the model's 200,000 token context limit. The API rejected the request with an invalid_request_error.
Model Configuration
{
antigravity-claude-opus-4-6-thinking: {
limit: {
context: 200000,
output: 64000
},
variants: {
max: { thinkingConfig: { thinkingBudget: 32768 } }
}
}
}
Root Cause Analysis
Total prompt token count of 217,905 exceeded the 200,000 limit by approximately 17,905 tokens (~9%). Contributing factors likely include:
- Large system prompt overhead — The oh-my-opencode Sisyphus agent system prompt is substantial, containing detailed behavioral instructions plus all tool definitions (Figma MCP ~15 tools + Chrome DevTools ~25 tools + opencode built-in tools).
- Conversation history accumulation — Multi-turn dialogue causes token count to grow monotonically without pruning.
- Figma MCP response payload — The get_metadata call returns verbose XML-formatted design tree data, which can be token-heavy.
- Thinking budget reservation — The thinkingBudget: 32768 may reduce effective available context for prompt content.
Steps to Reproduce - Configure antigravity-claude-opus-4-6-thinking as the Sisyphus agent model with context: 200000.
- Enable Figma MCP (figma-desktop) and Chrome DevTools MCP.
- Engage in a multi-turn conversation involving Figma MCP tool calls.
- After sufficient history accumulates (~200K tokens), the next request fails with the above error.
Expected Behavior
Expected Behavior
The system should gracefully handle conversations approaching the context limit — either by truncating/pruning older messages, warning the user, or automatically managing context window usage.
Actual Behavior
Actual Behavior
The request is rejected outright by the API with no prior warning or automatic mitigation.
Doctor Output
Environment
| Item | Value |
|------|-------|
| OS | macOS 15.5 (Build 24F74) |
| Architecture | arm64 (Apple M4 Max) |
| Node.js | v20.19.5 |
| npm | 10.8.2 |
| opencode-ai | 1.1.59 (global install) |
| @opencode-ai/plugin | 1.1.59 |
| oh-my-opencode | 3.5.2 |
| Active Model | google/antigravity-claude-opus-4-6-thinking (Sisyphus agent) |
| Configured Context Limit | 200,000 tokens |
| Configured Output Limit | 64,000 tokens |
| Thinking Budget (variant: max) | 32,768 tokens |
| Figma MCP | figma-desktop via http://127.0.0.1:3845/mcp (remote) |Error Logs
Configuration
Additional Context
No response
Operating System
macOS
OpenCode Version
1.1.59
Activity
aikazu commentedon Feb 13, 2026
yep same, its happen since 4.6. trying workaround using experimental config mentioned it other issues, still same.
ChoKhoOu commentedon Feb 13, 2026
English
The author has not been fixing it. Many issues have been raised, but it is useless; they do not care. I saw that someone seemed to have tried to fix this with a PR, but it was not accepted either.
Original
作者一直没修,提了很多 issue 也没用,根本不管。我看好像有人提 PR 修这个,也没被接受。
smashah commentedon Feb 14, 2026
which PR @ChoKhoOu
?
code-yeongyu commentedon Feb 16, 2026
[sisyphus-bot] Hi everyone! Thank you for reporting and discussing this issue.
This is a friendly reminder that per our English-Only Policy, all GitHub communications (issues, PRs, comments) must be written in English. This helps ensure all contributors can participate and understand the discussions.
I've added English translations to any non-English content above. Please use English for future comments on this issue.
Thank you for your understanding and cooperation!
code-yeongyu commentedon Feb 17, 2026
Analysis: Root Cause Identified
This is a confirmed bug affecting Claude Opus 4.6 users.
Problem
The plugin hardcodes a 200K context limit for all Anthropic models unless the
ANTHROPIC_1M_CONTEXT=trueenvironment variable is set. However, Claude Opus 4.6 natively supports 1M tokens.This causes:
217905 tokens > 200000 maximum)Evidence
Current code in
src/hooks/preemptive-compaction.tsandsrc/hooks/context-window-monitor.ts:The
isOpus46()model detection exists insrc/hooks/anthropic-effort/hook.tsbut is not applied to the context window hooks.Fix Exists
Commit
f977423ccontains the fix that addsisOpus46()check to both hooks:OPUS_4_6_LIMIT = 1_000_000constantisOpus46(modelID)function for model detectionisOpus46(modelID) ? OPUS_4_6_LIMIT : ANTHROPIC_ACTUAL_LIMITHowever, this fix is only in
remotes/marlon/mscbranch and not merged to the current release branch.Workaround
Until the fix is merged, set this environment variable:
export ANTHROPIC_1M_CONTEXT=trueThen restart OpenCode. This will treat all Anthropic models as having 1M context.
Related
Recommendation: Cherry-pick or merge commit f977423 to resolve this issue.
fix(delegate-task): add token counting and truncation to prevent cont…