Skip to content

feat(backends): add Paseo runtime backend - #1

Closed
ryannmicua wants to merge 11 commits into
mainfrom
fm/paseo-backend-adapter
Closed

ryannmicua wants to merge 11 commits into
mainfrom
fm/paseo-backend-adapter

Conversation

@ryannmicua

Copy link
Copy Markdown
Owner

Intent

"Ship it" - implement the Paseo runtime backend so firstmate can dispatch crewmates through the Paseo CLI (paseo run / paseo send) instead of launching claude/codex/opencode directly, following the scout investigation that returned a go verdict. The captain approved this design, and it is the accepted specification: root Paseo workers own isolated worktrees, launch with env -u PASEO_AGENT_ID, preserve per-task labels and repeated env values, poll native Paseo status, keep liveness unverified, support Codex/OpenCode with host-diagnostic-gated Claude, reject absent providers, archive agent and workspace records, and never control the Paseo daemon. Full evidence: data/paseo-backend-scout/report.md.

What Changed

  • Added an explicit-only Paseo backend using paseo run/paseo send, provider mapping for Codex/OpenCode and diagnostic-gated Claude, labeled root agents, provider-owned worktrees, and persisted agent/workspace metadata.
  • Added native Paseo status polling and busy classification, unverified liveness handling, stop/archive control flows, and refusal paths for unsupported providers, keys, secondmate spawns, and missing environment-file transport.
  • Documented Paseo setup and lifecycle limits, with adapter, busy-state, and control-path coverage.

Risk Assessment

🚨 High: Captain, the implementation can archive every successfully spawned Paseo worker and also omits required watcher, control, and environment behavior, so it is not safe to merge without fixes.

Testing

Live runtime validation passed for the exercised Paseo lifecycle and provider-rejection scenarios. The focused contract tests were recorded as non-live and therefore remain untested under the live-validation contract.

  • Live validation: ✅ go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Adapter maps supported providers, rejects unavailable Claude, preserves env transport, and keeps liveness unverified. ⏸️ untested no The prior payload cited a test command but recorded live=false, so it did not establish a live product result.
