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
{{ message }}
Repository navigation
Massive token spike causing quota exhaustion in single session #26184
Was using opencode go through opencode tui. Deepseek V4 Pro was selected as the model and the session was about 500k~ tokens. The chat started to slow down and every response took a minute to respond and finally I got quota exceeded.
From my observations session an3G3iVR consumed ~5 hours of quota in ~30 minutes due to input tokens ballooning from ~20k to 500k+ per request.
From usage logs:
Normal requests (2:58-3:26 PM): 18k-21k input tokens, $0.001-$0.004 cost
After 3:30 PM: 570k-614k input tokens, $0.98-$1.06 cost per request
15 requests after 3:30 PM cost ~$15 instead of ~$0.05 normal.
Looks like conversation context got stuck in a loop, re-sending entire 500k token history repeatedly.
If there's anything I can do to clarify, please let me know.
Plugins
none
OpenCode version
1.14.40
Steps to reproduce
Open OpenCode TUI
Select deepseek-v4-pro model through OpenCode Go
Work in a session until it grows to ~500k tokens
Observe: responses slow down to ~1 minute each
Input tokens balloon to 500k+ per request (should stay ~500k, not multiply)
The 300× spike (≈$15 for what should've been $0.05) from context re-sending 500k tokens in a loop is exactly the runaway class I work on. Free MIT kit that stops this from torching a Mac/quota: https://github.com/IgorGanapolsky/mac-yolo-safeguards. Besides that session — what's the worst single loop incident you've hit?
This class of bug needs a per-turn context-growth ledger.
For each request, record request id, session id, model, prompt token count, prior prompt count, delta, cache read/write, compaction state, context segment counts, and whether the same large history block was resent. Then OpenCode can warn before the second or third 500k-token resend instead of only discovering the loop from quota exhaustion after the fact.
Activity
github-actions commentedon May 7, 2026
This issue might be a duplicate of an existing issue. Please check:
IgorGanapolsky commentedon Jun 6, 2026
The 300× spike (≈$15 for what should've been $0.05) from context re-sending 500k tokens in a loop is exactly the runaway class I work on. Free MIT kit that stops this from torching a Mac/quota: https://github.com/IgorGanapolsky/mac-yolo-safeguards. Besides that session — what's the worst single loop incident you've hit?
Necmttn commentedon Jun 22, 2026
This class of bug needs a per-turn context-growth ledger.
For each request, record request id, session id, model, prompt token count, prior prompt count, delta, cache read/write, compaction state, context segment counts, and whether the same large history block was resent. Then OpenCode can warn before the second or third 500k-token resend instead of only discovering the loop from quota exhaustion after the fact.
Generated with ax - https://github.com/Necmttn/ax
github-actions commentedon Aug 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.