Repository navigation
Conversation
setup() threw when OpenCode 2 probed it without a full context, which the TUI reported as an 'orca-opencode-status' plugin failure. Both plugin files also shared one id while living in the same config dir.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe OpenCode status plugin now selects a distinct ID for each agent variant. The OpenCode2 setup validates context and hook functions before use, returns a no-op cleanup for unsupported setup states, and guards teardown operations. Tests cover incomplete contexts, missing session hooks, agent-specific IDs, and the updated generated plugin source digest. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change separates plugin IDs and hardens invalid-context setup and cleanup behavior. No actionable production risk remains identified, so it is mergeable with normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed and covers the change, rationale, testing, visual proof, compatibility, and checklist items. However, the required Linked Issue section is marked N/A even though the template states that an issue must always be linked.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one stale comment nitpick.
Reviewed changes
- Fail-open
setupOpenCode2Status— the generated setup now validates its context (ctx.session.hookandctx.event.subscribecallable) and wraps its body intry/catchreturning a no-op cleanup, with defensive disposal (promptRegistration?.dispose?.(),hooks.dispose?.()). This stops the startup probe from surfacing as a TUI plugin-failure. - Distinct default-export id per variant —
status-plugin-factory-source.tsnow emitsorca-opencode2-statusfor the opencode2 variant instead of sharingorca-opencode-status, since both files land in the same managed config dir. - Regression tests — new fail-open matrix, a no-op-disposal case, and a distinct-id assertion in
hook-plugin-opencode2-setup.test.ts; the pinned sha256 ofgetOpenCodePluginSource()was updated inhook-service.test.ts.
I ran the affected suites (src/main/opencode, src/main/opencode2, src/main/mimo, relay overlay + WSL install handlers): 235 tests pass. The new guard matches exactly what setup touches synchronously, and ctx.session.get is only reached lazily inside event handling where consume().catch already absorbs throws, so the guard's scope is coherent. No other reference to the plugin id exists in src, config, or docs; MiMo's reuse of orca-opencode-status is safe because it writes into a separate MIMEOCODE_HOME-scoped config dir.
ℹ️ Nitpicks
src/main/opencode2/status-plugin-setup-source.ts:7— the new fail-open rationale says a throw "surfaces as an 'orca-opencode-status' plugin failed error", but this source is emitted verbatim into both plugin files and the opencode2 one now reports asorca-opencode2-status. Consider wording that doesn't hardcode a single id (e.g. referencing the plugin name generically or naming both).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Incremental review of the delta since 2ea78a9f51: the only new change is 4268186287, which removes the now-unused // oxlint-disable-next-line require-yield above the empty subscribe: async function* () {} in the fail-open test. I confirmed npx oxlint reports 0 warnings/0 errors on the file without the disable, so dropping it is correct. No other files changed; the substance reviewed at 2ea78a9f51 (fail-open setupOpenCode2Status, distinct orca-opencode2-status id) is unchanged.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Superseded by #22544, which is this PR rebased onto current |

ELI5
When you launch OpenCode 2 from Orca, OpenCode 2 checks our status plugin as it starts up. Our plugin crashed during that check instead of quietly standing down, so OpenCode 2 showed an
orca-opencode-statusplugin failure message. Now the plugin stands down quietly when the check does not look the way it expects, and the two plugin files have different names internally so they cannot be confused with each other.What Changed
Before: opening an opencode2 terminal could show a plugin failure naming
orca-opencode-status, and status reporting for that pane was dead. After: no failure message; status reporting works when the plugin API matches and silently stays off when it does not.Mechanism (2 source files):
src/main/opencode2/status-plugin-setup-source.ts:setupOpenCode2Status()(the code injected into both generated plugin files) now validates its context up front, wraps everything in try/catch returning a no-op cleanup, and made unload defensive (promptRegistration?.dispose?.(),hooks.dispose?.()).src/main/opencode/status-plugin-factory-source.ts: the opencode2 variant now exports idorca-opencode2-statusinstead of sharingorca-opencode-status(both files load from the same config dir).Why
Alternatives considered: pinning to one exact OpenCode 2 setup-API shape, or removing
setupfrom the v1 file. Both reintroduce the same crash the next time the API drifts or a stale file loads in the other binary. Fail-open matches the existing philosophy everywhere else in this integration (overlay writes, hook posts, and theserver()factory already fail open), and the distinct id removes the duplicate-id collision for good.Linked Issue
N/A — reported directly by the user in-session; no filed issue.
Visual Proof
N/A — no UI change in Orca itself. The user-visible change is the absence of OpenCode 2's plugin-failure message.
Testing
I manually tested these changes locally
Automated tests added/updated
New regression tests in
hook-plugin-opencode2-setup.test.ts: setup resolves to callable cleanup forundefined/{}/ partial contexts, cleanup tolerates a hook returning nothing, distinct id per variant.Updated pinned source hash in
hook-service.test.ts.Full suites green:
src/main/opencode/,src/main/opencode2/, relay overlay + WSL + agent-hook integration (213 tests).Live verification of generated sources (bundled via esbuild, imported as ESM): 17/17 checks pass — distinct ids, fail-open matrix on both variants,
server(undefined)OK, positive control posts SessionBusy/SessionIdle through a valid context, mismatched-agent guard still no-ops.pnpm tc:node,oxlint,oxfmt --checkclean on changed files. Tested on macOS; change is platform-independent (pure JS string generation) and flows to SSH/WSL automatically since relay and guest installs receive generated source at session-ready.Agent skill upstream boundary
Notes
Security/cross-platform/SSH/mobile/backcompat: no new filesystem, network, or platform behavior; generated plugin is strictly more permissive about when it stays silent. Stale plugin files already on disk refresh automatically on next PTY spawn (local) or relay materialization (SSH/WSL) — no migration needed.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)