A running Paseo worker is classified busy from native status. ✅ pass live Live fm_busy_classify paseo ... returned busy paseo-native for a real running Codex task.
Unsupported providers are rejected before creating a Paseo agent. ✅ pass live Live bin/fm-spawn.sh ... --harness gemini --backend paseo rejected before agent creation.
Firstmate creates a root Codex Paseo worker with recorded agent/workspace identities and an isolated worktree. ✅ pass live Live fm-spawn.sh plus paseo inspect, paseo logs, and paseo workspace ls.
Exit proves native stop, then teardown archives the agent and workspace. ✅ pass live Live fm-control.sh ... exit followed by fm-teardown.sh ... --force; final inspect showed closed/archived and no workspaces.
Repeated environment values use secret-safe Paseo transport and control contracts remain intact. ⏸️ untested no The prior payload cited test commands but recorded live=false, so it did not establish a live product result.
Evidence: Live Paseo lifecycle evidence
Live Paseo: Codex task spawned with isolated worktree; native status `running`; classifier returned `busy paseo-native`; exit and teardown completed; final agent status `closed`, `Archived: true`, workspaces `[]`.
Evidence: Unsupported provider evidence
Adversarial live spawn rejected Gemini: `Paseo has no supported provider for firstmate harness 'gemini'`; active agents remained `[]`.
- Outcome: 🔧 2 issues found → auto-fixed (3) ✅ across 4 runs (41m0s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 14 errors
  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/backends/paseo.sh:85 - The required criterion says to “poll native Paseo status,” but fm_backend_paseo_capture only prepends status text to diagnostic logs at bin/backends/paseo.sh:85. The watcher hashes that text and sends it to the generic classifier (bin/fm-watch.sh:2724-2738); Paseo is absent from the native busy-state dispatch (bin/fm-backend.sh:873-879), so a working agent with unchanged logs is treated as stale. Connect native status to the watcher lifecycle path and retain logs only as diagnostics.
  • 🚨 bin/fm-control-lib.sh:283 - The accepted stop/control requirement is still unreachable. The adapter implements paseo stop at bin/backends/paseo.sh:101-105, but interrupt rejects Paseo because fm_control_backend_supports_key omits it (bin/fm-control-lib.sh:199-209), exit rejects it because fm_control_backend_state_verified omits it (bin/fm-control-lib.sh:217-221, called at bin/fm-control.sh:477), and relaunch rejects it at bin/fm-spawn.sh:1605-1607. The new absence branch is also a no-op using unset $key at bin/fm-control-lib.sh:283-285, while the docs explicitly preserve the rejection at docs/paseo-backend.md:21. Add the explicit Paseo stop/status-proof path with archive fallback while keeping liveness unverified.
  • 🚨 bin/fm-spawn.sh:2833 - The required per-task environment wiring is omitted. Spawn passes only FM_TASK_ID, FIRSTMATE_HOME, and FIRSTMATE_STATE at bin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated --env at bin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards at bin/fm-spawn.sh:3968 and bin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated --env arguments as required.
  • ⚠️ bin/backends/paseo.sh:123 - The change introduces two unused parallel backend surfaces, fm_backend_paseo_list_live and fm_backend_paseo_current_path (bin/backends/paseo.sh:123-132). Neither is dispatched or called, and Paseo's worktree-owning spawn path does not need current-path discovery. Remove both as the smallest simplification.

🔧 Fix applied.
10 issues (8 errors, 2 warnings) still open:

  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/backends/paseo.sh:85 - The required criterion says to “poll native Paseo status,” but fm_backend_paseo_capture only prepends status text to diagnostic logs at bin/backends/paseo.sh:85. The watcher hashes that text and sends it to the generic classifier (bin/fm-watch.sh:2724-2738); Paseo is absent from the native busy-state dispatch (bin/fm-backend.sh:873-879), so a working agent with unchanged logs is treated as stale. Connect native status to the watcher lifecycle path and retain logs only as diagnostics.
  • 🚨 bin/fm-spawn.sh:2833 - The required per-task environment wiring is omitted. Spawn passes only FM_TASK_ID, FIRSTMATE_HOME, and FIRSTMATE_STATE at bin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated --env at bin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards at bin/fm-spawn.sh:3968 and bin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated --env arguments as required.
  • ⚠️ bin/backends/paseo.sh:123 - The change introduces two unused parallel backend surfaces, fm_backend_paseo_list_live and fm_backend_paseo_current_path (bin/backends/paseo.sh:123-132). Neither is dispatched or called, and Paseo's worktree-owning spawn path does not need current-path discovery. Remove both as the smallest simplification.
  • 🚨 bin/fm-spawn.sh:2838 - The latest fix round inherits ambient PASEO_WORKSPACE_ID at bin/fm-spawn.sh:2838. On a fresh spawn, bin/fm-spawn.sh:2870 then passes it to bin/backends/paseo.sh:53-55, which uses --workspace instead of creating a new isolated worktree. env -u PASEO_AGENT_ID does not clear this workspace binding. Seed the workspace only for relaunches from recorded metadata; fresh root workers must always use the new-workspace path.
  • 🚨 bin/backends/paseo.sh:77 - The latest fix round adds existing-workspace relaunches, but paseo run --workspace returns agent data without workspaceId and reports Using workspace ..., while the parser only accepts JSON workspace fields or Created workspace ... at bin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test at tests/fm-backend-paseo.test.sh:39-41 cannot catch this because its stub emits Created workspace even for --workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.
  • 🚨 bin/backends/paseo.sh:102 - Paseo's native error status is converted to idle at bin/backends/paseo.sh:102; the watcher then returns idle paseo-native at bin/fm-busy-lib.sh:1055, and stop proof accepts it at bin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, including error, at bin/fm-control.sh:375-378. A failed agent can therefore be treated as healthy/idle, reported stopped, or accepted as a successful replacement. Treat error and unknown statuses as failure/unknown in all these paths. Paseo documents error as a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.ts
  • 🚨 bin/fm-spawn.sh:2859 - The latest fix round reads allowlisted environment values and appends them as literal --env KEY=value arguments at bin/fm-spawn.sh:2854-2859, then invokes Paseo at bin/fm-spawn.sh:2870. With an allowlist such as OPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract at docs/configuration.md:424-425, which says values are not written into the launch command. Decide whether this provider-level disclosure is authorized; otherwise an approved secret-safe transport is required, and that remedy exceeds a mechanical fix to this change.
  • ⚠️ bin/backends/paseo.sh:126 - The change adds fm_backend_paseo_visible_capture at bin/backends/paseo.sh:126-129, but Paseo is intentionally absent from FM_BACKEND_VISIBLE_CAPTURE and the helper has no caller or dispatcher path. The stated contract is already satisfied by refusing Paseo visible capture and retaining timeline logs as diagnostics. Remove this unused parallel surface unless a required caller is authorized.

🔧 Fix applied.
13 issues (11 errors, 2 warnings) still open:

  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/backends/paseo.sh:85 - The required criterion says to “poll native Paseo status,” but fm_backend_paseo_capture only prepends status text to diagnostic logs at bin/backends/paseo.sh:85. The watcher hashes that text and sends it to the generic classifier (bin/fm-watch.sh:2724-2738); Paseo is absent from the native busy-state dispatch (bin/fm-backend.sh:873-879), so a working agent with unchanged logs is treated as stale. Connect native status to the watcher lifecycle path and retain logs only as diagnostics.
  • 🚨 bin/fm-spawn.sh:2833 - The required per-task environment wiring is omitted. Spawn passes only FM_TASK_ID, FIRSTMATE_HOME, and FIRSTMATE_STATE at bin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated --env at bin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards at bin/fm-spawn.sh:3968 and bin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated --env arguments as required.
  • ⚠️ bin/backends/paseo.sh:123 - The change introduces two unused parallel backend surfaces, fm_backend_paseo_list_live and fm_backend_paseo_current_path (bin/backends/paseo.sh:123-132). Neither is dispatched or called, and Paseo's worktree-owning spawn path does not need current-path discovery. Remove both as the smallest simplification.
  • 🚨 bin/fm-spawn.sh:2838 - The latest fix round inherits ambient PASEO_WORKSPACE_ID at bin/fm-spawn.sh:2838. On a fresh spawn, bin/fm-spawn.sh:2870 then passes it to bin/backends/paseo.sh:53-55, which uses --workspace instead of creating a new isolated worktree. env -u PASEO_AGENT_ID does not clear this workspace binding. Seed the workspace only for relaunches from recorded metadata; fresh root workers must always use the new-workspace path.
  • 🚨 bin/backends/paseo.sh:77 - The latest fix round adds existing-workspace relaunches, but paseo run --workspace returns agent data without workspaceId and reports Using workspace ..., while the parser only accepts JSON workspace fields or Created workspace ... at bin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test at tests/fm-backend-paseo.test.sh:39-41 cannot catch this because its stub emits Created workspace even for --workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.
  • 🚨 bin/backends/paseo.sh:102 - Paseo's native error status is converted to idle at bin/backends/paseo.sh:102; the watcher then returns idle paseo-native at bin/fm-busy-lib.sh:1055, and stop proof accepts it at bin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, including error, at bin/fm-control.sh:375-378. A failed agent can therefore be treated as healthy/idle, reported stopped, or accepted as a successful replacement. Treat error and unknown statuses as failure/unknown in all these paths. Paseo documents error as a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.ts
  • 🚨 bin/fm-spawn.sh:2859 - The latest fix round reads allowlisted environment values and appends them as literal --env KEY=value arguments at bin/fm-spawn.sh:2854-2859, then invokes Paseo at bin/fm-spawn.sh:2870. With an allowlist such as OPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract at docs/configuration.md:424-425, which says values are not written into the launch command. Decide whether this provider-level disclosure is authorized; otherwise an approved secret-safe transport is required, and that remedy exceeds a mechanical fix to this change.
  • ⚠️ bin/backends/paseo.sh:126 - The change adds fm_backend_paseo_visible_capture at bin/backends/paseo.sh:126-129, but Paseo is intentionally absent from FM_BACKEND_VISIBLE_CAPTURE and the helper has no caller or dispatcher path. The stated contract is already satisfied by refusing Paseo visible capture and retaining timeline logs as diagnostics. Remove this unused parallel surface unless a required caller is authorized.
  • 🚨 bin/backends/paseo.sh:75 - When Paseo lacks native --env-file, the fallback only passes FM_PASEO_ENV_FILE=<path> via --env; nothing in this repository or the documented paseo run interface sources that file, so allowlisted credentials/settings silently never reach the worker. The added test at tests/fm-backend-paseo.test.sh:45 asserts only the path, not delivery. The honest remedy is either a provider-supported secret transport or fail-closed behavior when unavailable; that compatibility choice needs authorization. See the official Paseo CLI reference.
  • 🚨 bin/fm-spawn.sh:1225 - The abort trap archives the workspace unconditionally after any Paseo task has been created (bin/fm-spawn.sh:1223-1225). During a relaunch, bin/fm-spawn.sh:1640-1674 deliberately reuses the recorded workspace and bin/fm-spawn.sh:2899-2903 sets PASEO_DIRECT=1; if metadata publication or the final backlog commit then fails (bin/fm-spawn.sh:4548-4681), cleanup archives the existing workspace that the surviving task record still names. The relaunch-specific replacement cleanup is skipped for Paseo, so this can leave the task pointing at an archived worktree; the same path can also retain the replacement env file because cleanup only removes it when no metadata exists (bin/fm-spawn.sh:1227-1230). Archive the workspace only for a fresh workspace owner, or otherwise preserve the inherited workspace during relaunch rollback.
  • 🚨 bin/fm-teardown.sh:3491 - The direct Paseo teardown branch protects the root task path, but forced recursive cleanup of a secondmate home still treats child Paseo tasks as Treehouse/session tasks. bin/fm-teardown.sh:3147-3150 calls fm_backend_kill with zellij-specific extra arguments, so fm_backend_paseo_kill receives no workspace id; then bin/fm-teardown.sh:3165-3195 returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence is fm-teardown.sh <secondmate> --force with a child spawned on Paseo: the agent may be archived, but its provider-owned workspace is not archived and its worktree can be deleted or reset outside Paseo. The recursive artifact cleanup also omits $sub_state/$child_id.paseo-env at bin/fm-teardown.sh:3208-3213; the preflight path remains generic at bin/fm-teardown.sh:2895-2923. Add the Paseo-specific recursive close/archive path and artifact cleanup before allowing child-record removal.

🔧 Fix applied.
11 errors still open:

  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/fm-spawn.sh:2833 - The required per-task environment wiring is omitted. Spawn passes only FM_TASK_ID, FIRSTMATE_HOME, and FIRSTMATE_STATE at bin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated --env at bin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards at bin/fm-spawn.sh:3968 and bin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated --env arguments as required.
  • 🚨 bin/fm-spawn.sh:2838 - The latest fix round inherits ambient PASEO_WORKSPACE_ID at bin/fm-spawn.sh:2838. On a fresh spawn, bin/fm-spawn.sh:2870 then passes it to bin/backends/paseo.sh:53-55, which uses --workspace instead of creating a new isolated worktree. env -u PASEO_AGENT_ID does not clear this workspace binding. Seed the workspace only for relaunches from recorded metadata; fresh root workers must always use the new-workspace path.
  • 🚨 bin/backends/paseo.sh:77 - The latest fix round adds existing-workspace relaunches, but paseo run --workspace returns agent data without workspaceId and reports Using workspace ..., while the parser only accepts JSON workspace fields or Created workspace ... at bin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test at tests/fm-backend-paseo.test.sh:39-41 cannot catch this because its stub emits Created workspace even for --workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.
  • 🚨 bin/backends/paseo.sh:102 - Paseo's native error status is converted to idle at bin/backends/paseo.sh:102; the watcher then returns idle paseo-native at bin/fm-busy-lib.sh:1055, and stop proof accepts it at bin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, including error, at bin/fm-control.sh:375-378. A failed agent can therefore be treated as healthy/idle, reported stopped, or accepted as a successful replacement. Treat error and unknown statuses as failure/unknown in all these paths. Paseo documents error as a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.ts
  • 🚨 bin/fm-spawn.sh:2859 - The latest fix round reads allowlisted environment values and appends them as literal --env KEY=value arguments at bin/fm-spawn.sh:2854-2859, then invokes Paseo at bin/fm-spawn.sh:2870. With an allowlist such as OPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract at docs/configuration.md:424-425, which says values are not written into the launch command. Decide whether this provider-level disclosure is authorized; otherwise an approved secret-safe transport is required, and that remedy exceeds a mechanical fix to this change.
  • 🚨 bin/fm-spawn.sh:1225 - The abort trap archives the workspace unconditionally after any Paseo task has been created (bin/fm-spawn.sh:1223-1225). During a relaunch, bin/fm-spawn.sh:1640-1674 deliberately reuses the recorded workspace and bin/fm-spawn.sh:2899-2903 sets PASEO_DIRECT=1; if metadata publication or the final backlog commit then fails (bin/fm-spawn.sh:4548-4681), cleanup archives the existing workspace that the surviving task record still names. The relaunch-specific replacement cleanup is skipped for Paseo, so this can leave the task pointing at an archived worktree; the same path can also retain the replacement env file because cleanup only removes it when no metadata exists (bin/fm-spawn.sh:1227-1230). Archive the workspace only for a fresh workspace owner, or otherwise preserve the inherited workspace during relaunch rollback.
  • 🚨 bin/fm-teardown.sh:3491 - The direct Paseo teardown branch protects the root task path, but forced recursive cleanup of a secondmate home still treats child Paseo tasks as Treehouse/session tasks. bin/fm-teardown.sh:3147-3150 calls fm_backend_kill with zellij-specific extra arguments, so fm_backend_paseo_kill receives no workspace id; then bin/fm-teardown.sh:3165-3195 returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence is fm-teardown.sh <secondmate> --force with a child spawned on Paseo: the agent may be archived, but its provider-owned workspace is not archived and its worktree can be deleted or reset outside Paseo. The recursive artifact cleanup also omits $sub_state/$child_id.paseo-env at bin/fm-teardown.sh:3208-3213; the preflight path remains generic at bin/fm-teardown.sh:2895-2923. Add the Paseo-specific recursive close/archive path and artifact cleanup before allowing child-record removal.
  • 🚨 bin/fm-busy-lib.sh:1051 - The f841604 fix round adds Paseo native busy-state handling after the generic Codex gate. A normal Paseo Codex task returns early at bin/fm-busy-lib.sh:1027-1029, so status working never reaches the new branch at bin/fm-busy-lib.sh:1051-1056; the watcher therefore treats unchanged logs from a live Codex worker as stale. Move the Paseo native check before that early return (or exempt Paseo from it).
  • 🚨 bin/fm-spawn.sh:2903 - The f841604 fix round passes GOTMPDIR=/tmp/fm-$ID/gotmp to asynchronous paseo run --background at bin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started at bin/fm-spawn.sh:2902-2903. A worker whose first command is go test or go build can therefore fail because its configured Go temp directory does not exist. Create the task temp root before invoking Paseo, as the existing launch path does at bin/fm-spawn.sh:4087-4096.

🔧 No changes applied.
17 issues (16 errors, 1 warning) still open:

  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/fm-spawn.sh:2833 - The required per-task environment wiring is omitted. Spawn passes only FM_TASK_ID, FIRSTMATE_HOME, and FIRSTMATE_STATE at bin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated --env at bin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards at bin/fm-spawn.sh:3968 and bin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated --env arguments as required.
  • 🚨 bin/fm-spawn.sh:2838 - The latest fix round inherits ambient PASEO_WORKSPACE_ID at bin/fm-spawn.sh:2838. On a fresh spawn, bin/fm-spawn.sh:2870 then passes it to bin/backends/paseo.sh:53-55, which uses --workspace instead of creating a new isolated worktree. env -u PASEO_AGENT_ID does not clear this workspace binding. Seed the workspace only for relaunches from recorded metadata; fresh root workers must always use the new-workspace path.
  • 🚨 bin/backends/paseo.sh:77 - The latest fix round adds existing-workspace relaunches, but paseo run --workspace returns agent data without workspaceId and reports Using workspace ..., while the parser only accepts JSON workspace fields or Created workspace ... at bin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test at tests/fm-backend-paseo.test.sh:39-41 cannot catch this because its stub emits Created workspace even for --workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.
  • 🚨 bin/backends/paseo.sh:102 - Paseo's native error status is converted to idle at bin/backends/paseo.sh:102; the watcher then returns idle paseo-native at bin/fm-busy-lib.sh:1055, and stop proof accepts it at bin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, including error, at bin/fm-control.sh:375-378. A failed agent can therefore be treated as healthy/idle, reported stopped, or accepted as a successful replacement. Treat error and unknown statuses as failure/unknown in all these paths. Paseo documents error as a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.ts
  • 🚨 bin/fm-spawn.sh:2859 - The latest fix round reads allowlisted environment values and appends them as literal --env KEY=value arguments at bin/fm-spawn.sh:2854-2859, then invokes Paseo at bin/fm-spawn.sh:2870. With an allowlist such as OPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract at docs/configuration.md:424-425, which says values are not written into the launch command. Decide whether this provider-level disclosure is authorized; otherwise an approved secret-safe transport is required, and that remedy exceeds a mechanical fix to this change.
  • 🚨 bin/fm-spawn.sh:1225 - The abort trap archives the workspace unconditionally after any Paseo task has been created (bin/fm-spawn.sh:1223-1225). During a relaunch, bin/fm-spawn.sh:1640-1674 deliberately reuses the recorded workspace and bin/fm-spawn.sh:2899-2903 sets PASEO_DIRECT=1; if metadata publication or the final backlog commit then fails (bin/fm-spawn.sh:4548-4681), cleanup archives the existing workspace that the surviving task record still names. The relaunch-specific replacement cleanup is skipped for Paseo, so this can leave the task pointing at an archived worktree; the same path can also retain the replacement env file because cleanup only removes it when no metadata exists (bin/fm-spawn.sh:1227-1230). Archive the workspace only for a fresh workspace owner, or otherwise preserve the inherited workspace during relaunch rollback.
  • 🚨 bin/fm-teardown.sh:3491 - The direct Paseo teardown branch protects the root task path, but forced recursive cleanup of a secondmate home still treats child Paseo tasks as Treehouse/session tasks. bin/fm-teardown.sh:3147-3150 calls fm_backend_kill with zellij-specific extra arguments, so fm_backend_paseo_kill receives no workspace id; then bin/fm-teardown.sh:3165-3195 returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence is fm-teardown.sh <secondmate> --force with a child spawned on Paseo: the agent may be archived, but its provider-owned workspace is not archived and its worktree can be deleted or reset outside Paseo. The recursive artifact cleanup also omits $sub_state/$child_id.paseo-env at bin/fm-teardown.sh:3208-3213; the preflight path remains generic at bin/fm-teardown.sh:2895-2923. Add the Paseo-specific recursive close/archive path and artifact cleanup before allowing child-record removal.
  • 🚨 bin/fm-busy-lib.sh:1051 - The f841604 fix round adds Paseo native busy-state handling after the generic Codex gate. A normal Paseo Codex task returns early at bin/fm-busy-lib.sh:1027-1029, so status working never reaches the new branch at bin/fm-busy-lib.sh:1051-1056; the watcher therefore treats unchanged logs from a live Codex worker as stale. Move the Paseo native check before that early return (or exempt Paseo from it).
  • 🚨 bin/fm-spawn.sh:2903 - The f841604 fix round passes GOTMPDIR=/tmp/fm-$ID/gotmp to asynchronous paseo run --background at bin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started at bin/fm-spawn.sh:2902-2903. A worker whose first command is go test or go build can therefore fail because its configured Go temp directory does not exist. Create the task temp root before invoking Paseo, as the existing launch path does at bin/fm-spawn.sh:4087-4096.
  • 🚨 bin/fm-control.sh:375 - The f841604 control-path fix made Paseo lifecycle calls reachable, but fm-control.sh never sources the Paseo adapter. wait_paseo_status calls the undefined fm_backend_paseo_status (bin/fm-control.sh:375), and do_exit calls undefined fm_backend_paseo_stop_status_proof/fm_backend_paseo_archive_agent (bin/fm-control.sh:499-502). fm-control.sh <paseo-task> exit therefore fails before stopping or archiving; relaunch fails through the same do_exit path. Source the adapter before these calls or route them through a dispatcher that does so.
  • 🚨 bin/fm-busy-lib.sh:1027 - The f841604 native-status fix still places Paseo handling after the Codex early return. For a normal Paseo Codex task, fm_busy_classify exits as unknown codex-unverified at bin/fm-busy-lib.sh:1027-1029, so the native Paseo branch at bin/fm-busy-lib.sh:1051-1055 is unreachable. An active worker with unchanged logs can therefore be surfaced as stale. Move the Paseo native check before the Codex gate or exempt Paseo from that early return; the OpenCode path must continue using the same native branch.
  • 🚨 bin/backends/paseo.sh:110 - The f841604 native-status fix still treats Paseo failures as healthy. error is mapped to idle at bin/backends/paseo.sh:110, so the watcher reports idle paseo-native (bin/fm-busy-lib.sh:1054-1055) and stop proof accepts the failed agent (bin/backends/paseo.sh:120-121). Relaunch independently accepts any nonempty status, including error, through bin/fm-control.sh:375-379 and bin/fm-control.sh:975-981. Classify error/unknown as failure or unknown and allow relaunch confirmation only for explicitly healthy native statuses.
  • 🚨 bin/fm-spawn.sh:2903 - The f841604 background-launch wiring still creates the configured Go temp directory after launching Paseo. GOTMPDIR=/tmp/fm-$ID/gotmp is passed in the environment at bin/fm-spawn.sh:2851-2857, but paseo run --background has already returned only at bin/fm-spawn.sh:2891 when mkdir -p runs at bin/fm-spawn.sh:2902-2903. A worker whose first command is go test or go build can start before that directory exists and fail. Create the required directory before invoking fm_backend_paseo_create_task.
  • 🚨 bin/fm-teardown.sh:3147 - The f841604 teardown fix handles only a root Paseo task (bin/fm-teardown.sh:3491-3495); forced recursive secondmate cleanup still treats Paseo children as Treehouse tasks. The preflight remains generic (bin/fm-teardown.sh:2920-2922), cleanup calls fm_backend_kill with the zellij argument shape so fm_backend_paseo_kill receives no workspace id (bin/fm-teardown.sh:3147-3149), then the generic branch can delete the Paseo-owned worktree (bin/fm-teardown.sh:3165-3195). It also omits $child_id.paseo-env from recursive artifact cleanup (bin/fm-teardown.sh:3208-3213). A real fm-teardown.sh <secondmate> --force with a Paseo child can archive only the agent, delete its provider-owned worktree locally, and remove its record without archiving the workspace. Add the Paseo-specific recursive archive/workspace and artifact path before removing the child record.
  • ⚠️ bin/fm-spawn.sh:2889 - The new gemini) Paseo environment branch (bin/fm-spawn.sh:2889) is unreachable because the Paseo provider map rejects gemini at bin/backends/paseo.sh:37-40; the accepted intent only requires Codex/OpenCode and diagnostic-gated Claude. Remove this unrequired branch as the smallest simplification, unless Gemini support is intentionally being added.

