Skip to content
Merged
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
43 changes: 38 additions & 5 deletions .agents/skills/harness-adapters/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: harness-adapters
description: Agent-only reference for firstmate harness operations. Use before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, verifying a new harness adapter, or sending a captain-requested Cloud Devin /handoff to a live Devin CLI crew. Contains verified facts for claude, codex, opencode, pi, pi-signed, omp, grok, kimi, and the crew-only Hermes and Devin adapters.
description: Agent-only reference for firstmate harness operations. Use before spawning or recovering a crewmate or secondmate, handling a trust dialog, sending a harness-specific skill invocation, interrupting or exiting an agent, resuming an exited agent, verifying a new harness adapter, or sending a captain-requested Cloud Devin /handoff to a live Devin CLI crew. Contains verified facts for claude, codex, opencode, pi, pi-signed, omp, grok, kimi, and the crew-only Hermes, Devin, and agy adapters.
user-invocable: false
metadata:
internal: true
Expand Down Expand Up @@ -46,10 +46,7 @@ OMP primary detection and lock liveness follow the distinct launch-bound identit
That probe stops at the innermost harness ancestor, so an agent of another harness started from OMP's bash tool keeps its own identity instead of inheriting the OMP primary's.
Within the Pi family, only the exact launch-boundary marker `FM_PI_HARNESS=pi-signed` alongside `PI_CODING_AGENT=true` selects the signed identity; unmarked shared launcher ancestry remains `pi`.
`bin/fm-harness.sh crew` resolves the effective crewmate harness from `config/crew-harness` (absent or `default` -> own).
The configured crew-only `hermes` and `devin` identities resolve through that same path, but neither is a verified primary or secondmate identity.
`bin/fm-harness.sh secondmate` resolves the secondmate-launch harness through the chain `config/secondmate-harness` -> `config/crew-harness` -> own, so an unset `config/secondmate-harness` matches the crew harness.
The one exception is a crew-only harness: `config/crew-harness: hermes` or `devin` is filtered out of that implicit chain and resolution continues to own-harness detection, because no verified secondmate launch template serves it.
An explicit `config/secondmate-harness: hermes` or `devin` still resolves verbatim and is refused at the spawn kind boundary.
[Harness support in the configuration guide](../../../docs/configuration.md#harness-support) owns the crew-only limits and secondmate fallback.
`bin/fm-spawn.sh` uses `crew` mode for a crewmate/scout launch and `secondmate` mode for a `--secondmate` launch, re-resolving on every spawn so the split is durable across respawns; an explicit per-spawn harness arg overrides either.
On `unknown`, ask the captain instead of guessing.
A captain override always beats detection.
Expand Down Expand Up @@ -140,6 +137,7 @@ The supported launch-profile flags below are verified locally; each row records
| opencode | `--model <provider/model>` | none for firstmate's interactive launch | Verified on opencode 1.17.6. `opencode run` has `--variant`, but firstmate launches the interactive `opencode --prompt` path, which has no verified effort flag. |
| kimi | `--model <model>` | none | Verified 2026-07-25 on Kimi Code CLI 0.29.1. |
| hermes | `--model <model>` | `--reasoning <low\|medium\|high\|xhigh\|max>` plus session-scoped `/reasoning` | Verified 2026-08-25 on Hermes Agent v0.20.0; the TUI launcher drops the CLI value, so spawn applies the session command too. Hermes additionally accepts none/minimal/ultra, but those are outside Firstmate's shared effort vocabulary. |
| agy | `--model <id>` | `--effort <low\|medium\|high\|xhigh\|max>` | Check the current catalog and [agy profile rules](../../../docs/configuration.md#crew-dispatch-profiles-configcrew-dispatchjson). |

The concrete `harness` field owns adapter identity independently of the model provider: `harness=pi` with `model=xai/grok-*` is Pi using xAI, not `harness=grok`, and does not require Grok CLI login; `harness=grok` remains the standalone Grok Build CLI adapter.
Ordinary dispatch does not resolve that split in shell: establish which credential store a tuple reads from the discovery surfaces below plus `quota-axi auth --json`'s per-provider sources, and show that reasoning rather than inferring it from a harness, model, or source name.
Expand All @@ -160,6 +158,7 @@ Use the discovery surface in the current authenticated environment because suppo
| grok | Run `grok models`, which lists the models available to the current Grok installation and account. |
| kimi | Run `kimi provider list --json`, which lists the current provider and model configuration. |
| hermes | Run `hermes config get model` and `hermes status`; the former reports the active model/provider slugs and the latter confirms current authentication. |
| agy | Run `agy models`, a remote fetch that lists `<id>\t<label>` for the signed-in account; it prints nothing secret. |

For an unfamiliar harness or model namespace, establish support and provider identity from that harness's authoritative CLI help, model listing, or current documentation rather than guessing from a name or prefix.
A listing that reaches the account and does not contain the model is concrete evidence the model is unsupported: block that candidate and quote the result.
Expand All @@ -181,6 +180,7 @@ Natural language is acceptable if uncertain.
- grok: `/<skill>`, for example `/no-mistakes` (same form as claude). Verified end to end: grok discovers the user-level `no-mistakes` skill, `/no-mistakes` invokes it, and grok drives a real `no-mistakes axi run`. Like codex's `$`/`/` popups, typing `/<skill>` opens grok's slash-autocomplete, so a too-fast Enter selects the popup entry instead of sending, and for an argument-taking command (like `/no-mistakes`'s optional task-first argument) that first Enter only expands the popup selection into an argument-hint placeholder rather than submitting - a genuine second Enter is required (see the grok section below for the 2026-07-03 incident and fix). `fm_tmux_submit_core`'s retried Enter (used by `fm-send` on the tmux backend) handles this through the structural composer reader; the herdr backend needed a dedicated fix (`fm_backend_herdr_composer_state`, docs/herdr-backend.md) because its prior delta-based verification false-positived on that same popup-close content change.
- kimi: `/<skill>`, for example `/no-mistakes`.
- hermes: `/<skill>`, for example `/no-mistakes`; `fm-send` preserves the native TUI skill command when the active profile exposes it, otherwise it sends a validated absolute `SKILL.md` instruction from Firstmate's installed skill roots.
- agy: `/<skill>`, for example `/no-mistakes`; agy discovers user skills under `~/.agents/skills`, its slash popup selects the command, and one typed-plane `fm-send` Enter submits it on Herdr.

## Submission acknowledgement hazards

Expand Down Expand Up @@ -549,3 +549,36 @@ The descendant closure is token-proven Hermes only; every other harness keeps th
Tmux recovery validates the foreground Hermes process against the recorded executable, while Herdr requires a registered live agent rather than upgrading a shell husk from the session sidecar.
A spawn that finds `state/<id>.hermes-session` present but carrying no usable resumable id refuses instead of launching a fresh session against that stale sidecar, because the lifecycle bridge would then never acknowledge a turn; remove the sidecar or run `fm-teardown.sh <id> --force` and respawn.
`fm-crew-state` remains harness-generic: the Hermes hook's semantic busy/idle record drives its pane-state gate, then an idle worker falls through to the existing status-log or no-mistakes run reconciliation.

## agy (CREWMATE/SCOUT ONLY; VERIFIED 2026-12-02, Antigravity CLI 1.5.21)

This adapter ports upstream `kunchenguid/firstmate#4200` (the agy worker and scout adapter) and `kunchenguid/firstmate#8838` (the `swarm` delegation stem); upstream's later primary and secondmate promotion is not part of this fork.
Agy can update itself in the background, so rerun the opt-in live guard after an update.
[Runtime verification](../../../docs/verification/runtime-backends.md#agy-crew-lifecycle) records the supervised Herdr trial, the opt-in tmux guard, and their coverage limits.

| Fact | Value |
|---|---|
| Prerequisites | See [harness support](../../../docs/configuration.md#harness-support) for the supported backends and sign-in requirement. |
| Launch | `agy --dangerously-skip-permissions --settings state/<id>.agy-settings.json [--model <id>] [--effort <level>] --prompt-interactive "<encoded brief pointer>"` with inherited `CLAUDECODE`, `PI_CODING_AGENT`, `GROK_AGENT`, and `FM_PI_HARNESS` cleared. The first turn reads a private copy at `state/<id>.agy-brief.md`. |
| Autonomy | `--dangerously-skip-permissions`; tool calls, network commands, and writes outside the worktree such as the status file run without a prompt. |
| Trust dialog | A fresh worktree stops on `Do you trust the contents of this project?`. agy trusts exact paths only, so neither the captain's home-directory entry nor a parent directory covers a worktree. The session settings name the exact worktree in `trustedWorkspaces`, which removes the dialog and is never saved to `~/.gemini/antigravity-cli/settings.json`. |
| Busy state | `agy-title`: the settings install `bin/fm-agy-state.sh` as agy's `title` command, which agy runs with its session-state JSON on every state change; the bridge header owns the `agent_state` mapping. |
| Turn end | The bridge publishes the generation-bound marker when `agent_state` returns to `idle` with no background task running. |
| Spawn gate | Success requires first-turn proof from the lifecycle bridge. On failure, spawn attempts to stop the endpoint and preserves its binding and settings if termination remains unconfirmed. |
| Composer | A `>` row framed by full-width `─` rules, showing `Auto mode: edits & safe commands auto-approved (shift+tab to cycle)` until the first typed input. The tmux and Herdr readers recognize the styled placeholder inside agy's frame. Firstmate requires a proven-empty composer before typing a command. Herdr also uses its native `agy` status to confirm typed submits. |
| Steering | Firstmate rings the inbox doorbell only when the composer is proven empty. If agy is busy when the doorbell arrives, it can queue the input (`Press up to edit queued messages`) for a new turn. |
| Interrupt | Single Escape; agy prints `Interrupted · What should Antigravity CLI do instead?`, the bridge records idle, and the composer stays empty. |
| Exit | Submit `/exit` with one Enter. Agy returns the pane to its shell and prints `agy --conversation=<id>`. See the [typed exit verification](../../../bin/fm-send.sh) when sending through Firstmate. |
| Resume | Use the conversation ID printed on exit with `agy --conversation=<id>`, or use the ID from the saved `state/<id>.agy-conversation.<busy-gen>` pointer for that session. For a manual transcript check, run without `--settings` or supply a fresh trust-only settings object. Reusing the task's settings can route callbacks to its live worker. For supervised recovery, run `fm-control.sh <id> relaunch` to start a fresh conversation carrying the recovery note. Relaunching a raw agy probe requires an explicit `--harness` choice. `--continue` (`-c`) resumes the most recent conversation in the current working directory. |
| Skill invocation | `/<skill>`, for example `/no-mistakes`; skills under `~/.agents/skills` are discovered. |
| Env marker | None. Tool processes inherit the launcher's `AGENT=1` and get `~/.gemini/antigravity-cli/bin` prepended to `PATH`, and neither is an identity, so detection is the anchored ancestry name `agy`. |
| Herdr identity | Native agent `agy`; `agent_status` is `blocked` on the trust dialog and `working` during turns. |

agy runs a long shell command, such as `no-mistakes axi run`, as a background task and ends the model turn; its title payload then reports `agent_state` `idle` with a nonzero `task_count`, and agy resumes the agent by itself when the task finishes.
The bridge keeps that state busy and publishes no turn end, so supervision does not read a worker waiting on its own background job as finished.
States the trial never exercised, such as `reviewing` and `error`, record unknown rather than idle.
The session settings also set `artifactReviewPolicy` to `always-proceed` and `showFeedbackSurvey` to false so neither human prompt can park an unattended worker.
The title command's output becomes the terminal title, `fm-<id>`, which Herdr reports as the pane's `terminal_title`.
See [dispatch profile requirements](../../../docs/configuration.md#crew-dispatch-profiles-configcrew-dispatchjson) for the explicit agy provider field.
Color-scheme and data-collection consent screens appear when the selected home has unfinished onboarding.
Resolve credential or onboarding blockers outside the worker pane.
1 change: 1 addition & 0 deletions .agents/skills/operational-home-layout/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ state/ volatile runtime signals; gitignored
<id>.kimi-turnend-token firstmate-owned Kimi hook registry token for the task; removed by teardown
<id>.devin-turnend-token firstmate-owned Devin hook registry token for the task; removed by teardown
<id>.devin-config.json firstmate-owned per-worker Devin config written by bin/fm-devin-config.sh and passed via --config; removed by teardown
<id>.agy-settings.json <id>.agy-brief.md <id>.agy-state <id>.agy-conversation.<busy-gen> firstmate-owned session-only agy settings and private copy addressed by the launch prompt, plus the bin/fm-agy-state.sh bridge's dedupe sidecar and conversation id for that busy generation; removed by teardown
<id>.hermes-turnend-token <id>.hermes-session <id>.hermes-started firstmate-owned Hermes hook registry token plus the task's stable session id and per-turn start acknowledgement; removed by teardown
<id>.omp-ext.ts <id>.omp-ready <id>.omp-started <id>.omp-doorbell-ready <id>.omp-doorbell-failed firstmate-generated OMP task extension plus its session-start and first-turn acknowledgement markers; .omp-ready publishes only after the inbox doorbell activates, and a lost handshake journals its reason to .omp-doorbell-failed (docs/architecture.md; bin/fm-task-inbox-lib.sh); removed by teardown
<id>.inbox/ durable steering inbox: sequenced firstmate instruction records the worker acknowledges by moving them into its handled/ subdirectory; written by fm-send, re-rung and escalated by the watcher, removed by teardown (bin/fm-task-inbox-lib.sh)
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Load `session-start-recovery` when the digest reports recovery inputs, board dri
## 4. Harness and runtime dispatch

Load `harness-adapters` before every spawn or recovery and before trust handling, skill invocation, interrupt, exit, resume, or adapter verification.
The verified harnesses are `claude`, `codex`, `opencode`, `pi`, `pi-signed`, `omp`, `grok`, and `kimi`, plus `hermes` and `devin` for crewmates and scouts only; never dispatch on an unverified adapter.
The verified harnesses are `claude`, `codex`, `opencode`, `pi`, `pi-signed`, `omp`, `grok`, and `kimi`, plus `hermes`, `devin`, and `agy` for crewmates and scouts only; never dispatch on an unverified adapter.
If static `config/crew-harness` or `config/secondmate-harness` names an unverified adapter, report it and fall back only to a verified adapter rather than launching it.
If `config/secondmate-harness-fallback` names an unverified adapter, report it and never select it.

Expand Down
6 changes: 6 additions & 0 deletions bin/backends/herdr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,12 @@ EOF
esac
return 0
fi
if [ "$harness" = agy ]; then
cap=$(fm_backend_herdr_capture_ansi "$target" 200 2>/dev/null \
|| fm_backend_herdr_capture "$target" 200) || { printf 'unknown'; return 0; }
fm_composer_agy_frame_state "$cap"
return 0
fi
cap=$(fm_backend_herdr_capture_ansi "$target" "$FM_BACKEND_HERDR_COMPOSER_LINES" 2>/dev/null \
|| fm_backend_herdr_capture "$target" "$FM_BACKEND_HERDR_COMPOSER_LINES") || { printf 'unknown'; return 0; }

Expand Down
2 changes: 1 addition & 1 deletion bin/backends/tmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ fm_backend_tmux_agent_state() { # <target> [bun-realpath] [omp-realpath] [herme
return 0
fi
case "$comm" in
*claude*|*codex*|*opencode*|*grok*|*kimi*|*hermes*|devin|*devin*|pi|pi-signed|pi-launcher|Pi) printf 'alive' ;;
*claude*|*codex*|*opencode*|*grok*|*kimi*|*hermes*|devin|*devin*|agy|pi|pi-signed|pi-launcher|Pi) printf 'alive' ;;
bun|omp|cli.js) fm_backend_tmux_bun_agent_state "$target" "$comm" "$expected_bun" "$expected_omp" ;;
*) printf 'ambiguous' ;;
esac
Expand Down
Loading
Loading