Closed as not planned
Closed as not planned
Copy link
Description
Summary
Compaction fails with:
OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building.
The session is inside opencode. Compaction appears to issue its summarization request through a path that bypasses the in-session origin, so the free-tier gate classifies an internal request as an external one.
Environment
- opencode version: 1.19.0 (
opencode), v0.0.0-beta-17823 (opencode2) — both reproduce - OS: Windows_NT 10.0.26200 (win32 x64)
- Terminal: TERM=xterm-256color, TERM_PROGRAM unset, COLORTERM unset
- Shell: C:\WINDOWS\system32\cmd.exe
- Install/channel: beta (
opencode2);opencodeon PATH as stable - Active plugins: C:\Users\irsya.config\opencode\plugins\orca-opencode-status.js
- Config: none of
opencode.json,opencode.jsonc,.opencode/opencode.json,~/.config/opencode/opencode.jsonpresent
Reproduction
- Launch opencode (
opencodeoropencode2). - Build up enough conversation length to trigger compaction (or invoke compaction directly).
- Compaction runs and returns the free-tier "can only be used from within OpenCode" rejection.
- Note
OPENCODE_TERMINAL=1is present in the session environment.
The rest of the session works normally — only the compaction request is rejected.
Expected Behavior
Compaction is an internal session operation. Its summarization request should carry the same origin as the rest of the session and be permitted on the free tier.
Actual Behavior
The compaction request is rejected as an out-of-origin free-tier request. The user is inside opencode for the entire reproduction. Compaction never completes, so the session cannot be compacted.
Additional Context
- Two opencode binaries on PATH:
opencode(1.19.0) andopencode2(v0.0.0-beta-17823). Both fail identically, which suggests the compaction request path drops or rewrites the origin marker regardless of binary. OPENCODE_TERMINAL=1is set. If compaction spawns a sub-request that does not inherit session environment or origin metadata, that would explain the classification.- Terminal env is partial:
TERMset,TERM_PROGRAMandCOLORTERMempty. Possible secondary factor if the free-tier gate does environment-based origin detection. - Frequency: consistent on both binaries, every time compaction is reached.
- Workaround: none found. Compaction is a hard blocker for long sessions.
- Impact: sessions that exceed the compaction threshold cannot be compacted at all on the free tier.
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the report! A few details would help us work out what's happening:
opencode/big-pickle, Muse Spark, MiMo, ...)? Do normal messages on that same model work fine?opencode1.19.0 is v1, which only gets critical fixes, andv0.0.0-beta-17823is a snapshot build rather than a stable release. Does it also happen on the current stable v2 (npm i -g @opencode/cli, then checkopencode --versionshows 2.0.29)?orca-opencode-status.jstemporarily removed from~/.config/opencode/plugins?/compactyourself? Does session title generation work?Please answer briefly in your own words. On the current code, compaction sends the same session and client headers as normal messages, so the cause is probably somewhere else.
You can reply here, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
Possibly related issues, ordered from most to least likely:
agent=compactionandagent=titlefailing with this error while normal requests worked. Same cause as [Bug]: Auto-compaction fails with "OpenCode's free tier can only be used from within OpenCode" on OpenCode Zen #49587.https://opencode.ai/zen/v1provider from their config.opencode auth login opencode.Irsyadmr354 commentedon Oct 15, 2026
Resolved on 2.0.29 stable — the beta snapshot was the cause.
Answers:
Model/provider:
opencode/*free tier. Normal messages on the same model work fine; only compaction failed. Title generation was in the same family.Version: failure was on
opencode2v0.0.0-beta-17823 (2.0 preview snapshot) and onopencode1.19.0. Afternpm i -g @opencode-ai/cli,opencode --versionreports 2.0.29 and compaction succeeds.So the repro is snapshot-specific. Useful to know whether the preview branch still has it or never had it.
Plugin:
orca-opencode-status.jswas active throughout, including on the working 2.0.29. Not the cause.Trigger: both automatic compaction and manual
/compactfailed on the snapshot. Neither works there.Screenshot: in the original report.
Environment for the record:
cmd.exe,TERM=xterm-256color,TERM_PROGRAMandCOLORTERMunsetOPENCODE_TERMINAL=1set in the session environmentopencode.json/opencode.jsoncin the project; config at~/.config/opencode/opencode.jsoncClosing as fixed-by-version. Leaving the details in place so it's searchable by anyone hitting this on a preview build.
opencode-agent commentedon Oct 15, 2026
Thanks for following up, and glad compaction works on 2.0.29!
On your question about preview builds: the
beta-*snapshots were built from the old v2 preview branch. That branch became the maindevline on 2026-10-10, and current releases like 2.0.29 are built fromdev, so there isn't a separate preview branch that could still have this bug. In the current code, compaction sends its request through the same path, with the same session and client headers, as normal messages. That matches what you saw on 2.0.29. If you still have an oldopencode2snapshot installed, it's worth removing it so it doesn't get picked up by accident.On 1.19.0 (v1), which only gets critical fixes, staying on v2 is the way to go.
If it comes back on 2.0.29 or a newer release, please reply here with the version and the model you were using. Otherwise this issue will be closed automatically.
opencode-agent commentedon Oct 18, 2026
Closing this one: as you confirmed, compaction works on stable 2.0.29. The failure only happened on the old
beta-*preview snapshot and on v1 (1.19.0). Thanks for the clear follow-up and for leaving the details here for anyone who hits this on a preview build.If it comes back on 2.0.29 or a newer release, please open a new issue with the output of
opencode --versionand the model you were using.