🔧 Fix applied.
14 errors still open:

  • 🚨 bin/fm-spawn.sh:2844 - A successful Paseo spawn is archived by the unconditional EXIT cleanup: PASEO_DIRECT=1 at bin/fm-spawn.sh:2844 is never cleared, so spawn_abort_cleanup calls fm_backend_paseo_kill at bin/fm-spawn.sh:1223 even after metadata and backlog commit. The record then points at an archived agent/workspace. Clear the abort-only flag after the final successful commit.
  • 🚨 bin/backends/paseo.sh:67 - paseo run accepts a prompt, but fm_backend_paseo_create_task appends the brief filepath itself at bin/backends/paseo.sh:67; the worker receives /.../brief.md as its task prompt rather than the brief contents. This can produce a healthy-looking agent that never performs the requested task. Read or otherwise encode the brief contents into the prompt.
  • 🚨 bin/fm-spawn.sh:2838 - The latest fix round inherits ambient PASEO_WORKSPACE_ID at bin/fm-spawn.sh:2838. On a fresh spawn, bin/fm-spawn.sh:2870 then passes it to bin/backends/paseo.sh:53-55, which uses --workspace instead of creating a new isolated worktree. env -u PASEO_AGENT_ID does not clear this workspace binding. Seed the workspace only for relaunches from recorded metadata; fresh root workers must always use the new-workspace path.
  • 🚨 bin/backends/paseo.sh:77 - The latest fix round adds existing-workspace relaunches, but paseo run --workspace returns agent data without workspaceId and reports Using workspace ..., while the parser only accepts JSON workspace fields or Created workspace ... at bin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test at tests/fm-backend-paseo.test.sh:39-41 cannot catch this because its stub emits Created workspace even for --workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.
  • 🚨 bin/backends/paseo.sh:102 - Paseo's native error status is converted to idle at bin/backends/paseo.sh:102; the watcher then returns idle paseo-native at bin/fm-busy-lib.sh:1055, and stop proof accepts it at bin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, including error, at bin/fm-control.sh:375-378. A failed agent can therefore be treated as healthy/idle, reported stopped, or accepted as a successful replacement. Treat error and unknown statuses as failure/unknown in all these paths. Paseo documents error as a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.ts
  • 🚨 bin/fm-spawn.sh:1225 - The abort trap archives the workspace unconditionally after any Paseo task has been created (bin/fm-spawn.sh:1223-1225). During a relaunch, bin/fm-spawn.sh:1640-1674 deliberately reuses the recorded workspace and bin/fm-spawn.sh:2899-2903 sets PASEO_DIRECT=1; if metadata publication or the final backlog commit then fails (bin/fm-spawn.sh:4548-4681), cleanup archives the existing workspace that the surviving task record still names. The relaunch-specific replacement cleanup is skipped for Paseo, so this can leave the task pointing at an archived worktree; the same path can also retain the replacement env file because cleanup only removes it when no metadata exists (bin/fm-spawn.sh:1227-1230). Archive the workspace only for a fresh workspace owner, or otherwise preserve the inherited workspace during relaunch rollback.
  • 🚨 bin/fm-teardown.sh:3491 - The direct Paseo teardown branch protects the root task path, but forced recursive cleanup of a secondmate home still treats child Paseo tasks as Treehouse/session tasks. bin/fm-teardown.sh:3147-3150 calls fm_backend_kill with zellij-specific extra arguments, so fm_backend_paseo_kill receives no workspace id; then bin/fm-teardown.sh:3165-3195 returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence is fm-teardown.sh <secondmate> --force with a child spawned on Paseo: the agent may be archived, but its provider-owned workspace is not archived and its worktree can be deleted or reset outside Paseo. The recursive artifact cleanup also omits $sub_state/$child_id.paseo-env at bin/fm-teardown.sh:3208-3213; the preflight path remains generic at bin/fm-teardown.sh:2895-2923. Add the Paseo-specific recursive close/archive path and artifact cleanup before allowing child-record removal.
  • 🚨 bin/fm-busy-lib.sh:1051 - The f841604 fix round adds Paseo native busy-state handling after the generic Codex gate. A normal Paseo Codex task returns early at bin/fm-busy-lib.sh:1027-1029, so status working never reaches the new branch at bin/fm-busy-lib.sh:1051-1056; the watcher therefore treats unchanged logs from a live Codex worker as stale. Move the Paseo native check before that early return (or exempt Paseo from it).
  • 🚨 bin/fm-spawn.sh:2903 - The f841604 fix round passes GOTMPDIR=/tmp/fm-$ID/gotmp to asynchronous paseo run --background at bin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started at bin/fm-spawn.sh:2902-2903. A worker whose first command is go test or go build can therefore fail because its configured Go temp directory does not exist. Create the task temp root before invoking Paseo, as the existing launch path does at bin/fm-spawn.sh:4087-4096.
  • 🚨 bin/fm-control.sh:375 - The f841604 control-path fix made Paseo lifecycle calls reachable, but fm-control.sh never sources the Paseo adapter. wait_paseo_status calls the undefined fm_backend_paseo_status (bin/fm-control.sh:375), and do_exit calls undefined fm_backend_paseo_stop_status_proof/fm_backend_paseo_archive_agent (bin/fm-control.sh:499-502). fm-control.sh <paseo-task> exit therefore fails before stopping or archiving; relaunch fails through the same do_exit path. Source the adapter before these calls or route them through a dispatcher that does so.
  • 🚨 bin/fm-busy-lib.sh:1027 - The f841604 native-status fix still places Paseo handling after the Codex early return. For a normal Paseo Codex task, fm_busy_classify exits as unknown codex-unverified at bin/fm-busy-lib.sh:1027-1029, so the native Paseo branch at bin/fm-busy-lib.sh:1051-1055 is unreachable. An active worker with unchanged logs can therefore be surfaced as stale. Move the Paseo native check before the Codex gate or exempt Paseo from that early return; the OpenCode path must continue using the same native branch.
  • 🚨 bin/backends/paseo.sh:110 - The f841604 native-status fix still treats Paseo failures as healthy. error is mapped to idle at bin/backends/paseo.sh:110, so the watcher reports idle paseo-native (bin/fm-busy-lib.sh:1054-1055) and stop proof accepts the failed agent (bin/backends/paseo.sh:120-121). Relaunch independently accepts any nonempty status, including error, through bin/fm-control.sh:375-379 and bin/fm-control.sh:975-981. Classify error/unknown as failure or unknown and allow relaunch confirmation only for explicitly healthy native statuses.
  • 🚨 bin/fm-spawn.sh:2903 - The f841604 background-launch wiring still creates the configured Go temp directory after launching Paseo. GOTMPDIR=/tmp/fm-$ID/gotmp is passed in the environment at bin/fm-spawn.sh:2851-2857, but paseo run --background has already returned only at bin/fm-spawn.sh:2891 when mkdir -p runs at bin/fm-spawn.sh:2902-2903. A worker whose first command is go test or go build can start before that directory exists and fail. Create the required directory before invoking fm_backend_paseo_create_task.
  • 🚨 bin/fm-teardown.sh:3147 - The f841604 teardown fix handles only a root Paseo task (bin/fm-teardown.sh:3491-3495); forced recursive secondmate cleanup still treats Paseo children as Treehouse tasks. The preflight remains generic (bin/fm-teardown.sh:2920-2922), cleanup calls fm_backend_kill with the zellij argument shape so fm_backend_paseo_kill receives no workspace id (bin/fm-teardown.sh:3147-3149), then the generic branch can delete the Paseo-owned worktree (bin/fm-teardown.sh:3165-3195). It also omits $child_id.paseo-env from recursive artifact cleanup (bin/fm-teardown.sh:3208-3213). A real fm-teardown.sh <secondmate> --force with a Paseo child can archive only the agent, delete its provider-owned worktree locally, and remove its record without archiving the workspace. Add the Paseo-specific recursive archive/workspace and artifact path before removing the child record.
