Skip to content

fix: prevent OpenCode watch-arm churn during wake bursts - #7316

Open
amanmishra2 wants to merge 9 commits into
kunchenguid:mainfrom
amanmishra2:fm/opencode-watcharm-churn
Open

amanmishra2 wants to merge 9 commits into
kunchenguid:mainfrom
amanmishra2:fm/opencode-watcharm-churn

Conversation

@amanmishra2

@amanmishra2 amanmishra2 commented Oct 14, 2026 •

Copy link
Copy Markdown

Intent

Fix the supervision churn: under wake bursts, the OpenCode watch-arm spawns colliding successor arms that restart healthy cycles, so supervision oscillates, downtime episodes repeat, and the plugin exhausts its five retries. The goal: exactly one live supervision cycle under burst load - successors are deduplicated per delivery, a healthy cycle is never stopped by a redundant successor, and predecessors are retired deterministically instead of lingering as attached arms.

What Changed

  • Share one arm coordinator per home across OpenCode plugin loads, deduplicate wake-burst successors, and route wakes to the current session-lock owner.
  • Start attach-or-start arm and host successors to preserve healthy watcher cycles and retire predecessors; document the continuity contract and add burst, concurrent-arm, owner-routing, and host-takeover regression cases.

Risk Assessment

⚠️ Medium: The shared per-home state and plain-arm path address the observed cycle churn, but wake delivery can remain tied to the first session when multiple session loads share a home.

Testing

