You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, OpenCode enforces a hard-coded 200,000 token limit per conversation session. When this limit is reached, the session terminates and all context is lost, forcing users to start a new conversation.
For developers running OpenCode locally with their own compute resources and API keys, this restriction feels arbitrary - especially when their providers don't impose similar limits or when they have higher quotas available.
Proposed Solution
Add a configuration option to customize the per-session token budget, allowing users to adjust it based on their needs and resources.
Possible implementation approaches:
Config file option (e.g., ~/.opencode/config.json or .opencode/config.json)
As a developer working on complex, multi-step tasks that require extended context:
I want to maintain conversation continuity for longer sessions
Since I'm using my own local resources and API keys, I should be able to configure resource limits
Different users have different provider limits and use cases
Why This Belongs in OpenCode
OpenCode's philosophy emphasizes flexibility and user control (provider-agnostic, open source, customizable). Allowing users to configure their own resource limits aligns with this philosophy - especially since the computation happens locally on the user's machine with their own API keys.
This is particularly important for developers as extended context windows are often needed for complex refactoring, architecture decisions, or comprehensive code reviews.
Both of these issues request similar functionality for making the token/context limit configurable and allowing users to set custom thresholds for when compaction should trigger.
Feel free to ignore if your specific use case differs from these existing requests.
Activity
github-actions commentedon Jan 29, 2026
This issue might be a duplicate of existing issues. Please check:
Both of these issues request similar functionality for making the token/context limit configurable and allowing users to set custom thresholds for when compaction should trigger.
Feel free to ignore if your specific use case differs from these existing requests.
husamettinarabaci commentedon Jan 29, 2026
Thank you for pointing this out! I can see this is indeed a duplicate of the existing issues, particularly #8140.
I'll close this issue and add my support to #8140 instead to avoid fragmentation.
Apologies for the duplicate - I should have searched more thoroughly before opening this.
husamettinarabaci commentedon Jan 29, 2026
Closing as duplicate of #8140