Bug: custom primary agents are rejected by the Console free tier (MissingSessionID) — built-in agents work
Environment
- opencode Desktop v1.18.31 (
@opencode-aidesktop) on Windows
- Provider:
opencode (OpenCode Zen), model opencode/big-pickle (keyless free tier)
- Custom primary agent
hermes (mode: primary, defined both inline in opencode.jsonc and as agent/core/hermes.md; also set as default_agent)
Symptom
Any request sent by the custom primary agent fails immediately, every time:
AI_APICallError: Error from provider (Console): OpenCode's free tier can only be used from within OpenCode
(server error type MissingSessionID — the message string is not present anywhere in the desktop client bundle, so it is produced by the Zen backend)
Evidence
From ~/.local/share/opencode/log/opencode.log, same app run, same provider/model, same session:
agent=hermes mode=primary session.id=ses_f30f79d63ffeat6eneU25KKLnI -> stream error: "OpenCode's free tier can only be used from within OpenCode" (2026-09-23 16:10:29)
agent=hermes mode=primary session.id=ses_f30f237edffemZw1IhNHqGeg22 -> stream error: same (2026-09-23 16:16:23)
agent=build mode=primary session.id=ses_f30f79d63ffeat6eneU25KKLnI -> OK (repeatedly, right after the failure above)
agent=compaction mode=primary session.id=ses_f30f79d63ffeat6eneU25KKLnI -> OK
agent=coder mode=subagent session.id=ses_f30df6c1effeq553V0i4zuKtGd -> OK (custom subagent, same model, live probe)
agent=title mode=primary -> OK
So: built-in primary agents pass, custom primary agents always fail, and custom subagents pass. x-opencode-session is populated for the failing requests too (the client adds it at LLM run for any providerID.startsWith("opencode")).
Expected behavior
Custom primary agents should be admitted on the free tier exactly like built-in primary agents, or fail with a clear, actionable error (e.g., "custom agents require a Zen API key"), rather than the generic free-tier admission refusal.
Workaround
Using a keyed model (e.g. openai/*, google/*, or an OPENCODE_API_KEY) for the custom primary agent avoids the gate.
Bug: custom primary agents are rejected by the Console free tier (MissingSessionID) — built-in agents work
Environment
@opencode-aidesktop) on Windowsopencode(OpenCode Zen), modelopencode/big-pickle(keyless free tier)hermes(mode: primary, defined both inline inopencode.jsoncand asagent/core/hermes.md; also set asdefault_agent)Symptom
Any request sent by the custom primary agent fails immediately, every time:
(server error type
MissingSessionID— the message string is not present anywhere in the desktop client bundle, so it is produced by the Zen backend)Evidence
From
~/.local/share/opencode/log/opencode.log, same app run, same provider/model, same session:So: built-in primary agents pass, custom primary agents always fail, and custom subagents pass.
x-opencode-sessionis populated for the failing requests too (the client adds it at LLM run for anyproviderID.startsWith("opencode")).Expected behavior
Custom primary agents should be admitted on the free tier exactly like built-in primary agents, or fail with a clear, actionable error (e.g., "custom agents require a Zen API key"), rather than the generic free-tier admission refusal.
Workaround
Using a keyed model (e.g.
openai/*,google/*, or anOPENCODE_API_KEY) for the custom primary agent avoids the gate.