Skip to content

fix(opencode): port the primary plugins to the OpenCode 2 plugin API - #7228

Closed
gmach wants to merge 4 commits into
kunchenguid:mainfrom
gmach:fm/opencode-v2-plugin-port
Closed

gmach wants to merge 4 commits into
kunchenguid:mainfrom
gmach:fm/opencode-v2-plugin-port

Conversation

@gmach

@gmach gmach commented Oct 13, 2026 •

Copy link
Copy Markdown

What Changed

  • Rewrote the five tracked primary plugins (fm-primary-cd-check, fm-primary-pretool-check, fm-primary-sessionstart-nudge, fm-primary-turnend-guard, fm-primary-watch-arm) and the busy-state plugin that bin/fm-spawn.sh generates into the OpenCode 2 shape. Each one is now a default export with an id and setup(ctx). Events arrive through ctx.event.subscribe() with their fields under event.data, prompts go through ctx.session.prompt, and tool interception uses ctx.tool.hook("execute.before", ...). OpenCode 2 refuses to load plugins in the old V1 named-export shape, so the OpenCode primary had no watcher continuity, turn-end guard, or pre-tool checks.
  • Because the OpenCode 2 event stream is shared across locations, the plugins now drop events whose session belongs to a different directory. They also re-subscribe if the stream fails and keep turn-end skip markers and watch-arm coordinators per session and per root, instead of using one global flag.
  • Added a shared Node test host (tests/opencode-plugin-host.mjs) that the OpenCode plugin tests now use. The behavior docs, the harness reference and the supervision verification notes now name the V2 hooks and describe what was verified live: plugin load on OpenCode 2.0.28. In the Pi watch test suite, a fixed wall-clock wait is now a poll loop that counts iterations, because the wait failed under load.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The fix round adds location filtering, a root-keyed coordinator and per-event/resubscribe guards in exactly the shape the user prescribed; tracing foreign-location, missing-location (session.get fallback) and same-location events through every plugin produced correct outcomes, and the new host cases would fail without the filter.

Testing

I started a private OpenCode 2.0.28 background service with its own home and port, separate from the operator's service, and asked it which plugins load. In this worktree all five primary plugins and the rendered fm-spawn busy-state plugin come back active. A checkout holding the base revision's V1 plugins returns five failed entries with the V2 loader error. The busy-adapter, watch-arm, turnend-guard and sessionstart-nudge suites pass in the Node host, including the cross-location assertions. Live event delivery was not driven: real busy/idle needs a model turn, and creating a session in the worktree would run the primary nudge against the default FM_HOME. Those scenarios are therefore untested live. With the widened iteration budgets left uncommitted in the worktree, the Pi suite passed fully (60 ok) on one serial run. It failed one timing-sensitive case on the parallel run and a different case on the other serial run. On the base revision it failed all three runs, at varying cases. The isolated service was stopped and its temp home deleted. The only worktree change is the widened Pi test.

  • Live validation: ✅ go - 3 of 7 scenarios driven live against the product
Scenario Result Live Evidence
OpenCode 2.0.28 loads all five ported primary plugins from a firstmate checkout as active ✅ pass live opencode-plugin-load-firstmate.txt / opencode-plugin-load.json from an isolated opencode service (port 49911, throwaway HOME)
Control: the base-revision V1 plugins are rejected by OpenCode 2.0.28 (shows the port is required) ✅ pass live opencode-plugin-load-base-firstmate.txt: five failed entries, 'Plugin must export a default definition with an id and an effect or setup function.'
The fm-busy-state.js plugin that fm-spawn generates for an OpenCode crewmate loads as active in OpenCode 2.0.28 ✅ pass live opencode-plugin-load-busy-state.txt
Busy-state plugin latches the worker session from session.status, and another location's busy/idle events change nothing ⏸️ untested no The prior payload did not establish a live result: this was covered only by the Node host suite tests/fm-busy-adapter-wiring.test.sh. Live event delivery needs a model turn on a logged-in OpenCode ses…
Watch-arm plugin arms on its own session.idle, ignores another location's idle, keys its coordinator by root, and the turn-end guard consults it ⏸️ untested no The prior payload did not establish a live result: this was covered only by the Node host suites tests/fm-watch-arm.test.sh and tests/fm-pi-watch-extension.test.sh. Event delivery and wake prompts nee…
Turn-end guard and sessionstart nudge act only for their own location's sessions ⏸️ untested no The prior payload did not establish a live result: this was covered only by tests/fm-turnend-guard.test.sh and tests/fm-sessionstart-nudge.test.sh in the Node host. Firing session.created live would r…
The Pi-suite intermittent failure predates this change (confirmed on the base revision) ⏸️ untested no This is a test-suite flakiness check with no live product surface, so the prior payload did not and could not establish a live result. The supporting observations are recorded in the finding and in th…
Evidence: Live plugin load status, ported plugins (HEAD)

Source: Live plugin load status, ported plugins (HEAD)

fm-primary-cd-check active fm-primary-pretool-check active fm-primary-sessionstart-nudge active fm-primary-turnend-guard active fm-primary-watch-arm active

