Summary
Every session fails to start with Instructions.InitializationBlocked: Instruction initialization blocked by unavailable sources: core/instructions. The root cause is a RangeError: Maximum call stack size exceeded (stack overflow) in the core/instructions source activation code. This affects both the shared background service and --standalone mode.
Environment
- opencode version: 2.0.11 (latest, channel=latest)
- OS: Windows 11 Pro, Build 22631, x64
- Terminal: Windows Terminal / PowerShell 7
- Shell:
C:\WINDOWS\system32\cmd.exe / PowerShell 7
- Install/channel: npm global install (
@opencode/cli@2.0.11)
- Active plugins:
postgres (local plugin at ~/.config/opencode/plugins/postgres), herdr-agent-state.js, i-have-adhd.js
Reproduction
- Install OpenCode v2.0.11 via npm (
npm install -g @opencode/cli)
- Run
opencode (or opencode --standalone)
- Create a new session
- Session immediately fails with the error below
Expected Behavior
Session should start normally and process messages.
Actual Behavior
Every session fails immediately on creation. The logs show:
WARN "failed to activate instruction source"
cause="Cause([Die(RangeError: Maximum call stack size exceeded.)])"
ERROR "Failed to drain Session"
cause="Instructions.InitializationBlocked: Instruction initialization
blocked by unavailable sources: core/instructions
at FE (chunk-1sa5rvxc.js:30:42285)
at InstructionState.observe (chunk-1sa5rvxc.js:32:1283)
at InstructionState.prepare (chunk-vyhk950s.js:365:2744)
at SessionRunner.prepareContext (chunk-vyhk950s.js:365:2321)
at SessionRunner.advanceToStep (chunk-vyhk950s.js:365:2583)
at SessionRunner.drain (chunk-24mc5jhy.js:24:2279)"
This happens consistently across:
- Multiple project directories
- Both shared service and
--standalone mode
- After service restart (
opencode service stop + restart)
- After full computer restart
Additional Context
- The
core/instructions source crashes with infinite recursion before it can be marked as available, which then blocks session initialization.
- Workaround attempted:
opencode --standalone — same error occurs.
- Config file is minimal (
~/.config/opencode/opencode.json), AGENTS.md is only 756 bytes (16 lines).
- Full log available at
~/.local/share/opencode/log/opencode.log (~45MB).
Summary
Every session fails to start with
Instructions.InitializationBlocked: Instruction initialization blocked by unavailable sources: core/instructions. The root cause is aRangeError: Maximum call stack size exceeded(stack overflow) in thecore/instructionssource activation code. This affects both the shared background service and--standalonemode.Environment
C:\WINDOWS\system32\cmd.exe/ PowerShell 7@opencode/cli@2.0.11)postgres(local plugin at~/.config/opencode/plugins/postgres),herdr-agent-state.js,i-have-adhd.jsReproduction
npm install -g @opencode/cli)opencode(oropencode --standalone)Expected Behavior
Session should start normally and process messages.
Actual Behavior
Every session fails immediately on creation. The logs show:
This happens consistently across:
--standalonemodeopencode service stop+ restart)Additional Context
core/instructionssource crashes with infinite recursion before it can be marked as available, which then blocks session initialization.opencode --standalone— same error occurs.~/.config/opencode/opencode.json), AGENTS.md is only 756 bytes (16 lines).~/.local/share/opencode/log/opencode.log(~45MB).