The existing live TUI transcript shows one wake for a status burst, a stable watcher across extra idle turns, and successor-cycle handoff. Four focused fixtures passed for burst deduplication, healthy-cycle attachment, owner routing, and host takeover. A new live host attempt reached the isolated OpenCode server but was stopped by the gate guard before plugin delivery; I did not bypass it. No screenshot was captured because this changes supervision lifecycle behavior rather than visual layout. A fm-lock.sh --help setup probe acquired a worktree-local lock; I removed that test-created file and confirmed the worktree was clean.

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
OpenCode handles a status-wake burst with one visible wake and one successor cycle. ✅ pass live OpenCode live TUI and watcher-state transcript
Repeated idle turns leave an existing healthy watcher running. ✅ pass live OpenCode live TUI and watcher-state transcript: watcher PID remained stable across extra idle turns.
After an actionable wake, the predecessor cycle retires and one successor remains live. ✅ pass live OpenCode live TUI and watcher-state transcript; focused fixture test_opencode_overlapping_deliveries_keep_one_live_cycle also passed.
A deduplicated wake is routed to the current session-lock owner at delivery time. ⏸️ untested no I started a real OpenCode server in a private fm-lab tmux session with an isolated home and local provider. The plugin-spawned arm was refused by bin/fm-watch-arm.sh because the plugin sets `FM_RO…
An opted-in OpenCode host adopts a healthy detached cycle without a redundant restart. ⏸️ untested no I attempted the real OpenCode host path in the isolated lab described above, but the watcher-arm refusal prevented the plugin from reaching host adoption. The fixture fallback exercised the real host…
Evidence: OpenCode live TUI and watcher-state transcript

Source: OpenCode live TUI and watcher-state transcript

OpenCode watch-arm live validation
Date: 2026-10-14
Runtime: OpenCode 1.18.29, private tmux socket fm-lab, disposable local model endpoint

=== ordinary arm: captured TUI excerpt ===
Burst alpha: reply exactly LAB-OK.
LAB-OK
Burst beta: reply exactly LAB-OK.
LAB-OK
FIRSTMATE_OP: v1 watcher: WATCHER FIRED - drain queued wakes with bin/fm-wake-drain.sh and handle the reported wake. Watcher continuity is plugin-owned.
signal: [lab]/state/live-alpha.status [lab]/state/live-beta.status [lab]/state/live-gamma.status
LAB-OK

=== ordinary arm: observed cycle state ===
Before the status burst, state/.watch.lock/pid was 97585 and remained 97585 across the two extra OpenCode turns.
Three status files produced one TUI wake prompt and six durable queue records (two signal batches for each file).
The observed exit ledger recorded watcher 97585 ending with reason=actionable-signal and successor=started:21377; the current state/.watch.lock/pid was 21377.

=== opted-in host: captured live TUI pane ===

  ┃
  ┃  Start the opted-in supervision host fixture. Reply exactly LAB-OK.
  ┃

     LAB-OK

     ▣  Build · Deterministic lab model · 841ms

  ┃
  ┃  ⁣ FIRSTMATE_OP: v1 watcher: WATCHER FIRED - drain queued wakes with bin/fm-wake-drain.sh and handle the reported
  ┃  wake. Watcher continuity is plugin-owned.
  ┃
  ┃  signal: [lab]/state/host-alpha.status /var/folders/rz/
  ┃  r_7y_j8903x7clhnpvydlpd00000gn/T//fm-lab.h1rUsN/state/host-beta.status /var/folders/rz/
  ┃  r_7y_j8903x7clhnpvydlpd00000gn/T//fm-lab.h1rUsN/state/host-gamma.status
  ┃

     LAB-OK

     ▣  Build · Deterministic lab model · 65ms











  ┃
  ┃
  ┃
  ┃  Build · Deterministic lab model Disposable local model
  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-      tab agentsctrl+p
   opencode-primary                                                                                     commands


=== opted-in host log ===
1792012391	start	gen=host-54112-1792012391	primary=opencode
1792012407	pass-through	attended	no supervision engine	signal: [lab]/state/host-alpha.status [lab]/state/host-beta.status [lab]/state/host-gamma.status
1792012407	start	gen=host-62257-1792012407	primary=opencode

=== host and watcher records ===
host	62257	Wed Oct 14 14:13:27 2026     bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-supervision-host.sh park
arm	62395	Wed Oct 14 14:13:27 2026     bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-watch-arm.sh
62441

arm_pid=54238	watcher_pid=54287	origin=started	started_at=1792012391	ended_at=1792012406	exit_code=0	signal=none	reason=actionable-signal	beacon_age=3	lock_before=pid:54287|identity:Wed Oct 14 14:13:11 2026     bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-watch.sh	lock_after=pid:none|identity:none	successor=none

=== current runtime processes ===
62257 53018 S+   bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-supervision-host.sh park
62395 62257 S+   bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-watch-arm.sh
62441 62395 S+   bash ~/.no-mistakes/worktrees/90251462ea6c/01M4Y0FCZWNTSRTT22TCYW16RZ/.tmp-live-opencode-primary/bin/fm-watch.sh

=== retired first host cycle processes (no rows means retired) ===

=== host engine capability ===
claude executable is not on PATH
Evidence: Focused OpenCode fixture fallback results

Source: Focused OpenCode fixture fallback results

ok - OpenCode overlapping deliveries keep one live cycle and retire predecessors ok - OpenCode successors attach to a healthy cycle without stopping it ok - OpenCode wake delivery follows the current owner and logs unresolved fallback ok - OpenCode host takes over a healthy detached cycle without a downtime resurface

ok - OpenCode overlapping deliveries keep one live cycle and retire predecessors
ok - OpenCode successors attach to a healthy cycle without stopping it
ok - OpenCode wake delivery follows the current owner and logs unresolved fallback
ok - OpenCode host takes over a healthy detached cycle without a downtime resurface
- Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (55m10s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 6 issues (3 errors, 3 warnings)
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:570 - If session A idles first and starts the shared home arm, a later session B load returns that existing child without updating its delivery target. The close handler retains A’s sessionID and client (.opencode/plugins/fm-primary-watch-arm.js:519-524) and sends the wake to A (.opencode/plugins/fm-primary-watch-arm.js:349-353), so B may not receive it. The code and intent do not specify whether the first or latest session should receive a deduplicated home wake; clarify that routing choice before relying on cross-session deduplication.

🔧 Fix applied.
2 issues (1 error, 1 warning) still open:

  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:570 - If session A idles first and starts the shared home arm, a later session B load returns that existing child without updating its delivery target. The close handler retains A’s sessionID and client (.opencode/plugins/fm-primary-watch-arm.js:519-524) and sends the wake to A (.opencode/plugins/fm-primary-watch-arm.js:349-353), so B may not receive it. The code and intent do not specify whether the first or latest session should receive a deduplicated home wake; clarify that routing choice before relying on cross-session deduplication.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:488 - Required criterion: “a healthy cycle is never stopped by a redundant successor.” The changed launch hunk still selects fm-supervision-host.sh park --restart in host mode at line 488. On a main-only/pass-through wake, the host first detaches a healthy successor for main (bin/fm-supervision-host.sh:710-715), then this launch restarts that cycle (bin/fm-supervision-host.sh:1061-1069). The ordinary-arm change addressed churn, but left this host-mode path; the owner-routing fix round did not change it. The changed docs also describe an unconditional plain, non-restarting arm (docs/supervision-protocols/opencode.md:7, docs/watcher-continuity.md:143). Launch park without --restart here so the next host can take over the recorded cycle, and document the host-mode behavior.

🔧 Fix applied.
4 issues (2 errors, 2 warnings) still open:

  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:570 - If session A idles first and starts the shared home arm, a later session B load returns that existing child without updating its delivery target. The close handler retains A’s sessionID and client (.opencode/plugins/fm-primary-watch-arm.js:519-524) and sends the wake to A (.opencode/plugins/fm-primary-watch-arm.js:349-353), so B may not receive it. The code and intent do not specify whether the first or latest session should receive a deduplicated home wake; clarify that routing choice before relying on cross-session deduplication.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:488 - Required criterion: “a healthy cycle is never stopped by a redundant successor.” The changed launch hunk still selects fm-supervision-host.sh park --restart in host mode at line 488. On a main-only/pass-through wake, the host first detaches a healthy successor for main (bin/fm-supervision-host.sh:710-715), then this launch restarts that cycle (bin/fm-supervision-host.sh:1061-1069). The ordinary-arm change addressed churn, but left this host-mode path; the owner-routing fix round did not change it. The changed docs also describe an unconditional plain, non-restarting arm (docs/supervision-protocols/opencode.md:7, docs/watcher-continuity.md:143). Launch park without --restart here so the next host can take over the recorded cycle, and document the host-mode behavior.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:322 - Round 1 (537df8a) snapshots state.deliveryTarget at line 322, then validates it before sendPrompt awaits the encoder subprocess (:304-305). If session A starts delivery and session B registers as the current owner while encoding runs, line 328 still prompts A with the captured target, so B can miss the wake. This violates the accepted rule to route to the current lock owner and update the target on ownership changes. Select and recheck the latest target immediately before promptAsync, retaining the logged fallback if ownership is unresolved; keep the lock stable across its asynchronous ancestry check too. The same routing path serves confirmation-failure wakes (:374), confirmed wakes (:378), and surfaced failures (:386).
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:482 - Round 2 changed the host launch to plain park, but .opencode/plugins/fm-primary-watch-arm.js:9 still describes park --restart, and docs/supervision-host.md:114 still says OpenCode and omp use --restart. These stale claims contradict the new command and misdescribe OpenCode's host handoff; update both references while preserving the omp behavior.

🔧 No changes applied.
5 issues (2 errors, 3 warnings) still open:

  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:570 - If session A idles first and starts the shared home arm, a later session B load returns that existing child without updating its delivery target. The close handler retains A’s sessionID and client (.opencode/plugins/fm-primary-watch-arm.js:519-524) and sends the wake to A (.opencode/plugins/fm-primary-watch-arm.js:349-353), so B may not receive it. The code and intent do not specify whether the first or latest session should receive a deduplicated home wake; clarify that routing choice before relying on cross-session deduplication.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:488 - Required criterion: “a healthy cycle is never stopped by a redundant successor.” The changed launch hunk still selects fm-supervision-host.sh park --restart in host mode at line 488. On a main-only/pass-through wake, the host first detaches a healthy successor for main (bin/fm-supervision-host.sh:710-715), then this launch restarts that cycle (bin/fm-supervision-host.sh:1061-1069). The ordinary-arm change addressed churn, but left this host-mode path; the owner-routing fix round did not change it. The changed docs also describe an unconditional plain, non-restarting arm (docs/supervision-protocols/opencode.md:7, docs/watcher-continuity.md:143). Launch park without --restart here so the next host can take over the recorded cycle, and document the host-mode behavior.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:322 - Round 1 (537df8a) snapshots state.deliveryTarget at line 322, then validates it before sendPrompt awaits the encoder subprocess (:304-305). If session A starts delivery and session B registers as the current owner while encoding runs, line 328 still prompts A with the captured target, so B can miss the wake. This violates the accepted rule to route to the current lock owner and update the target on ownership changes. Select and recheck the latest target immediately before promptAsync, retaining the logged fallback if ownership is unresolved; keep the lock stable across its asynchronous ancestry check too. The same routing path serves confirmation-failure wakes (:374), confirmed wakes (:378), and surfaced failures (:386).
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:482 - Round 2 changed the host launch to plain park, but .opencode/plugins/fm-primary-watch-arm.js:9 still describes park --restart, and docs/supervision-host.md:114 still says OpenCode and omp use --restart. These stale claims contradict the new command and misdescribe OpenCode's host handoff; update both references while preserving the omp behavior.
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:620 - Round 2’s owner-routing fix introduced duplicate admission checks: registerDeliveryTarget runs isPrimaryRoot and sessionOwnsLock, then ensureArm immediately repeats both in beginArm, even when a child is already live. Each check spawns subprocesses; during an idle burst these run concurrently before launch single-flight can deduplicate them. Both changed entrypoints reach this path (:628 coordinator callback and :635 idle handler). Avoid repeating the checks while preserving owner validation.

🔧 Fix applied.
6 issues (3 errors, 3 warnings) still open:

  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:570 - If session A idles first and starts the shared home arm, a later session B load returns that existing child without updating its delivery target. The close handler retains A’s sessionID and client (.opencode/plugins/fm-primary-watch-arm.js:519-524) and sends the wake to A (.opencode/plugins/fm-primary-watch-arm.js:349-353), so B may not receive it. The code and intent do not specify whether the first or latest session should receive a deduplicated home wake; clarify that routing choice before relying on cross-session deduplication.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:488 - Required criterion: “a healthy cycle is never stopped by a redundant successor.” The changed launch hunk still selects fm-supervision-host.sh park --restart in host mode at line 488. On a main-only/pass-through wake, the host first detaches a healthy successor for main (bin/fm-supervision-host.sh:710-715), then this launch restarts that cycle (bin/fm-supervision-host.sh:1061-1069). The ordinary-arm change addressed churn, but left this host-mode path; the owner-routing fix round did not change it. The changed docs also describe an unconditional plain, non-restarting arm (docs/supervision-protocols/opencode.md:7, docs/watcher-continuity.md:143). Launch park without --restart here so the next host can take over the recorded cycle, and document the host-mode behavior.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:322 - Round 1 (537df8a) snapshots state.deliveryTarget at line 322, then validates it before sendPrompt awaits the encoder subprocess (:304-305). If session A starts delivery and session B registers as the current owner while encoding runs, line 328 still prompts A with the captured target, so B can miss the wake. This violates the accepted rule to route to the current lock owner and update the target on ownership changes. Select and recheck the latest target immediately before promptAsync, retaining the logged fallback if ownership is unresolved; keep the lock stable across its asynchronous ancestry check too. The same routing path serves confirmation-failure wakes (:374), confirmed wakes (:378), and surfaced failures (:386).
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:482 - Round 2 changed the host launch to plain park, but .opencode/plugins/fm-primary-watch-arm.js:9 still describes park --restart, and docs/supervision-host.md:114 still says OpenCode and omp use --restart. These stale claims contradict the new command and misdescribe OpenCode's host handoff; update both references while preserving the omp behavior.
  • ⚠️ .opencode/plugins/fm-primary-watch-arm.js:620 - Round 2’s owner-routing fix introduced duplicate admission checks: registerDeliveryTarget runs isPrimaryRoot and sessionOwnsLock, then ensureArm immediately repeats both in beginArm, even when a child is already live. Each check spawns subprocesses; during an idle burst these run concurrently before launch single-flight can deduplicate them. Both changed entrypoints reach this path (:628 coordinator callback and :635 idle handler). Avoid repeating the checks while preserving owner validation.
  • 🚨 .opencode/plugins/fm-primary-watch-arm.js:316 - Round 3 added an unresolved-owner fallback that conflicts with Round 4’s instruction to “use the OWNING sessions id/client rather than the retained arming sessions.” If A arms the home and the lock switches to B before B registers its client, A’s close fails restoration as read-only, then this branch sends the wake and failure to A; B receives no prompt. The shared helper also serves confirmation failures and surfaced failures (:366, :378; normal delivery at :370). The added test codifies fallback to A at tests/fm-pi-watch-extension.test.sh:5122-5128, and changed docs describe it at docs/watcher-continuity.md:146 and docs/supervision-protocols/opencode.md:8. Remove the arming-session fallback to meet the owner-routing instruction; if unresolved-owner failures must still be delivered, that behavior needs an explicit decision.
🔧 **Test** - 1 issue found → auto-fixed ✅
  • ⚠️ live validation verdict: inconclusive (3 of 4 scenarios were driven live against the product); untested: Opted-in host adopts a healthy detached cycle without stopping it
  • Live validation: ⚠️ inconclusive - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
OpenCode turn-end bursts reuse one live watcher ✅ pass live OpenCode live TUI and watcher lifecycle
Three actionable status changes produce one delivered wake, retire the predecessor, and start a successor ✅ pass live OpenCode live TUI and watcher lifecycle
Opted-in host forwards a burst and leaves one watcher live ✅ pass live OpenCode live TUI and watcher lifecycle
Opted-in host adopts a healthy detached cycle without stopping it ⏸️ untested no I drove an isolated OpenCode 1.18.29 primary with a disposable local model and an opted-in host. The host logged pass-through attended no supervision engine; its cycle ended with successor=none, s…
  • bash tests/fm-pi-watch-extension.test.sh
  • bash tests/fm-watch-arm.test.sh
  • Ran OpenCode 1.18.29 in a private fm-lab tmux session against a disposable local model endpoint; submitted multiple turns and captured the live TUI pane.
  • Changed three disposable .status files during a live watcher cycle; inspected the wake prompt, durable queue, .watch.lock/pid, and .watch-cycle-exits.log.
  • Repeated the burst with config/supervision-host enabled; inspected .supervision-host.log, the host record, current watcher PID, and retired process IDs.
  • Checked command -v claude; saved the TUI and lifecycle transcript to the evidence directory, then removed the disposable labs and nested project fixture.

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

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
OpenCode handles a status-wake burst with one visible wake and one successor cycle. ✅ pass live OpenCode live TUI and watcher-state transcript
Repeated idle turns leave an existing healthy watcher running. ✅ pass live OpenCode live TUI and watcher-state transcript: watcher PID remained stable across extra idle turns.
After an actionable wake, the predecessor cycle retires and one successor remains live. ✅ pass live OpenCode live TUI and watcher-state transcript; focused fixture test_opencode_overlapping_deliveries_keep_one_live_cycle also passed.
A deduplicated wake is routed to the current session-lock owner at delivery time. ⏸️ untested no I started a real OpenCode server in a private fm-lab tmux session with an isolated home and local provider. The plugin-spawned arm was refused by bin/fm-watch-arm.sh because the plugin sets `FM_RO…
An opted-in OpenCode host adopts a healthy detached cycle without a redundant restart. ⏸️ untested no I attempted the real OpenCode host path in the isolated lab described above, but the watcher-arm refusal prevented the plugin from reaching host adoption. The fixture fallback exercised the real host…
  • opencode --help, opencode serve --help, and opencode run --help
  • Started OpenCode in a private fm-lab tmux session with a temporary home and localhost provider; the real watcher arm refused before a prompt was sent.
  • bash tests/.fm-opencode-focus.test.sh running the four focused OpenCode fixture scenarios
  • Reviewed the existing live artifact opencode-watch-arm-live.txt
  • Removed the probe-created worktree state/.lock and temporary fixture files; final git status --short was clean