fm-primary-cd-check {"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-cd-check.js"} {"status":"active"}
fm-primary-pretool-check {"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-pretool-check.js"} {"status":"active"}
fm-primary-sessionstart-nudge {"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-sessionstart-nudge.js"} {"status":"active"}
fm-primary-turnend-guard {"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-turnend-guard.js"} {"status":"active"}
fm-primary-watch-arm {"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-watch-arm.js"} {"status":"active"}
Evidence: Live plugin load status, base V1 plugins (control)

Source: Live plugin load status, base V1 plugins (control)

undefined {"status":"failed","error":"Plugin must export a default definition with an id and an effect or setup function.","ref":"err_36b42dea"}
undefined {"status":"failed","error":"Plugin must export a default definition with an id and an effect or setup function.","ref":"err_433d149c"}
undefined {"status":"failed","error":"Plugin must export a default definition with an id and an effect or setup function.","ref":"err_e3152c97"}
undefined {"status":"failed","error":"Plugin failed to load","ref":"err_eb6e9c7a"}
undefined {"status":"failed","error":"Plugin failed to load","ref":"err_3a1f8be0"}
Evidence: Live plugin load status, generated fm-busy-state.js

Source: Live plugin load status, generated fm-busy-state.js

fm-busy-state {"status":"active"}
Evidence: Raw /api/plugin response (HEAD)

Source: Raw /api/plugin response (HEAD)

{"location":{"directory":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA"},"data":[{"id":"opencode.tool.input.repair","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.worktree","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.mcp","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.mcp.codemode.defaults","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.wellknown","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.vcs.git","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.agent","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.plan","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.command","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.skill","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.vcs.hg","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.models.dev","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.amazon.bedrock","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.azure","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.cerebras","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.chatgpt","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.cloudflare.ai.gateway","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.cloudflare.workers.ai","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.cohere","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.databricks","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.digitalocean","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.github.copilot","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.gitlab","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.google.vertex","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.kilo","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.llmgateway","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.lmstudio","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.modal","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.neon","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.nvidia","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.ollama","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.opencode","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.snowflake.cortex","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.openai","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.openrouter","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.perplexity","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.poe","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.prompt-cache-key","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.sap.ai.core","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.vercel","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.vllm","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.xai","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.zenmux","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.provider.dynamic","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.websearch.exa","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.websearch.firecrawl","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.websearch.parallel","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.websearch.tavily","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.websearch.tinyfish","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.patch","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.openai","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.anthropic","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.kimi","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.arcee","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.meta","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.verbosity","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.prompt.identity","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.edit","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.glob","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.grep","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tools","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tools.mcp-resources","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.question","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.read","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.shell","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.skill","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.subagent","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.webfetch","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.websearch","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.tool.write","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.warming","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"fm-primary-cd-check","source":{"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-cd-check.js"},"features":{"server":true},"state":{"status":"active"}},{"id":"fm-primary-pretool-check","source":{"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-pretool-check.js"},"features":{"server":true},"state":{"status":"active"}},{"id":"fm-primary-sessionstart-nudge","source":{"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-sessionstart-nudge.js"},"features":{"server":true},"state":{"status":"active"}},{"id":"fm-primary-turnend-guard","source":{"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-turnend-guard.js"},"features":{"server":true},"state":{"status":"active"}},{"id":"fm-primary-watch-arm","source":{"type":"local","path":"~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/.opencode/plugins/fm-primary-watch-arm.js"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.instruction","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.reference","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.agent","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.browser","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.command","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.compaction","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.formatter","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.image","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.location-watcher","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.shell","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.snapshot","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.tool-output","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.compatibility","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.skill","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.provider","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.websearch","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}},{"id":"opencode.config.policy","source":{"type":"builtin"},"features":{"server":true},"state":{"status":"active"}}]}
Evidence: busy-adapter wiring suite log

Source: busy-adapter wiring suite log

ok - a claude secondmate spawn arms the busy contract the stall gate can see, and Stop does not wake the parent
ok - a raw claude, pi, pi-signed, or omp secondmate launch writes no busy wiring and classifies unknown
ok - a claude secondmate's Stop guard records busy on a blocked Stop and idle on an allowed one, in any hook order, and a rewake turn reopens busy
ok - a claude secondmate whose home guard predates .fm-busy-stop keeps the Stop idle hook
ok - a claude secondmate spawn leaves an existing settings.local.json untouched
ok - a pi secondmate loads the busy extension beside its primary extensions and does not emit a parent turn-end
ok - an omp secondmate names only the out-of-home busy extension and does not emit a parent turn-end
ok - an opencode secondmate plugin closes the parent busy record without a parent turn-end
ok - codex and grok secondmates stay on their existing verdicts and do not emit a parent turn-end
ok - pi extension reports agent_start busy, settles idle only via ctx.isIdle(), and keeps turn_end a notification
ok - pi extension awaits agent_settled before the next agent_start without a test delay
ok - pi extension events from a superseded incarnation are rejected as stale
ok - kimi and grok install no unverified semantic wiring and classify through their own gates
ok - opencode plugin classifies from session.status, scoped to the latched worker session in its own location
ok - claude hooks open on UserPromptSubmit and close on Stop, StopFailure, and SessionEnd
ok - claude hook events from a superseded incarnation are rejected without breaking the hook
ok - gemini hooks open on BeforeAgent and close on AfterAgent and a repeated SessionEnd
ok - gemini hook events from a superseded incarnation are rejected without breaking the hook
ok - raw gemini launch remains unwired and classifies unknown
ok - gemini is refused as a secondmate because it has no primary supervision protocol
ok - codex classifies unknown until a semantic source is verified, never idle or footer-matched
all fm-busy-adapter-wiring tests passed
EXIT 0
Evidence: watch-arm suite log

