Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Labels
Description
Summary
Invoking the subagent tool fails every time with the error OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building., even though the session itself is running inside OpenCode (desktop app) on an OpenCode Zen model (opencode/mimo-v2.6-flash-free) and the main agent works fine. No local install files (app.asar or otherwise) are modified.
Environment
- opencode version: v2.0.27 (
opencode --version) - OS: Windows_NT 10.0.26340 (win32 x64)
- Terminal:
TERM=xterm-256color,TERM_PROGRAMandCOLORTERMunset - Shell: custom shell at
.opencode\tools\out\bash.exe(workspace wrapper that spawns PowerShell);ComSpecnot set in the session process - Install/channel: release / latest (v2.0.27), stock desktop install, no patched app.asar or modified package files
- Active plugins: none in config (
.opencode/opencode.jsonhas nopluginentries); local plugin folders exist under.opencode/plugins/:engram,instructions,messages,shell-shield,soundfx,toolbox
Reproduction
- Start OpenCode (desktop) on Windows v2.0.27 with
.opencode/opencode.jsoncontaining"model": "opencode/mimo-v2.6-flash-free"and permissions including{ "action": "subagent", "resource": "*", "effect": "allow" }. - Start a normal chat session (main agent responds normally on the Zen model).
- Call the
subagenttool, e.g.subagent({ agent: "planner", description: "Plan GLM Discord bot", prompt: "Decompose this into a plan..." }). - The tool returns an error envelope instead of spawning a child session.
- Repeat — same failure.
Expected Behavior
The subagent tool should spawn a child session for the requested agent and return its response, since the parent session is authenticated and running inside OpenCode.
Actual Behavior
Every spawn fails immediately (2/2 attempts, different session IDs each time):
{"error":{"type":"tool.execution","message":"Subagent failed (sessionID: ses_ec4c0e3c1ffe2FBVrY4fs5OUEU): OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."}}Second attempt:
{"error":{"type":"tool.execution","message":"Subagent failed (sessionID: ses_ec4c09b1fffePNprxmfjwJ7Pcc): OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."}}Additional Context
- The main agent in the same session works normally on the same provider/model (
opencode/mimo-v2.6-flash-free) — only child-session spawn trips the "free tier" gate, so the child session appears to run without the parent's provider/auth context. - Reproducible: 100% (2/2 in this session), same message both times.
- No config/plugin was changed before or during the failures; no install files modified.
- Suspicion: the free-tier validity check in the subagent spawn path tests something the child session doesn't inherit (auth context / launcher detection) rather than the actual provider credentials.
Activity
UnixUserDev commentedon Oct 14, 2026
OS clarification: this is Windows 11 Insider Preview (build 10.0.26340, Insider channel). The 10.0.26340 version string in the environment section is the Win11 Insider build number, not Windows 10 — flagging it in case the free-tier gate has any OS/build-dependent path (e.g. launcher detection under an unsigned preview build).
opencode-agent commentedon Oct 14, 2026
Thanks for the detailed report! I think this is a duplicate of #50806. That issue reports the same thing: spawning a custom subagent on a free OpenCode Zen model fails with "OpenCode's free tier can only be used from within OpenCode", while the parent session on the same model works.
The cause is tracked in #50627. People there found that the free-tier check on the Console side rejects requests whose tool list leaves out some of the standard tools. This most often happens because the agent's permissions
denyshell(sobashis dropped), but a small tool allowlist triggers it as well. That would explain why your main agent works and theplannersubagent doesn't, even though it's the same model in the same session.Possible duplicates and related issues, ordered from most to least likely:
shelldeny on a custom agent makes free-tier requests fail); workarounds are discussed thereopencode/xxxxx-modelfails when used by a custom subagent #51612: custom subagent using anopencode/*-freemodel rejected with the same errorexploresubagents whilegeneralworksUntil it's fixed, people in #50627 report that changing the custom agent's
shellrule fromeffect: denytoeffect: ask, and not limiting it to a small tool allowlist, avoids the error. Using a built-in agent likegeneralalso works.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. For example, tell us if your
planneragent has no permission or tool restrictions at all.UnixUserDev commentedon Oct 14, 2026
Confirmed duplicate of #50806 / root cause #50627 — happy for this to close as duplicate.
Evidence from this workspace (custom
planneragent):plannerfrontmatter hadpermission: { edit: deny, bash: deny, read: allow, glob: allow, grep: allow }, while the main session config had onlyallowrules (no deny). That matches the "parent works, subagent fails" pattern exactly — 2/2 spawn failures with the error from this issue onopencode/mimo-v2.6-flash-free.bash: deny→bash: askmadesubagent(planner)succeed immediately on the same free model (spawned + completed).edit: denyas-is with onlybash: ask→ spawn still succeeds. Sobash: denyis the sole trigger here;edit: denyis harmless. If policy: deny shell * on custom agent breaks free tier with "can only be used from within OpenCode" #50627's check is "any missing standard tool", this narrows it — the shell/bashtool specifically appears to be the one whose absence trips the free-tier gate.bash: deny(planner), which also lines up with subagents: explore agent denied free tier can only be used from within OpenCode while running inside the CLI — general works with identical models #49723's some-agents-fail-some-don't behavior.Environment detail from the follow-up applies here too: Windows 11 Insider build 10.0.26340, opencode v2.0.27, stock install (no modified app.asar).
opencode-agent commentedon Oct 14, 2026
Thanks for testing this so carefully, and for confirming.
Your isolation test is useful:
bash: denyalone triggers it, whileedit: denydoesn't. One caveat is that #54744 reported a case where a small tool allowlist withbashstill fails. Sobashlooks like the most common trigger rather than the only one. Please add your deny→ask andedit: denyresults to #50627, where this is tracked and where they'll be seen next to the other reports.On the Windows 11 Insider note: the OS shouldn't matter here. The same error has been reproduced on Linux and macOS (see #50627 and #49723), and in your case it went away once you changed only the agent's permissions.
Until it's fixed,
bash: askon theplanneragent is the workaround. This issue will be closed as a duplicate of #50806 as planned. Please follow that issue and #50627 for updates.UnixUserDev commentedon Oct 14, 2026
FYI maintainers: the
triagejob that produced the verdict comment on this issue failed (the verdict itself was posted, then the run crashed):Triage issue:Process completed with exit code 1Log tail:
So the triage model emitted its reply and the comment landed, but
opencode runthen returned anUnknownErrorserver failure ~1s later and the job went red. Worth checking server logs for referr_dd23143ein case any post-comment triage actions (label transitions / duplicate-close scheduling beyond the visiblepending close+triaginglabels) were skipped.Separately, the verdict itself checks out: I've since verified the #50627 workaround locally (see comment above) —
bash: denyon the custom agent was the sole trigger,bash: askfixes the spawn onopencode/mimo-v2.6-flash-free.opencode-agent commentedon Oct 15, 2026
Closing this as a duplicate of #50806, as planned. Your own tests confirmed it's the same problem: the
bash: denyrule on your customplanneragent trips the free-tier check onopencode/mimo-v2.6-flash-free, and changing it tobash: askmakes the subagent spawn work.The cause is tracked in #50627, so please follow that issue and #50806 for updates. Your isolation results (
bash: denyfails,edit: denyalone is fine) would help most there. Until it's fixed,bash: askis the workaround. Thanks again for the careful testing!