🔧 **Document** - 1 issue found → auto-fixed ✅
  • ⚠️ docs/supervision-host.md:114 - This still says OpenCode launches the host with --restart, while the target plugin uses plain park. I left it unchanged because the latest recorded decision declined this specific documentation fix.

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

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)

🔧 Fix applied.
1 warning still open:

  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

Wake bursts deliver overlapping wakes within seconds, and the OpenCode host
can hold more than one load of the watch-arm plugin in one process. Each
load kept its own module-level arm state, and every spawn launched
`bin/fm-watch-arm.sh --restart`, so overlapping deliveries started colliding
successor arms: the second `--restart` signalled the healthy cycle the first
had just started, which then read as a signal-exit failure and drove the
bounded retry loop until it exhausted. The live 2026-10-14 12:19-12:32 PDT
burst shows plugin-spawned arms arriving in pairs and cycles TERMed 2-20s
after start in state/.watch-cycle-exits.log, alongside the plugin's
"unready successor arm did not exit" and "could not restore watcher
continuity after 5 retries" failures.

Burst reproduction (replayed arm spawns): a scratch fixture drives two
independent plugin loads with overlapping session.idle deliveries and
scripted wake closes. Before the fix that replay showed 13 arm starts, 13
--restart invocations, and 10 healthy-cycle stops with 13 distinct cycle
pids. After the fix the same replay shows one successor per delivery, zero
restarts, zero stops, and no predecessor arm alive behind its successor.