🔧 **Test** - 2 issues found → auto-fixed (3) ✅
  • 🚨 bin/backends/paseo.sh:31 - Paseo reports Claude as unavailable/disabled, but fm_backend_paseo_provider claude accepts it because paseo provider diagnostic claude exits 0 despite semantic unavailability. Gate on semantic provider availability and add a behavioral test.
  • 🚨 live validation verdict: no-go (3 of 5 scenarios were driven live against the product); failed: Reject unavailable host-diagnostic-gated Claude.
  • Live validation: ❌ no-go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Poll a real Paseo agent’s native status while preserving unverified liveness. ✅ pass live Live Paseo status check
Exercise adapter mapping, env transport, status, stop proof, and key rejection. ⏸️ untested no The prior payload cited a local test command but marked this scenario live=false, so it did not establish a live product result.
Refuse launch when the installed CLI lacks native secret-safe env-file transport. ✅ pass live Secret-safe launch refusal
Reject unavailable host-diagnostic-gated Claude. ❌ fail live Claude provider mismatch
Create and archive a real root Paseo worker end-to-end. ⏸️ untested no Requires an isolated Paseo daemon endpoint/home and disposable provider credentials.
  • bash tests/fm-backend-paseo.test.sh
  • Live Paseo runtime/status/busy/liveness checks
  • Real CLI secret-safe launch refusal check
  • Real Claude provider availability check

