You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#427 fixed a bug where the opencode enforcement adapter fail-closed on every gated tool call in the real opencode/Bun runtime: spawnSync(process.execPath, [bridge.mjs]) spawned the opencode binary (not node), which treated the .mjs path as a project dir, failed to cd, exited 0 with empty stdout → the adapter's JSON.parse threw → "fail-closed: bridge stdout not valid JSON".
The bug has been present since the P5 merge (#424), so the shipped opencode enforcement has been non-functional in real use — it blocked every gated tool call instead of deciding (an enforcement-installed project can't run bash or write files through opencode).
What needs to happen
Any project that installed opencode enforcement before #427 has the broken adapter on disk and needs a re-install to pick up the fix:
Identify projects with deployed opencode enforcement (.opencode/plugins/episodic-memory/).
Re-run the per-project install to redeploy the fixed enforcement.ts.
Verify post-deploy with the live test (tests/test-opencode-enforcement-live-e2e.mjs) or a manual drive of the real opencode TUI (confirm a gated write is decided, not fail-closed).
The regression test drives the actual opencode terminal — the existing proxy/node tests (test-opencode-adapter-conformance.mjs, -adapter.mjs) run under node where process.execPath IS node and structurally could not catch this class. Worth auditing other adapters (codex/pi-agent) for the same process.execPath assumption if they ever run under a non-node host.
Context
#427 fixed a bug where the opencode enforcement adapter fail-closed on every gated tool call in the real opencode/Bun runtime:
spawnSync(process.execPath, [bridge.mjs])spawned the opencode binary (not node), which treated the.mjspath as a project dir, failed tocd, exited 0 with empty stdout → the adapter'sJSON.parsethrew →"fail-closed: bridge stdout not valid JSON".The bug has been present since the P5 merge (#424), so the shipped opencode enforcement has been non-functional in real use — it blocked every gated tool call instead of deciding (an enforcement-installed project can't run bash or write files through opencode).
What needs to happen
Any project that installed opencode enforcement before #427 has the broken adapter on disk and needs a re-install to pick up the fix:
Tasks
.opencode/plugins/episodic-memory/).enforcement.ts.tests/test-opencode-enforcement-live-e2e.mjs) or a manual drive of the real opencode TUI (confirm a gated write is decided, not fail-closed).Notes
test-opencode-adapter-conformance.mjs,-adapter.mjs) run under node whereprocess.execPathIS node and structurally could not catch this class. Worth auditing other adapters (codex/pi-agent) for the sameprocess.execPathassumption if they ever run under a non-node host.