Fixed behavior:
- One arming state per home, anchored on globalThis, is shared by every load
  of the plugin in the host process, so overlapping deliveries deduplicate to
  exactly one successor arm instead of one per load.
- Successors launch as plain arms: they attach to a verified healthy cycle
  and start their own only when none is live, so a redundant successor never
  stops a live cycle. --restart remains the explicit replacement mode for
  recovery paths.
- Predecessor arms exit before their successor is established, because the
  successor is spawned from the predecessor's close handler, and the shared
  single-child state leaves no attached arm following the chain.

The supervision-host path keeps its documented `park --restart` first-cycle
behavior; docs/supervision-host.md records changing that path as a separate
follow-up.

Regression coverage: tests/fm-pi-watch-extension.test.sh gains the
overlapping-burst and attach-without-stopping tests driven through two plugin
loads, and tests/fm-watch-arm.test.sh gains a real-watcher concurrent-attach
test proving the live cycle keeps its lock while both attached arms resolve
its wake.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @amanmishra2 — first look at tip 96122561223c against main 24f3a6b8.

Review: OpenCode watch-arm shares one per-home coordinator across plugin loads, dedupes burst successors, routes wakes to the current session-lock owner, and switches OpenCode successor launch from --restart to attach-or-start (plain fm-watch-arm.sh / host park). Docs and focused fixtures cover burst, attach, owner-routing, and host takeover. Diff has no workflow, secret, or network surface — I approved first-time fork CI + Require no-mistakes after that review (runs 38644582255, 38644582192 now queued).