🔧 Fix applied.
3 issues (2 errors, 1 warning) still open:

  • 🚨 bin/fm-busy-lib.sh:1026 - Paseo native status is checked after the Codex semantic-source early return, so a native working task is classified unknown codex-unverified instead of busy.
  • 🚨 bin/backends/paseo.sh:115 - Paseo native error status is mapped to idle, allowing failed agents to appear healthy and satisfy stop proof.
  • ⚠️ live validation verdict: inconclusive (2 of 6 scenarios were driven live against the product); untested: A Paseo Codex worker reporting native working remains classified busy despite unchanged logs, A Paseo native error status is not treated as healthy idle, Paseo task creation preserves repeated environment values and secret-safe env-file transport; stop/archive control contracts work, End-to-end Firstmate Paseo spawn, exit, and teardown against a disposable real task
  • Live validation: ⚠️ inconclusive - 2 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Select Paseo with available providers; Codex/OpenCode map and unavailable Claude is rejected ✅ pass live Live command output: paseo daemon status; real adapter provider calls
Poll an existing Paseo agent; native status is read and liveness remains unverified ✅ pass live Live command output: real adapter status/busy-state/agent-state probe against existing Paseo agent
A Paseo Codex worker reporting native working remains classified busy despite unchanged logs ⏸️ untested no The prior payload used an executable native-status seam rather than driving a newly created real task, so it did not establish a live product result.
A Paseo native error status is not treated as healthy idle ⏸️ untested no The prior payload used an executable status seam rather than inspecting a real failed agent, so it did not establish a live product result.
Paseo task creation preserves repeated environment values and secret-safe env-file transport; stop/archive control contracts work ⏸️ untested no The prior payload only recorded a stub CLI test, so it did not establish a live product result.
End-to-end Firstmate Paseo spawn, exit, and teardown against a disposable real task ⏸️ untested no The required disposable Paseo task would intentionally create external provider-owned state/worktree data outside the assigned worktree. Provide an authorized disposable Paseo home/workspace contained…
  • bash tests/fm-backend-paseo.test.sh
  • bash tests/fm-backend.test.sh
  • bash tests/fm-control.test.sh
  • bash tests/fm-teardown-endpoint-safety.test.sh
  • paseo daemon status
  • . bin/fm-backend.sh; fm_backend_source paseo; fm_backend_paseo_provider ...
  • Read-only real Paseo adapter status/busy-state/agent-state/capture probe
  • Executable native-status and error-state adversarial checks
  • git diff --check ...

