Repository navigation
fix: report semantic busy and idle state for OMP workers - #302
Merged
Merged
Conversation
The omp adapter had no busy-state source, so fm-crew-state.sh reported unknown for healthy omp workers. The generated per-task extension now writes busy on agent_start and idle on agent_end when willContinue is not set, with source omp-ext; fm-spawn arms the contract for omp and fm-busy-lib.sh trusts that source only for the omp harness. turn_start/turn_end stay wake notifications: one omp agent run contains several inner turn pairs (verified on 18.18.6), so a turn boundary is not a work boundary. tests/fm-busy-adapter-wiring.test.sh drives the real generated extension in a plain Node host. tests/fm-omp-busy-live-e2e.test.sh is the opt-in live guard that ran against omp 18.18.6 and observed busy then idle across a real turn.
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.
Summary
bin/fm-crew-state.shhad no semantic source for OMP, so every healthy OMP worker readunknown. The generated OMP worker extension now reports the agent-run lifecycle, and the classifier trusts that source only forharness=omp:turn_start/turn_endstay wake notifications: one OMP agent run contains several inner turn pairs, so a turn boundary is never a work boundary. That is why idle is gated onagent_endplus!willContinue.Files changed:
.omp/extensions/and extension-template files changed: none. The behaviour is ported from upstream commits2e65d2e2and4735ddc6(kunchenguid#3867) onto this repo's generator shape.Evidence
fm_busy_sources_for_harness ompprinted nothing, sobin/fm-crew-state.shemittedunknown · pane · harness state unavailable (unknown missing)for a live OMP turn.After: the same classifier emits
busy omp-extduring a turn andidle omp-extafter it. The portable regression (bash tests/fm-busy-adapter-wiring.test.sh) printsok - omp extension: agent_start busy, willContinue stays busy, plain agent_end idle, turn boundaries stay notifications, and the live guard on OMP 18.18.6 printsok - omp/18.18.6: real omp reports 'busy omp-ext' during a turn and 'idle omp-ext' after it (never unknown).skip: omp not found on PATH; the live OMP busy-state guard checked nothingwhen OMP is absent.unknownuntil relaunched. There is no migration;docs/verification/runtime-backends.md#omp-semantic-busy-staterecords that requirement.macOS runner substitute for the cancelled check
GitHub cancelled
Stock macOS Bash snapshot compatibilitytwice while it sat queued (job131315249121, then rerun job131330483668); zero steps ran in either attempt and no log exists. The job's own command block from.github/workflows/ci.ymlwas run instead under a locally built GNU bash 3.2.57(2), substituting only the interpreter path:bash -nparse sweep over everybin/fm-lint.sh --list-filesroot: 444 files, zero failures.tests/fm-fleet-snapshot-view.test.sh: 17ok -lines (the job requires 17).tests/fm-bearings-snapshot.test.sh: 47ok -lines (the job requires 47).The changed shell lines carry no bash 4+ or GNU-only surface:
bin/fm-busy-lib.sh:184(omp) adapter=omp-ext ;;),bin/fm-spawn.sh:4750(case alternation),bin/fm-test-run.sh:197(case alternation), and the two test scripts use onlycase/if/for/[ ]/${x#p}/${x%p}/${x:-}/heredocs/printf/touch/wait/trap/kill. Group kill was checked separately under bash 3.2.57 (set -m,kill -KILL -- -$pid: pgid matched the job pid and the process was reaped). An added-line scan found nogrep -P,sed -i,readlink -f,date -d,stat -c,mktemp --,find -printf,xargs -r/-d, arrays,[[ ]],&>, orlocal -a. Remaining gap: the substitute ran on GNU coreutils rather than BSD userland, and the changed lines do not exercise userland flags.Merge Danger
Door: two-way. Reverting restores the previous
unknownclassification; no data is rewritten or migrated.Blast Radius: OMP workers only. New OMP tasks gain
state/<id>.busy-genandstate/<id>.busy-state, which the existing teardown busy retirement removes. Other harnesses keep their own sources becauseomp-extis trusted only forharness=omp.Testing
OMP 18.18.6 passed isolated CLI and SDK lifecycle scenarios against synthetic localhost providers. Focused adapter and state regressions passed; missing-tool skipping and timeout cleanup were verified. Setup probes were corrected, evidence retained, and all started processes stopped.
Evidence: Real OMP guard and persisted state transitions
Evidence: Real SDK ownership and continuation events
Evidence: Timeout and process cleanup verification
Evidence: Stalled-provider guard transcript
Evidence: Validation scope and setup notes
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-spawn.sh:4929- Native OMP subagents bind this extension again in the parent's process, as documented by .omp/extensions/lib/fm-task-inbox-doorbell.ts:96 and tests/fm-omp-task-inbox-doorbell.test.sh:596. Sequence: parent starts, launches a child, then the child emits its final agent_end while the parent continues working. The child writes idle to the parent's record using the same ID and generation, falsely classifying the worker as idle. Both bin/fm-spawn.sh:4928 (busy) and :4929–4931 (idle), through :4906–4911, need parent-session ownership gating in the generated extension. Extend the portable regression at tests/fm-busy-adapter-wiring.test.sh:561 to exercise parent and child instances.tests/fm-omp-busy-live-e2e.test.sh:161- After the first busy observation, polling stops and this wait has no deadline. A stalled provider stream therefore hangs the live guard indefinitely despite its bounded polling loops. Also, the failure at tests/fm-omp-busy-live-e2e.test.sh:152 exits without terminating the running OMP process; the inherited cleanup only removes fixtures. Bound the actual OMP invocation at :142 and terminate/reap its owned processes on failure or interruption.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-busy-adapter-wiring.test.shwith isolated HOME and TMPDIRbash tests/fm-busy-state.test.shwith isolated HOME and TMPDIRFM_OMP_BUSY_LIVE_E2E=1 bash tests/fm-omp-busy-live-e2e.test.shthrough a disposable localhost-provider driverReal OMP SDK parent/child sessions and session_stop continuation using the generated extensionReal OMP live guard against a deliberately stalled localhost provider; verified deadline and process terminationLive guard with OMP excluded from PATH; confirmed explicit missing-OMP skipVerified temporary workspace removal and clean git status✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.