fix(omp): keep supervision outcome delivery responsive - #107
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Port upstream firstmate PR kunchenguid#3767 (fix(pi): keep supervision outcome delivery responsive) into this fork (dnth/firstmate).
The persistent supervision branch delivers wake outcomes to the main session: routine verdicts merge back with no turn and captain verdicts open one follow-up turn. Keep that outcome DELIVERY responsive so main receives supervision outcomes promptly and supervision does not silently fall behind.
This is a bounded PORT-ADAPT, not a clean cherry-pick. The upstream Pi diff was inspected at f09de8a. This fork runs an OMP-adapted supervision branch in bin/fm-supervise-daemon.sh plus .omp/extensions, landed as fork PR #63, not the Pi extension. Adapt the shared bash-layer implications directly where applicable, re-express Pi-extension behavior against the OMP branch, and reconcile with the fork's multibrain delivery path and watcher-continuity fix PR #99 in bin/fm-primary-watch-core.ts. If a Pi piece has no OMP equivalent, record the deliberate omission rather than force-fitting it.
Acceptance criteria:
Current implementation decisions: use an awaited OMP async subprocess executor and awaitable OMP grant helpers; serialize OMP ownership checks, outcome append/handoff, and visible report delivery in a delivery queue; retain synchronous ownership checks only for OMP's synchronous offer handshake and shell spawn hook; include the helper in the OMP branch marker hash; leave bin/fm-supervise-daemon.sh process-isolated and preserve bin/fm-primary-watch-core.ts watcher continuity; omit Pi-only processed-outcome reconciliation and Pi renderer/live-TUI guards because OMP has no equivalent path.
Do not merge the PR. Do not push the default branch. Keep the change on the feature branch and deliver a PR against main.
Firstmate-Validation-Generation: e9df3a5a6b498b4627d9afdb25c224dc
What Changed
Risk Assessment
✅ Low: The port is internally consistent: delivery-side subprocesses are awaited and serialized, synchronous checks remain only at required handshake hooks, marker hashing includes the new helper, and the added regression exercises event-loop responsiveness and ordering without source-content-only assertions.
Testing
Ran the focused supervision regression (including the event-loop responsiveness/order scenario), wake routing and primary/session tests, and strict no-emit OMP typecheck successfully; no UI surface exists for screenshot evidence. The real-SDK live guard was also attempted but failed because the broken-branch degrade path did not deliver the expected watcher-wake steer to main.
Evidence: Async delivery regression evidence
Evidence: Live OMP guard failure
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
tests/fm-omp-branch-live-e2e.test.sh- The real-SDK live guard failed in its degrade-to-main scenario: after an intentionally invalid branch model, no watcher-wake steer reached main within the 120-second wait. Portable regression and targeted routing tests pass, but end-to-end fallback behavior remains unproven and may indicate an OMP SDK/environment incompatibility or a product regression.bash tests/fm-omp-branch-supervision.test.shbash tests/fm-omp-primary.test.shbash tests/fm-send-turn-start.test.shbash tests/fm-session-start.test.shbash tests/fm-wake-queue.test.shbash tests/fm-omp-branch-types.test.shFM_OMP_BRANCH_LIVE_E2E=1 bash tests/fm-omp-branch-live-e2e.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.