🔧 Fix applied.
2 errors still open:

  • 🚨 bin/fm-control.sh:499 - The live Paseo exit path calls native stop/archive functions without sourcing the Paseo adapter, causing undefined-command failure.
  • 🚨 live validation verdict: no-go (4 of 6 scenarios were driven live against the product); failed: Exit via native stop/status proof with archive fallback
  • Live validation: ❌ no-go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Spawn a disposable Paseo OpenCode worker with isolated identities ✅ pass live Live Paseo spawn transcript and task metadata
Send text and observe native Paseo task status ✅ pass live Live fm-send.sh plus Paseo inspect/log output
Consume native status before Codex gating and keep liveness unverified ⏸️ untested no The prior payload cited only automated test files and explicitly recorded live=false, so it did not establish a live product result.
Preserve repeated env values and secret-safe env-file transport ⏸️ untested no The prior payload cited only an automated test file and explicitly recorded live=false, so it did not establish a live product result.
Exit via native stop/status proof with archive fallback ❌ fail live Live fm-control.sh live-probe exit transcript
Teardown and archive the disposable Paseo task/workspace ✅ pass live Live fm-teardown.sh live-probe --force transcript
  • tests/fm-backend-paseo.test.sh
  • tests/fm-busy-state.test.sh
  • tests/fm-control.test.sh
  • tests/fm-backend.test.sh
  • tests/fm-control-relaunch.test.sh
  • paseo --version && paseo daemon status
  • isolated real fm-spawn.sh --backend paseo
  • isolated real fm-send.sh
  • isolated real fm-control.sh ... exit
  • isolated real fm-teardown.sh ... --force

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Adapter maps supported providers, rejects unavailable Claude, preserves env transport, and keeps liveness unverified. ⏸️ untested no The prior payload cited a test command but recorded live=false, so it did not establish a live product result.
A running Paseo worker is classified busy from native status. ✅ pass live Live fm_busy_classify paseo ... returned busy paseo-native for a real running Codex task.
Unsupported providers are rejected before creating a Paseo agent. ✅ pass live Live bin/fm-spawn.sh ... --harness gemini --backend paseo rejected before agent creation.
Firstmate creates a root Codex Paseo worker with recorded agent/workspace identities and an isolated worktree. ✅ pass live Live fm-spawn.sh plus paseo inspect, paseo logs, and paseo workspace ls.
Exit proves native stop, then teardown archives the agent and workspace. ✅ pass live Live fm-control.sh ... exit followed by fm-teardown.sh ... --force; final inspect showed closed/archived and no workspaces.
Repeated environment values use secret-safe Paseo transport and control contracts remain intact. ⏸️ untested no The prior payload cited test commands but recorded live=false, so it did not establish a live product result.
  • bash tests/fm-backend-paseo.test.sh
  • bash tests/fm-busy-state.test.sh
  • bash tests/fm-control.test.sh
  • paseo daemon status
  • isolated real bin/fm-spawn.sh ... --harness codex --backend paseo
  • live fm_busy_classify paseo ...
  • live bin/fm-control.sh live-slow exit
  • live bin/fm-teardown.sh live-slow --force
  • live unsupported-provider spawn rejection
  • final worktree cleanup and status check
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

