Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/harness-adapters/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Before killing and respawning a live OMP agent for a wedged PROVIDER STREAM, fol
**Primary-session integration fact (verified 2026-07-31, OMP 17.1.8).**
Plain OMP started from the Firstmate root discovers `.omp/extensions/fm-primary-omp.ts` natively, including in a fresh checkout before canonical `state/` exists; `omp -e .omp/extensions/fm-primary-omp.ts` remains the explicit recovery fallback.
The adapter publishes the OMP marker shape owned by [configuration](../../../docs/configuration.md#harness-support), delivers the session-start instruction on native `session_start` and `session_switch` events, and owns watcher generations through `fm_watch_arm_omp` plus `/new` and `/resume` continuity.
It routes watcher follow-ups through OMP's `sendUserMessage(content)` with no explicit `deliverAs`, so OMP starts a turn when idle and steers while streaming instead of queueing the notification; it runs the shared turn-end predicate through native `session_stop`, and applies the shared watcher-arm, persistent-directory, and delegation-shaped tool safety checks before tool execution.
Primary watcher notification delivery and durable wake acknowledgement boundaries are owned by [`docs/watcher-continuity.md`](../../../docs/watcher-continuity.md); the adapter also runs the shared turn-end predicate through native `session_stop` and applies the shared watcher-arm, persistent-directory, and delegation-shaped tool safety checks before tool execution.
`bin/fm-session-start.sh` rejects a missing, stale, foreign-PID, or version-mismatched loaded marker and prints both native-discovery and explicit `-e` recovery commands.
The authoritative operating procedure is `docs/supervision-protocols/omp.md`.

Expand Down
17 changes: 9 additions & 8 deletions .omp/extensions/fm-branch-supervision-omp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ import type { Model } from "@oh-my-pi/pi-ai";
import type { Effort } from "@oh-my-pi/pi-catalog/effort";
import {
activateEligibleRowsOwner,
createPrimaryWatcherWake,
FM_BRANCH_DISPATCH_EVENT,
FM_PRIMARY_WATCHER_WAKE_EVENT,
releaseEligibleRowsSnapshot,
rollbackEligibleRowsOwnerActivation,
scopeForUnreadWake,
Expand Down Expand Up @@ -849,21 +851,20 @@ ${context.command}
const body = `FIRSTMATE WATCHER WAKE: ${message}\n\nRun bin/fm-wake-drain.sh first and handle the queued wake. (Supervision branch unavailable, falling back to main: ${detail})`;
// Marked operational like every watcher injection, so the wake is never
// mistaken for captain input (away-mode return semantics, mirror filter).
const content = encodeOperationalInput(body);
// Deliver through the exact main-wake mechanism the primary OMP adapter uses
// (fm-primary-omp.ts sendFollowUp): a custom watcher-wake message delivered
// as a steer with triggerTurn. Unlike sendUserMessage/followUp, this
// reliably wakes an idle or interrupted main under OMP steer/continuation
// semantics, so a broken branch never strands the wake.
const wake = createPrimaryWatcherWake(encodeOperationalInput(body), "branch-fallback");
try {
pi.events?.emit?.(FM_PRIMARY_WATCHER_WAKE_EVENT, wake);
} catch {}
if (wake.accepted) return;
pi.sendMessage(
{
customType: "firstmate-watcher-wake",
content,
content: wake.content,
display: false,
attribution: "agent",
details: { kind: "watcher", runtime: "omp" },
},
{ deliverAs: "steer", triggerTurn: true },
{ deliverAs: "nextTurn", triggerTurn: true },
);
}

Expand Down
Loading
Loading