feat(omp): add verified Firstmate harness adapter - #1
Merged
Conversation
Add omp as a sixth verified harness adapter alongside claude, codex,
opencode, pi, and grok. omp is Pi-derived but distinct: it sets OMPCODE=1
(and CLAUDECODE=1, so detection must check OMPCODE first), runs as
process `omp`, needs --auto-approve for autonomy, uses --thinking for
effort, and exposes an active session_stop hook that forces a
continuation by returning {continue:true} - making omp a direct-blocking
turn-end harness (class with claude/codex).
- detection: fm-harness.sh prefers OMPCODE over CLAUDECODE, plus ancestry
- lock: fm-lock.sh HARNESS_RE recognizes ^omp$
- spawn: launch template (--auto-approve, -e turn-end signal ext),
--model/--thinking flags (omit max), crewmate turn_end extension
- busy detection: the busy-only "esc" hint token in fm-watch.sh and
fm-tmux-lib.sh (omp's Working... uses a unicode ellipsis)
- liveness: backends/tmux.sh classifies an omp pane as alive
- bootstrap: crew-dispatch verified()/effort_ok, secondmate-liveness set
- session-start: load-health check for the auto-discovered guard
- teardown: state/<id>.omp-ext.ts cleanup at both sites
- primary guard: tracked auto-discovered
.omp/extensions/fm-primary-turnend-guard.ts (session_stop)
- supervision: docs/supervision-protocols/omp.md + repair_line arm
- knowledge: harness-adapters skill omp section + expanded new-adapter
wiring checklist so future adapters are fully wired
- tests: new fm-omp-harness.test.sh + fm-lock.test.sh and coverage in
bootstrap, teardown, turnend-guard, supervision, liveness; tests/lib.sh
now clears ambient harness markers so detection is hermetic
Verified live on omp 16.3.12.
# Conflicts: # .agents/skills/harness-adapters/SKILL.md # README.md # bin/fm-spawn.sh # docs/turnend-guard.md
# Conflicts: # .agents/skills/harness-adapters/SKILL.md # AGENTS.md # README.md # docs/turnend-guard.md # tests/fm-teardown.test.sh # tests/lib.sh
Add omp as a sixth verified harness adapter alongside claude, codex,
opencode, pi, and grok. omp is Pi-derived but distinct: it sets OMPCODE=1
(and CLAUDECODE=1, so detection must check OMPCODE first), runs as
process `omp`, needs --auto-approve for autonomy, uses --thinking for
effort, and exposes an active session_stop hook that forces a
continuation by returning {continue:true} - making omp a direct-blocking
turn-end harness (class with claude/codex).
- detection: fm-harness.sh prefers OMPCODE over CLAUDECODE, plus ancestry
- lock: fm-lock.sh HARNESS_RE recognizes ^omp$
- spawn: launch template (--auto-approve, -e turn-end signal ext),
--model/--thinking flags (omit max), crewmate turn_end extension
- busy detection: the busy-only "esc" hint token in fm-watch.sh and
fm-tmux-lib.sh (omp's Working... uses a unicode ellipsis)
- liveness: backends/tmux.sh classifies an omp pane as alive
- bootstrap: crew-dispatch verified()/effort_ok, secondmate-liveness set
- session-start: load-health check for the auto-discovered guard
- teardown: state/<id>.omp-ext.ts cleanup at both sites
- primary guard: tracked auto-discovered
.omp/extensions/fm-primary-turnend-guard.ts (session_stop)
- supervision: docs/supervision-protocols/omp.md + repair_line arm
- knowledge: harness-adapters skill omp section + expanded new-adapter
wiring checklist so future adapters are fully wired
- tests: new fm-omp-harness.test.sh + fm-lock.test.sh and coverage in
bootstrap, teardown, turnend-guard, supervision, liveness; tests/lib.sh
now clears ambient harness markers so detection is hermetic
Verified live on omp 16.3.12.
(cherry picked from commit b2125db)
(cherry picked from commit a19a2a9)
(cherry picked from commit f0233d3)
… architecture guide (cherry picked from commit ecdd6bb)
Combines the 24-commit omp (Oh My Pi) harness-adapter branch with the 50 newer commits on main. All 14 conflicts resolved additively: every omp adapter surface is preserved and every main improvement is kept. omp support is ported into structures main added after the branch diverged: the fm-dispatch-select.sh verified-harness and effort tables, the fm_backend_tmux_agent_state five-state recovery classifier, the agent_state-based secondmate liveness sweep, the operational-input launch-brief encoder in every omp launch template, and the reworked fm-watch-arm successor contract in the omp supervision protocol.
… inside tmux) Three pre-existing main failures surfaced by running the full suite on macOS with system bash 3.2 from inside a tmux session; none were caused by the omp merge: - fm-brief.sh: assign the no-mistakes definition-of-done block with IFS= read -r -d '' instead of DOD=$(cat <<EOF ...). bash 3.2's command-substitution scanner cannot parse heredoc content holding an unbalanced quote character (the apostrophe in "firstmate's"), which made the whole script unparseable on macOS (kunchenguid#958). - fm-spawn.sh: make a failed task-metadata publication explicitly fatal. bash 3.2 does not apply errexit to a redirection failure on a compound command, so an unwritable metadata path let the spawn report success. - tests/fm-session-start.test.sh: clear TMUX for the tmux secondmate-recovery runner so the respawn under test resolves the static firstmate session instead of the host session the suite may be running inside.
Bring main's Kimi adapter, quota-aware agent-owned dispatch (drops fm-dispatch-select.sh), Claude Stop asyncRewake auto-arm, shared session-lock lib, per-harness tmux busy signatures, and the guidance/verification doc split into the omp adapter branch. Conflict resolution kept both sides: every verified-harness list now carries kimi and omp; the omp and kimi adapter sections, launch cases, teardown cleanup, and turn-end integrations coexist. omp's busy signature moved into the per-harness FM_TMUX_OMP_BUSY_REGEX_DEFAULT and its lock identity into fm-session-lock-lib.sh (FM_HARNESS_RE gains ^omp$). Fixes exposed by the merge: - fm-session-lock-lib.sh: match the command name and interpreter script basename separately instead of grepping the whole args string, so anchored short names (^pi$, ^omp$) resolve; restores pi/omp lock recognition that the lib refactor had regressed. - fm-omp-harness.test.sh: assert omp's busy signature through the new per-harness matcher plus a behavioral fm_pane_is_busy check. - docs/documentation-audiences.json: classify docs/supervision-protocols/omp.md.
…hine - fm-session-start.test.sh: the concurrent-lock test used $BASHPID, which is unset on macOS system bash 3.2, so every acquirer got an empty harness pid and none won. Derive each subshell's own pid portably via $(exec sh -c 'echo $PPID'). - fm-spawn-batch.test.sh: run_spawn left FM_CONFIG_OVERRIDE='' so config resolved to the repo's own config/, letting a captain's live config/crew-dispatch.json trip the dispatch backstop. Point it at an isolated empty config dir so the hermetic test is independent of local files.
The merge moved omp's ⟦esc⟧ into the per-harness FM_TMUX_OMP_BUSY_REGEX_DEFAULT only, but the harness-agnostic composer/submit path (fm_tmux_composer_row_state, behind fm-send's submit acknowledgement and the away-mode composer read) uses only FM_TMUX_BUSY_REGEX_DEFAULT. Without ⟦esc⟧ there, a steer to a busy omp pane on the no-box fallback could false-report a swallowed Enter. ⟦esc⟧ is omp-unique and unambiguous (unlike the claude/kimi spinners main deliberately scoped per-harness), so it is safe in the shared default; restored in fm-tmux-lib.sh and fm-watch.sh (kept byte-identical) and pinned by two omp-harness assertions. Live smoke on omp 17.1.5 re-verified: SMOKE_OK print run, busy token ⟦esc⟧ present-busy/absent-idle, pane process name omp, launch flags, OMPCODE=1, and the session_stop forced-continuation contract. Stamps updated accordingly.
damianpdr
marked this pull request as ready for review
July 30, 2026 12:42
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
damianpdr
marked this pull request as draft
July 30, 2026 14:06
damianpdr
marked this pull request as ready for review
July 30, 2026 14:25
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.
Why
Firstmate can already transport and observe OMP sessions through Herdr, but upstream
maindoes not contain a first-class OMP harness adapter. This ports the adapter work from kunchenguid#1144 onto currentmainand verifies it against OMP 17.2.0.What
⟨esc⟩busy token and the legacy⟦esc⟧tokensession_startnudge and explicit OMP identity to turn-end recoveryVerification
tests/fm-spawn-dispatch-profile.test.sh: passed, including JS/nested/package extension refusal, endpoint/worktree rollback, and raw non-OMP secondmate coveragetests/fm-omp-harness.test.sh: passed, including verified/direct/quoted/env-wrapped OMP guard refusal and env split-string fail-closed casestests/fm-kimi-harness.test.sh: passed after inherited-marker launch expectations were updatedtests/fm-sessionstart-nudge.test.sh: passed, including missing-state, initialized-primary, linked-worktree, native event, and OMP identity casestests/fm-brief.test.sh,tests/fm-spawn-batch.test.sh, andtests/fm-turnend-guard.test.sh: passedbin/fm-session-start.sh,.lockand.omp-turnend-extension-loadedwere created, and Firstmate steering returnedFIRSTMATE_FINAL_STEERProvenance
Based on kunchenguid#1144 by @Boxyboxy; the merge commit retains the source branch history.
Merge policy
This is a personal-fork verification PR and remains draft. The repository's
PR must be raised via no-mistakespolicy check is expected to fail because this PR was created manually rather than by Firstmate's no-mistakes workflow; every substantive repository and Herdr CI gate passes. It is not being proposed for upstream merge.