Contract-class: new-default (my judgment). Dedup alone would be closer to restoring one-live-cycle continuity, but replacing the specified OpenCode --restart successor path with attach-or-start is a default-path replacement, so this will not auto-merge even when green.

VISION.md: one-interface / authority / scripts / restart / spine / vendor / scope all align for the churn fix; captain merge-or-leave applies because of the default successor-path change.

Blocker this pass: live validation is 3 of 5 — owner-routing and opted-in host takeover are still untested live (arm refused by the lab gate). When you can, please live-test those two against a real OpenCode primary (or re-raise through no-mistakes with the evidence) so we can take a full look. No need to rush; whenever it fits your schedule is fine. Once live is complete and CI is green, this goes to Kun as merge-or-leave (new-default), not auto-merge. Nothing else needed from you for CI — we will watch the approved runs.

… which caused a spurious initial wake before the intended decision signal. `bash tests/fm-pi-watch-extension.test.sh` and `git diff --check` passed
@amanmishra2

Copy link
Copy Markdown
Author

Thanks for the review. The CI fix for the coverage guard is up as a new tip (b060d5f); its workflow runs are waiting on first-time fork approval again whenever you have a moment. Working on the owner-routing and opted-in host takeover live evidence; will follow up here.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @amanmishra2, and thanks for picking up the two remaining live scenarios.

I checked the delta from 96122561 to b060d5f6. It's one line in tests/fm-pi-watch-extension.test.sh (it drops the pre-created empty demo.status in the host-takeover fixture), with no product, workflow or secret changes. I approved this tip's fork runs (CI 38654038140, Require no-mistakes 38654038119). The attestation matches b060d5f6.

Nothing has changed since my last note. The class is still new-default, because the OpenCode successor path moves from --restart to attach-or-start, and VISION still aligns on every rule. This is waiting on you only for the owner-routing and opted-in host-takeover live evidence you mentioned. Whenever that's posted (here, or via a no-mistakes re-raise) and CI is green, it goes to Kun as a merge-or-leave decision.

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