Source: watch-arm suite log

ok - watch-arm: an attached arm reports the wake its cycle delivered instead of a false failure
ok - watch-arm: a delivered wake consumed by the handling turn still closes the attached arm cleanly
ok - watch-arm: an unusable launch confirm window refuses to arm by name
ok - watch-arm: a disposable validation checkout refuses to arm
ok - watch-arm: a watcher exits when its state directory is removed
ok - watch-arm: a watcher exits when its home is removed
ok - watch-arm: the test reaper stops a watcher armed for a tracked temporary home
ok - watch-arm: a cycle that delivered no wake of its own still fails loudly
ok - watch-arm: an attached arm keeps following a slow live holder and reports its wake
ok - watch-arm: an attached arm hands a holder stalled past the bound to its owner's replacement
~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/bin/fm-watch-arm.sh: line 766:  9904 Killed: 9                  "$WATCH" > "$child_out"
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 2 --recovery-generation 11312.1791901810.c7EEeZ
ok - watch-arm: re-arm surfaces every queued wake and an open remote decision after downtime
~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA/bin/fm-watch-arm.sh: line 766: 29165 Killed: 9                  "$WATCH" > "$child_out"
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 30072.1791901832.MRPa1w
ok - watch-arm: a re-arm whose recovery cycle runs slowly still surfaces it
watcher: recovery state could not be persisted; retaining stale lock evidence
ok - watch-arm: marker publication failure retains stale-lock recovery evidence
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 2 --recovery-generation 42792.1791901856.AmybJm
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 3 --recovery-generation 46951.1791901861.RslqcQ
ok - watch-arm: a wake queued after handling drain is recovered once at successor arm
ok - watch-arm: interrupted handling leaves its wake durable for successor re-drain
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 0 --recovery-generation 57995.1791901881.TymEJl
ok - watch-arm: malformed recovery state is quarantined without a successor loop
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 1 --recovery-generation 61135.1791901886.zndbQk
ok - watch-arm: publication after recovery handoff is surfaced
ok - watch-arm: restart publishes recovery before clearing a reused-pid watcher lock
WAKE_ACK_REQUIRED: after handling completes run bin/fm-wake-drain.sh --ack-through 7 --recovery-generation 64177.1791901892.iqmiO2
ok - watch-arm: markerless legacy queues are adopted and recovered
ok - watch-arm: an idle Lavish source stays quiet and its real result wakes promptly
ok - watch-arm: appending work reopens an announced empty recovery
ok - watch-arm: a watcher close during handling keeps the printed acknowledgement valid
ok - watch-arm: a moved recovery generation consumes handled rows and names its remedy
ok - watch-arm: downtime marker publication does not follow symlinks
ok - watch-arm: --stop ends only this home's watcher, publishes downtime, and reports when none runs
ok - watch-arm: an already-acknowledged handling confirmation succeeds as a no-op
ok - watch-arm: a churned generation's handling confirmation reports a mismatch and an arm check keeps it
ok - watch-arm: --take-over attaches to a cycle the named arm does not own and leaves it running
ok - watch-arm: --take-over owns a fresh cycle without a recovery wake and still surfaces queued work
watcher: secondmate liveness check failed
ok - watch-arm: takeover preserves self-exit downtime and surfaces a recovery wake
ok - watch-arm: the OpenCode arm plugin decides with the shared supervision predicate
EXIT 0
Evidence: turnend-guard suite log

Source: turnend-guard suite log

