Skip to content

feat: add omp (Oh My Pi) harness adapter#374

Open
Boxyboxy wants to merge 3 commits into
kunchenguid:mainfrom
Boxyboxy:feat/omp-adapter
Open

feat: add omp (Oh My Pi) harness adapter#374
Boxyboxy wants to merge 3 commits into
kunchenguid:mainfrom
Boxyboxy:feat/omp-adapter

Conversation

@Boxyboxy

@Boxyboxy Boxyboxy commented Jul 9, 2026

Copy link
Copy Markdown

What

Adds omp (Oh My Pi) as a sixth verified firstmate harness adapter, alongside claude, codex, opencode, pi, and grok. Firstmate can now detect when it is itself running on omp (previously mis-detected as claude), and can spawn / supervise / steer / recover / tear down omp crewmates and secondmates, hold its session lock under omp, and run its own primary turn-end guard + watcher supervision under omp.

Why omp is distinct (not just "pi")

omp is Pi-derived but differs in ways that matter to the adapter:

  • Sets both OMPCODE=1 and CLAUDECODE=1, so detection must check OMPCODE first or omp mis-detects as claude.
  • Runs as process omp, so it supports confident secondmate liveness (pi's bare node does not).
  • Has a real approval system, so unattended crewmates need --auto-approve.
  • .omp/extensions/*.ts is a native auto-discovery root, so the primary turn-end guard is a tracked, auto-discovered extension (no -e wiring, no generated bridge like pi needs).
  • 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) - a third mechanism distinct from the passive follow-up used by pi/grok/opencode.

Surface

  • Detection (fm-harness.sh), lock (fm-lock.sh), spawn mechanics + crewmate turn-end signal extension (fm-spawn.sh).
  • Busy detection (fm-watch.sh, fm-tmux-lib.sh), liveness (bin/backends/tmux.sh).
  • Bootstrap dispatch/effort/secondmate-liveness (fm-bootstrap.sh), session-start guard load-health (fm-session-start.sh), teardown cleanup (fm-teardown.sh).
  • Primary turn-end guard: new tracked .omp/extensions/fm-primary-turnend-guard.ts (session_stop); classification comment + repair_line arm; new docs/supervision-protocols/omp.md; docs/turnend-guard.md.
  • Knowledge: harness-adapters skill omp section + an expanded new-adapter wiring checklist so future adapters are fully wired; verified-set enumerations across AGENTS.md, README.md, docs, and the afk skill.
  • Tests: new tests/fm-omp-harness.test.sh and tests/fm-lock.test.sh, plus coverage in bootstrap/teardown/turnend-guard/supervision/liveness; tests/lib.sh now clears ambient harness markers so detection is hermetic across dev machines.

How it was built

Spec-first: a frozen spec was authored, then reviewed from four angles in parallel (adapter-integration consistency, version-resilience, correctness/security, test coverage). The review caught real gaps the first draft missed - a fm-lock.sh blocker (an omp primary could not hold its session lock), three separate adapter enumerations in fm-bootstrap.sh, and the repair_line() arm - which were folded into the spec before the parallel implementation.

Verification

  • Every omp runtime fact verified live on omp 16.3.12: detection markers, process name, busy signature (⟦esc⟧), /quit exit + resume line, .omp/extensions auto-discovery of a committed file, and session_stop forced continuation (with both a static return and a realistic async handler that awaits a spawned subprocess).
  • shellcheck bin/*.sh bin/backends/*.sh tests/*.sh is clean.
  • ~25 test files pass locally covering every touched surface plus a regression sweep; 0 failures.

Interrupt (Escape) is inferred from omp's own ⟦esc⟧ hint rather than cleanly observed; a re-confirm item is recorded in the skill's re-verification checklist.

Boxyboxy added 3 commits July 8, 2026 19:25
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
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.

1 participant