A confirmed critical bug archives every successfully spawned Paseo worker on exit, plus additional lifecycle/isolation issues and untested paths in a large high-risk backend integration, warranting human review.

Review effort: Balanced
Findings: None

What changed in this PR

This PR adds an experimental, explicit-only Paseo runtime backend so firstmate can dispatch crewmates through the Paseo CLI (paseo run/paseo send). Paseo owns both the agent endpoint and the isolated task worktree, maps Codex/OpenCode (and host-diagnostic-gated Claude) to providers, records paseo_agent_id/paseo_workspace_id, polls native status for busy classification, keeps liveness unverified, and archives the agent and workspace during teardown. It plugs into the existing backend dispatch (fm-backend.sh), spawn, control, busy-state, teardown, and bootstrap layers, alongside broad documentation updates.

Changes:

  • New adapter bin/backends/paseo.sh plus dispatch/registration in bin/fm-backend.sh (known/spawn sets, capture/send/kill/busy/agent-state, required-tools, metadata validation).
  • Spawn/control/teardown integration: worktree-owning spawn path, native stop/status control with archive fallback, and Paseo-aware root teardown; native-status precedence in fm-busy-lib.sh.
  • Documentation and verification updates across README and docs/*, plus contract tests.
File Description
bin/​backends/​paseo.sh New Paseo adapter (provider map, create-task, status/busy, stop/archive, send/kill).
bin/​fm-spawn.sh Worktree-owning Paseo spawn path, abort cleanup, env-file transport, relaunch handling.
bin/​fm-control.sh Sources Paseo adapter; native stop/status exit and relaunch readiness.
bin/​fm-control-lib.sh Paseo key/state capability table entries.
bin/​fm-busy-lib.sh Native Paseo busy-state precedence before the Codex gate.
bin/​fm-backend.sh Known/spawn sets, dispatch, required tools, endpoint metadata validation.
bin/​fm-teardown.sh Root Paseo worktree/agent archive path and paseo-env cleanup.
bin/​fm-bootstrap.sh /​ fm-supervise-daemon.sh Backend-list/comment updates.
docs/​*, README.md Backend docs, configuration, architecture, verification, audiences.
tests/​fm-backend-paseo.test.sh, fm-control.test.sh, fm-busy-state.test.sh Contract tests for adapter, control route, native busy precedence.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ryannmicua

Copy link
Copy Markdown
Owner Author

Superseded by #5, which carries this work rebuilt on a fresh branch and has been merged.

@ryannmicua ryannmicua closed this Sep 28, 2026
@ryannmicua
ryannmicua deleted the fm/paseo-backend-adapter branch September 28, 2026 21:27
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.

3 participants