Short description
opencode v2 hangs when the plugin enabled
What happened?
Summary
Loading the third-party plugin @cortexkit/opencode-magic-context@0.42.6 as a server plugin
(plugins in opencode.jsonc) makes OpenCode V2 primary-session prompts hang: the user message
is accepted but no assistant response ever arrives. Removing the plugin restores normal responses
immediately.
Environment
- opencode version: 2.0.11
- OS: Linux 6.6.87.2-microsoft-standard-WSL2 (WSL2), x86_64
- Terminal: TERM=xterm-256color, TERM_PROGRAM=vscode, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: latest
- Active plugins: none while reproducing the workaround; plugin under test is
@cortexkit/opencode-magic-context@0.42.6 (latest on npm, published 2026-09-19), which declares
OpenCode 2 support.
Reproduction
- Add
@cortexkit/opencode-magic-context@latest to plugins in ~/.config/opencode/opencode.jsonc
(server config) and set compaction.auto: false.
- Start or restart OpenCode V2. (Config hot-reload also picks the change up.)
- Open a session and submit any prompt.
- The prompt is accepted, but no assistant response is produced; the session appears to wait forever.
Expected Behavior
The plugin loads, the session responds normally, and Magic Context manages context.
Actual Behavior
The session never responds. Observed diagnostics:
- Server log shows the plugin loaded repeatedly within a single run (6 loads in one run; e.g. 4 loads
within one second at 2026-09-21T01:17:56).
- During the hung window the plugin wrote nothing to its data dir
~/.local/share/cortexkit/magic-context/ (rpc/ and context.db kept an older timestamp),
suggesting it stalls before initializing storage.
- No
FailClosedBlockingError was logged during the V2 period.
- Removing the plugin from
plugins immediately restores responses.
Additional Context
- The plugin is V2-aware:
0.42.6 ships dist/v2/server.js, detects a V2 host via ctx.session.hook,
and writes model-context-limits-opencode2.json.
- It declares
"oc-plugin": ["server", "tui"] and exports . (server) plus ./tui (terminal).
- Its config exposes
fail_closed_blocking (default true): "When Magic Context cannot operate
(schema fence mismatch, storage open/migration failure), block the primary-session prompt with a
loud recovery error". No such error appeared in the logs, so the hang looks more like an early
setup deadlock than the fail-closed path.
- Registration placement verified:
cli.json plugins only loads terminal-only plugins, so the
server half must live in opencode.jsonc plugins. Both "server only" and "server + cli"
placements still hang.
- Workaround in use: keep the plugin disabled. Reproducibility: consistent (100%).
Diagnostics
Plugin version
0.42.6
OpenCode version
2.0.11
Platform
Win11 x64 -> WSL2
Client
OpenCode TUI (CLI)
Log output (optional)
Short description
opencode v2 hangs when the plugin enabled
What happened?
Summary
Loading the third-party plugin
@cortexkit/opencode-magic-context@0.42.6as a server plugin(
pluginsinopencode.jsonc) makes OpenCode V2 primary-session prompts hang: the user messageis accepted but no assistant response ever arrives. Removing the plugin restores normal responses
immediately.
Environment
@cortexkit/opencode-magic-context@0.42.6(latest on npm, published 2026-09-19), which declaresOpenCode 2 support.
Reproduction
@cortexkit/opencode-magic-context@latesttopluginsin~/.config/opencode/opencode.jsonc(server config) and set
compaction.auto: false.Expected Behavior
The plugin loads, the session responds normally, and Magic Context manages context.
Actual Behavior
The session never responds. Observed diagnostics:
within one second at
2026-09-21T01:17:56).~/.local/share/cortexkit/magic-context/(rpc/andcontext.dbkept an older timestamp),suggesting it stalls before initializing storage.
FailClosedBlockingErrorwas logged during the V2 period.pluginsimmediately restores responses.Additional Context
0.42.6shipsdist/v2/server.js, detects a V2 host viactx.session.hook,and writes
model-context-limits-opencode2.json."oc-plugin": ["server", "tui"]and exports.(server) plus./tui(terminal).fail_closed_blocking(defaulttrue): "When Magic Context cannot operate(schema fence mismatch, storage open/migration failure), block the primary-session prompt with a
loud recovery error". No such error appeared in the logs, so the hang looks more like an early
setup deadlock than the fail-closed path.
cli.jsonpluginsonly loads terminal-only plugins, so theserver half must live in
opencode.jsoncplugins. Both "server only" and "server + cli"placements still hang.
Diagnostics
Plugin version
0.42.6
OpenCode version
2.0.11
Platform
Win11 x64 -> WSL2
Client
OpenCode TUI (CLI)
Log output (optional)