ok - fm_supervision_unhealthy: false with no state/*.meta at all
ok - fm_supervision_unhealthy: true with in-flight task and no beacon ever
ok - fm_supervision_unhealthy: true with in-flight task and a beacon far outside the grace window
ok - fm_supervision_unhealthy: false with in-flight task and a fresh beacon
ok - fm_supervision_status: FM_SUP_QUEUE_PENDING tracks state/.wake-queue
ok - fm_supervision_needed: X-mode relay poll needs supervision
ok - fm_supervision_unhealthy: source-only home needs supervision
ok - fm_supervision_needed: a registered custom check needs supervision with no task in flight
ok - fm_supervision_needed: a registered check whose bytes drifted still needs supervision
ok - fm_supervision_needed: false for a check.sh with no registration binding
ok - fm_supervision_needed: a task PR poll without a trust binding is not a registered custom check
ok - fm_supervision_status: the relay shim is not counted as a registered custom check
ok - fm-turnend-guard: silent no-op with nothing in flight
ok - fm-turnend-guard: blocks when a fresh beacon has no live watcher lock
ok - fm-turnend-guard: non-Claude path blocks a source-only home
ok - fm-turnend-guard: blocks on a dead watcher lock even when the beacon is fresh
ok - fm-turnend-guard: silent no-op with a live watcher lock and fresh beacon
ok - fm-turnend-guard: healthy non-Claude harness paths ignore Claude episode contention
ok - fm-turnend-guard: blocks on a live watcher lock with an ancient beacon
ok - fm-turnend-guard: blocks with the exact required reason in the primary when unhealthy
ok - fm-turnend-guard: blocks from active FM_HOME state, not only repo-root state
ok - fm-turnend-guard: X-mode repair reason sources the cadence config
ok - fm-turnend-guard: X-mode-only supervision remains guarded in default mode
ok - fm-turnend-guard: registered-check-only supervision is named in the block banner
ok - fm-turnend-guard: ignores stale repo-root state when FM_HOME is set
ok - fm-turnend-guard: uses FM_STATE_OVERRIDE ahead of FM_HOME/state
ok - fm-turnend-guard: stop_hook_active=true always allows the stop (never blocks twice in one turn)
ok - fm-turnend-guard: blocks a blind turn end in a secondmate's own home (.fm-secondmate-home no longer excludes it)
ok - fm-turnend-guard: idle-by-default - silent in a secondmate home with nothing in flight
ok - fm-turnend-guard: stop_hook_active=true allows the stop in a secondmate home (never blocks twice in one turn)
ok - fm-turnend-guard: secondmate deferred-death recovery - silent while watched, forces re-arm once the watcher exits
ok - fm-turnend-guard: inert in a secondmate's own child worktree (linked git worktree) even when unhealthy
ok - fm-turnend-guard: blocks a blind turn end in a treehouse-leased LINKED secondmate home (marker force-include)
ok - fm-turnend-guard: an invalid (empty) marker cannot spoof inclusion; linked worktree stays exempt
ok - fm-turnend-guard: a non-ASCII marker cannot spoof inclusion; linked worktree stays exempt
ok - fm-turnend-guard: inert in a crewmate/scout task worktree (linked git worktree) even when unhealthy
ok - fm-turnend-guard: fails open (never blocks) when jq is missing
ok - fm-turnend-guard: silent no-op on empty stdin
ok - fm-turnend-guard: runs well under the generous timing margin (1s)
ok - fm-turnend-guard-grok: forces one explicitly marked same-session resume when the shared predicate blocks
ok - fm-turnend-guard-grok: legacy environment loop guard prevents a nested resume loop
ok - fm-turnend-guard-grok: native false delegates blocking feedback with zero resume processes
ok - fm-turnend-guard-grok: native true remains bounded and starts no resume process
ok - fm-turnend-guard-grok: both spellings are typed and camelCase has deterministic precedence
ok - fm-turnend-guard-grok: malformed, invalidly typed, and missing-prerequisite payloads start neither path
ok - fm-turnend-guard-grok: missing jq and no-supervision-needed stops stay silent and bounded
ok - tracked .claude/settings.json entries: 7 inert under grok, the documented subagent exception still armed, all live under Claude
ok - .codex/hooks.json: Stop hook uses hook process root when payload cwd is outside
ok - .codex/hooks.json: Stop hook ignores nested git root guard scripts
ok - .opencode primary plugin: guard path is anchored to the plugin location, not the process cwd
ok - .pi primary extension: no-tool and multi-tool runs each inject exactly one guard follow-up
ok - .pi primary extension: delivery failure resets the logical-run latch
ok - fm-turnend-guard --claude: re-blocks a loop-guarded stop while unhealthy and unclaimed (incident regression)
ok - fm-turnend-guard --claude: X-mode-only homes re-block when auto-arm recovery is absent
ok - fm-turnend-guard --claude: a live arming epoch advances once and repeated observation is idempotent
ok - fm-turnend-guard --claude: repeated failed-to-arming races make bounded monotonic progress
ok - fm-turnend-guard --claude: terminal owner boundary excludes a concurrent start without deadlock
ok - fm-turnend-guard --claude: fresh rewake epoch prevents a duplicate continuation for the same event
ok - fm-turnend-guard --claude: an abandoned auto-arm claim no longer allows a blind stop (incident regression)
ok - fm-turnend-guard --claude: a claim whose pid was reused stops counting as recovery even while its entry reads arming
ok - fm-turnend-guard --claude: a hung owner frozen at arming with no watcher beat no longer allows a blind stop
ok - fm-turnend-guard --claude: a live open generation claim owns recovery with no lock held
ok - fm-turnend-guard --claude: a stuck generation claim no longer allows a blind stop
ok - fm-turnend-guard --claude: the terminal path clears an abandoned claim instead of stepping aside silently
ok - fm-turnend-guard --claude: fresh failed epochs preserve and advance monotonic fail-open progression
ok - fm-turnend-guard --claude: integrated fresh failures reach one bounded fail-open, stop continuation, and reset on recovery
ok - fm-turnend-guard --claude: an inert auto-arm's frozen epoch reaches one bounded fail-open and resets on recovery
ok - fm-turnend-guard --claude: a frozen unverified epoch spends the budget yet still blocks
ok - fm-turnend-guard --claude: reset contention preserves all episode state until retry
ok - fm-turnend-guard --claude: concurrent auto-arm and guard resets are idempotent and deadlock-free
ok - fm-turnend-guard --claude: stale rewake epoch does not allow a blind stop
ok - fm-turnend-guard --claude: budget exhaustion alone cannot permit a blind stop
ok - fm-turnend-guard --claude: verified fail-open is loud, bounded, attended, and non-repeating
ok - fm-turnend-guard --claude: fail-open requires both exhausted retries and consumed notice
ok - fm-turnend-guard --claude: away ownership excludes the Stop-autoarm fail-open
ok - fm-turnend-guard --claude: positive watcher recovery resets failure episode state
ok - fm-turnend-guard --claude: bounded claim wait avoids a token-consuming forced continuation
ok - fm-turnend-guard --claude: secondmate home re-blocks unclaimed and allows auto-arm-claimed stops
ok - fm-turnend-guard: a live away-mode daemon satisfies supervision with no watcher holding the lock
ok - fm-turnend-guard: away-mode daemon ownership survives a leftover dead watcher lock
ok - fm-turnend-guard: away mode with no daemon and no watcher still blocks
ok - fm-turnend-guard: away mode blocks on a dead away-mode daemon
ok - fm-turnend-guard: away mode blocks on a pid-reused away-mode daemon lock
ok - fm-turnend-guard: away-mode daemon ownership never substitutes for a fresh beacon
ok - fm-turnend-guard: a daemon lock proves nothing while away mode is off
ok - fm-turnend-guard: away-mode beacon freshness uses the poll-derived grace, not the flat default
ok - fm-turnend-guard: a dead away-mode daemon still blocks under the poll-derived grace
ok - fm-turnend-guard: the poll-derived grace is bounded, not unlimited
ok - fm-turnend-guard: with away mode off, the poll-derived grace never applies
EXIT 0
Evidence: sessionstart-nudge suite log

Source: sessionstart-nudge suite log

ok - fm-sessionstart-nudge: a genuine primary gets one explicitly marked instruction line
ok - fm-sessionstart-nudge: NO_MISTAKES_GATE is silent
ok - fm-sessionstart-nudge: .no-mistakes gate common-dir is silent
ok - fm-sessionstart-nudge: an unmarked linked task worktree is silent
ok - fm-sessionstart-nudge: a marked linked secondmate home is a primary
ok - fm-sessionstart-nudge: a checkout without state is silent
ok - fm-sessionstart-nudge: a lock holder in process ancestry is already run
# skip: unprivileged PID namespaces are unavailable here, so the namespace pid 1 lock owner is unverified
ok - OpenCode session.created delivers the exact wrapper nudge once per session, only in its own location
ok - run wrapper: startup runs the full digest and never also nudges
ok - run wrapper: clear and compact re-emit the digest without repeating startup sweeps
ok - run wrapper forwards only stale-cache rebuild sources to immutable-baseline instruction refresh
ok - run wrapper refreshes a compact even when startup completion is unproven
ok - run wrapper: clear falls back to full startup when completion is unproven
ok - run wrapper: clear accepts completion only from the current harness
ok - run wrapper: resume delegates to the nudge instead of re-running the digest
ok - run wrapper: the hook payload's source field drives routing with no explicit argument
ok - run wrapper: an unrecognized or absent source takes the helm rather than skipping it
ok - run wrapper: ordinary ineligible opens stay silent-zero and Pi preflight gets an explicit silent stand-down
ok - run wrapper: a fresh primary checkout gets its missing state dir created, a linked worktree still does not
ok - run wrapper: a fresh primary that cannot create its state dir says so on stderr, then stands down
ok - run wrapper: a session start that cannot take the lock still opens the session and says so
ok - Pi distinguishes header-proven restored CLI sessions from named create-if-missing startups
ok - Pi provider preflight owns one generation-bound startup prerequisite with deterministic fallback, replacement, cancellation, timeout, and truncation
ok - Pi reload shutdown releases its exit listener and stale startup generation
ok - Pi retains a bounded digest prefix and loudly marks oversized preflight delivery
EXIT 0
Evidence: Pi suite intermittent failure at HEAD (serial run 1)

Source: Pi suite intermittent failure at HEAD (serial run 1)

ok - Pi extension reports external healthy watcher output
ok - Pi custom tool exposes repair-only metadata and returns automatic-continuation guidance
ok - Pi redundant tool call returns ownership guidance and spawns no second child
ok - Pi scheduled retry remains extension-owned after another tool call
ok - Pi actionable close starts one successor before wake delivery settles
ok - Pi actionable output waits for predecessor close before successor restoration
not ok - Pi dispatcher must hand an accepted wake to the branch and fall back to main otherwise: expected exit 0, got 1
EXIT 1
Evidence: Pi suite failure at HEAD under parallel load

Source: Pi suite failure at HEAD under parallel load

ok - Pi extension reports external healthy watcher output
ok - Pi custom tool exposes repair-only metadata and returns automatic-continuation guidance
ok - Pi redundant tool call returns ownership guidance and spawns no second child
ok - Pi scheduled retry remains extension-owned after another tool call
not ok - Pi actionable close must start one successor before wake delivery settles: expected exit 0, got 1
EXIT 1
Evidence: Pi suite failures on base revision 6407052 (runs 1-3)

Source: Pi suite failures on base revision 6407052 (runs 1-3)

not ok - Pi extension must surface an external healthy watcher as an owned-wake failure: expected exit 0, got 1
EXIT 1
- Outcome: ⚠️ 1 warning across 2 runs (38m57s)

Pipeline

Updates from git push no-mistakes

⏭️ **intent** - skipped

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed ✅
  • 🚨 .opencode/plugins/fm-primary-turnend-guard.js:75 - The ported plugins act on every session.idle / session.created / session.status event from the whole OpenCode 2 server, not only their own location. In OpenCode 2.0.28 every TUI connects to one shared background service by default (opencode --help: --standalone Run with a private server instead of the background service). fm-spawn starts crewmates with plain opencode --prompt (bin/fm-spawn.sh:2179), so the primary and every OpenCode crewmate share that server. The plugin context's event.subscribe filters only by event kind (binary: event:{subscribe:()=>D.subscribe().pipe($o((H)=>bX(H)||J8(H)))}). OpenCode's own code checks location itself: the built-in browser plugin rejects with "Session belongs to another location" when session.location.directory !== ctx.location.directory, and the TUI drops events where e.location.directory !== o.location.directory. V1 plugins ran in each TUI's own process and only saw that instance's events, so this is a regression.

Concrete failure: a crewmate's OpenCode session goes idle while the primary's watcher is unhealthy. The primary's turn-end guard gets that crewmate sessionID, fm-turnend-guard.sh returns 2 for the primary home, and ctx.session.prompt injects "TURN WOULD END BLIND" plus primary recovery instructions into the crewmate's session. Same root cause at the sibling sites:

  • .opencode/plugins/fm-primary-watch-arm.js:577-581: a foreign session.idle calls ensureArm with the foreign sessionID, so later primary watcher wake prompts go to the crewmate's session.
  • .opencode/plugins/fm-primary-sessionstart-nudge.js:53-56: every session.created anywhere on the server runs the primary's nudge script. Only the home-lock check prevents a nudge.
  • bin/fm-spawn.sh:4862-4880 (generated fm-busy-state.js): each crewmate latches the first busy session on the whole server (line 4867), so crewmate A reports busy/idle according to crewmate B's or the primary's turns and corrupts busy-state truth.
  • .opencode/plugins/fm-primary-watch-arm.js:571 and fm-primary-turnend-guard.js:59: globalThis.__firstmateOpenCodeWatchArm now lives in one shared server process. A firstmate scout or crewmate worktree that loads the same tracked plugin overwrites the primary's coordinator, and the primary guard then consults the wrong root.

Fix at the shared boundary: drop events whose location does not match ctx.location.directory (the event envelope's location, or ctx.session.get + location.directory as OpenCode's own plugin does) before any handler runs, and key the coordinator by resolved root. tests/opencode-plugin-host.mjs never emits foreign-location events, so the suites cannot catch this. Add a host case that emits an event from another location and asserts nothing happens.

  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:576 - Each plugin's whole event handling now runs in one fire-and-forget void (async () => { for await (...) })() loop with no catch and no resubscribe. V1 dispatched each event separately, so one failure only affected that event. Now any rejection permanently and silently stops watcher continuity, the turn-end guard, the nudge, or busy-state for the rest of the server's life, and it surfaces as an unhandled rejection in the shared server. Rejections include a stream failure or disconnect (OpenCode documents its event stream as volatile: "a slow consumer overflows and fails the stream, and events during disconnection are missed") and a throw from awaited handler code. The loops also run handlers serially and stop pulling events while they wait, which makes a slow consumer more likely. The turn-end guard awaits ensureArmed -> waitForArmReady (up to the readiness timeout) plus the guard script and the prompt. busy-state awaits an execFile for every event. Same pattern at: .opencode/plugins/fm-primary-turnend-guard.js:74, .opencode/plugins/fm-primary-sessionstart-nudge.js:52, bin/fm-spawn.sh:4861 (generated busy-state). Minimal fix: catch per-event handler errors inside the loop, and log or restart the subscription when the iterator rejects, unless the controller was aborted.
  • ℹ️ docs/verification/supervision.md:277 - The live evidence only shows that the five plugins load as active. Event delivery, the event.data.sessionID shape, ctx.location.directory, and ctx.session.prompt({sessionID, text}) were exercised only against the hand-written host in tests/opencode-plugin-host.mjs, and the doc says the live TUI e2e is broken. The plugin header comments (e.g. fm-primary-turnend-guard.js:13-15, fm-primary-watch-arm.js:563-565) still say these runtime behaviors were "verified ... against OpenCode 2.0.28". The binary schema does match session.idle/session.created data carrying sessionID, but the claim is broader than the evidence, which is how the cross-location issue above went unnoticed.

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 warning
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 139ms ago (75 observed); agent reported: claude parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.
  • 🚨 Approval is refused: the run worktree at ~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA holds work no Test turn validated, and the steps after Test would commit and publish it. It holds uncommitted changes to tests/fm-pi-watch-extension.test.sh (inspect with git -C ~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA status and git -C ~/.no-mistakes/worktrees/d7a6e2db43ff/01M4TQVDAH624TRNEWAS7Y53CA diff). Respond with fix to validate it, or abort.

🔧 No changes applied.
1 warning still open:

  • ⚠️ tests/fm-pi-watch-extension.test.sh - tests/fm-pi-watch-extension.test.sh fails intermittently, at a different timing-sensitive case each run (e.g. 'actionable close must start one successor', 'dispatcher must hand an accepted wake to the branch', 'redundant tool call', 'external healthy watcher'). The base revision 6407052 failed all three of its three runs. HEAD, with the uncommitted iteration-budget widening, passed fully on one of two serial runs, so the flakiness predates this change. As the operator asked, it is reported here and was not investigated further.
  • Live validation: ✅ go - 3 of 7 scenarios driven live against the product
Scenario Result Live Evidence
OpenCode 2.0.28 loads all five ported primary plugins from a firstmate checkout as active ✅ pass live opencode-plugin-load-firstmate.txt / opencode-plugin-load.json from an isolated opencode service (port 49911, throwaway HOME)
Control: the base-revision V1 plugins are rejected by OpenCode 2.0.28 (shows the port is required) ✅ pass live opencode-plugin-load-base-firstmate.txt: five failed entries, 'Plugin must export a default definition with an id and an effect or setup function.'
The fm-busy-state.js plugin that fm-spawn generates for an OpenCode crewmate loads as active in OpenCode 2.0.28 ✅ pass live opencode-plugin-load-busy-state.txt
Busy-state plugin latches the worker session from session.status, and another location's busy/idle events change nothing ⏸️ untested no The prior payload did not establish a live result: this was covered only by the Node host suite tests/fm-busy-adapter-wiring.test.sh. Live event delivery needs a model turn on a logged-in OpenCode ses…
Watch-arm plugin arms on its own session.idle, ignores another location's idle, keys its coordinator by root, and the turn-end guard consults it ⏸️ untested no The prior payload did not establish a live result: this was covered only by the Node host suites tests/fm-watch-arm.test.sh and tests/fm-pi-watch-extension.test.sh. Event delivery and wake prompts nee…
Turn-end guard and sessionstart nudge act only for their own location's sessions ⏸️ untested no The prior payload did not establish a live result: this was covered only by tests/fm-turnend-guard.test.sh and tests/fm-sessionstart-nudge.test.sh in the Node host. Firing session.created live would r…
The Pi-suite intermittent failure predates this change (confirmed on the base revision) ⏸️ untested no This is a test-suite flakiness check with no live product surface, so the prior payload did not and could not establish a live result. The supporting observations are recorded in the finding and in th…
  • opencode service set port 49911 && opencode service start with HOME/XDG_* pointed at a throwaway /tmp/oc-lab.* (separate from the operator's background service on 49374), then opencode api get '/api/plugin?location[directory]=<worktree>'
  • Same plugin query against a throwaway checkout holding the base-revision (6407052) .opencode/plugins (V1 control)
  • Rendered the fm-spawn.sh opencode fm-busy-state.js heredoc into a throwaway crew worktree and queried its plugin load status
  • bash tests/fm-busy-adapter-wiring.test.sh
  • bash tests/fm-watch-arm.test.sh
  • bash tests/fm-turnend-guard.test.sh
  • bash tests/fm-sessionstart-nudge.test.sh
  • bash tests/fm-pi-watch-extension.test.sh (1x in parallel with the other suites, 2x serially at HEAD with the worktree's widened iteration budgets)
  • bash tests/fm-pi-watch-extension.test.sh 3x in a git archive 6407052 extraction of the base revision
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → no changes applied ✅
  • ⚠️ linter found issues (exit code 1)

🔧 No changes applied.
✅ Re-checked - no issues remain.

✅ **Push** - passed

✅ No issues found.

gmach added 3 commits October 13, 2026 23:38
OpenCode 2 replaced the V1 plugin API, so every plugin that returns a hooks
object from a named export fails to load with "Plugin must export a default
definition with an id and an effect or setup function". That left the OpenCode
primary with no watcher continuity, no turn-end guard, and neither pre-tool
seatbelt.

Port the five tracked primary plugins and the fm-spawn-generated busy-state
plugin to the V2 shape: a default export carrying an id and setup(ctx), events
through ctx.event.subscribe(), prompts through ctx.session.prompt, and tool
interception through ctx.tool.hook("execute.before", ...). V2 carries each
event's fields under data, so a session id is event.data.sessionID.

Drive the ported plugins from a shared Node host in the tests, and update the
behavior docs that named the V1 hooks. Also replace one fixed wall-clock wait
in the Pi watch suite with an iteration-counted poll loop, because it failed
under load on a clean checkout of the same revision.

Verified on OpenCode 2.0.28: all five primary plugins report active, where the
same query against a V1-shaped checkout reports five load failures.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: first look at #7228 — thank you @gmach.

What I inspected: full diff (21 files). Ports the five tracked OpenCode primary plugins plus the fm-spawn-generated busy-state plugin to OpenCode 2's default-export setup(ctx) API, with location filtering on the shared server event stream, a shared Node test host, and docs/verification updates. No .github / workflow changes. Review-step 🚨 about cross-location events was auto-fixed in 93f13194 (scoped by location; host suites assert foreign events are ignored). Attestation MATCH at tip 917ae132. Live: plugin load on OpenCode 2.0.28 (3/7 go); event delivery covered by the Node host, not driven live.

Contract-class: restore. OpenCode primary already had watcher continuity, turn-end guard, and pre-tool checks under the V1 plugin shape; OpenCode 2 refuses that shape, so the specified primary path was broken. This restores that path on the V2 API rather than adding a new unconfigured surface.

VISION.md per-rule: One captain, one interface — aligns (supervision stays below deck). Authority explicit — aligns (no new consent surface). Scripts/agents split — aligns (hooks call existing scripts). Restart is a non-event — aligns (watcher/turn-end continuity restored). Delegation with a spine — aligns. Outlives any vendor — aligns (contracts bind to OpenCode 2 semantics; version-noted). Scope — aligns (command-layer supervision, not workshop).

Security: no tip. Approved first-time fork CI runs 38415361178 (CI) and 38415360965 (Require no-mistakes).

Next: waiting on those approved runs. If green, this is auto-merge-eligible (restore) once main is green too. Nothing needed from you unless CI surfaces a real failure on this change.

…aused by this PR, and it is now fixed. Invariant: every test script must parse under stock /bin/bash 3.2. Bash 3.2 tracks single quotes inside a quoted heredoc that sits inside `$( ... )`. The PR added two lines with apostrophes inside these node heredocs in tests/fm-pi-watch-extension.test.sh: the comment "the successor's own startup", which is unbalanced, and the message "another location's ... location's watcher". The first one made 3.2 fail with "unexpected EOF while looking for matching `)'" at line 461. I reworded both lines so they have no apostrophes. The meaning of the comment and the error message is unchanged. I swept every sibling site by running `/bin/bash -n` on all tests/*.sh and bin/*.sh: all of them parse now. Before the fix, the HEAD version reproduces the exact CI error under the local stock bash 3.2.57. After the fix, it parses cleanly. I did not run the full Pi suite again, because the edit only touches a comment and an error-message string. ci-1 (Behavior portable parallel 1) was not caused by this PR, so I made no change for it. The only failing script is tests/fm-pi-primary-types.test.sh, which reports TS2339 "Property 'prompt' does not exist on type 'BeforeAgentStartEvent'" in fm-branch-supervision.ts and fm-primary-pi-watch.ts. This PR does not touch either file. CI runs an unpinned `npm install -g @earendil-works/pi-coding-agent`, so the Pi package's API changed upstream. The latest CI run on main (7df545b) fails with the identical TS2339 errors in the same test. Fixing that drift needs its own change: either pin the Pi package version or update the Pi extensions to the new API
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @gmach.

Since my 18:38Z stamp, no-mistakes added 8fd83115. It is a test-only change that rewords two lines in tests/fm-pi-watch-extension.test.sh so they parse under stock macOS Bash 3.2 (the ci-2 failure this PR introduced). I reviewed it, the attestation matches the new head, and I approved the fork CI runs (CI 38455963790, Require no-mistakes 38455963858).

The Behavior portable parallel 1 failure (tests/fm-pi-primary-types.test.sh, TS2339 on BeforeAgentStartEvent.prompt) is the same Pi 1.2 type drift that has main red right now. It isn't from this PR, and there's nothing for you to fix there.

Contract-class: restore (unchanged). VISION verdict unchanged: all rules align.

Where it stands: waiting on CI and on main going green, not on you. Once both are green, this is on track to merge without anything more from you. Heads-up: #7231 edits the adjacent lines of docs/turnend-guard.md and the test list in tests/fm-turnend-guard.test.sh, so whichever of the two lands second may need a small rebase.

@gmach

gmach commented Nov 2, 2026

Copy link
Copy Markdown
Author

Closing as superseded: the OpenCode 2 plugin port landed on main in #7336 (e930d96), which covers the same plugins.

@gmach gmach closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants