Repository navigation
feat(backends): add Paseo runtime backend - #1
ryannmicua wants to merge 11 commits into
Conversation
…unused capture helper
…x gating and rejected native error as idle
There was a problem hiding this comment.
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.shplus dispatch/registration inbin/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.
|
Superseded by #5, which carries this work rebuilt on a fresh branch and has been merged. |
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 withenv -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
paseo run/paseo send, provider mapping for Codex/OpenCode and diagnostic-gated Claude, labeled root agents, provider-owned worktrees, and persisted agent/workspace metadata.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.
fm_busy_classify paseo ...returnedbusy paseo-nativefor a real running Codex task.bin/fm-spawn.sh ... --harness gemini --backend paseorejected before agent creation.fm-spawn.shpluspaseo inspect,paseo logs, andpaseo workspace ls.fm-control.sh ... exitfollowed byfm-teardown.sh ... --force; final inspect showed closed/archived and no workspaces.Evidence: Live Paseo lifecycle evidence
Evidence: Unsupported provider evidence
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-spawn.sh:2844- A successful Paseo spawn is archived by the unconditional EXIT cleanup:PASEO_DIRECT=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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,” butfm_backend_paseo_captureonly prepends status text to diagnostic logs atbin/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 implementspaseo stopatbin/backends/paseo.sh:101-105, but interrupt rejects Paseo becausefm_control_backend_supports_keyomits it (bin/fm-control-lib.sh:199-209), exit rejects it becausefm_control_backend_state_verifiedomits it (bin/fm-control-lib.sh:217-221, called atbin/fm-control.sh:477), and relaunch rejects it atbin/fm-spawn.sh:1605-1607. The new absence branch is also a no-op using unset$keyatbin/fm-control-lib.sh:283-285, while the docs explicitly preserve the rejection atdocs/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 onlyFM_TASK_ID,FIRSTMATE_HOME, andFIRSTMATE_STATEatbin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated--envatbin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards atbin/fm-spawn.sh:3968andbin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated--envarguments as required.bin/backends/paseo.sh:123- The change introduces two unused parallel backend surfaces,fm_backend_paseo_list_liveandfm_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=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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,” butfm_backend_paseo_captureonly prepends status text to diagnostic logs atbin/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 onlyFM_TASK_ID,FIRSTMATE_HOME, andFIRSTMATE_STATEatbin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated--envatbin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards atbin/fm-spawn.sh:3968andbin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated--envarguments as required.bin/backends/paseo.sh:123- The change introduces two unused parallel backend surfaces,fm_backend_paseo_list_liveandfm_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 ambientPASEO_WORKSPACE_IDatbin/fm-spawn.sh:2838. On a fresh spawn,bin/fm-spawn.sh:2870then passes it tobin/backends/paseo.sh:53-55, which uses--workspaceinstead of creating a new isolated worktree.env -u PASEO_AGENT_IDdoes 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, butpaseo run --workspacereturns agent data withoutworkspaceIdand reportsUsing workspace ..., while the parser only accepts JSON workspace fields orCreated workspace ...atbin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test attests/fm-backend-paseo.test.sh:39-41cannot catch this because its stub emitsCreated workspaceeven for--workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.bin/backends/paseo.sh:102- Paseo's nativeerrorstatus is converted toidleatbin/backends/paseo.sh:102; the watcher then returnsidle paseo-nativeatbin/fm-busy-lib.sh:1055, and stop proof accepts it atbin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, includingerror, atbin/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 documentserroras a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.tsbin/fm-spawn.sh:2859- The latest fix round reads allowlisted environment values and appends them as literal--env KEY=valuearguments atbin/fm-spawn.sh:2854-2859, then invokes Paseo atbin/fm-spawn.sh:2870. With an allowlist such asOPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract atdocs/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 addsfm_backend_paseo_visible_captureatbin/backends/paseo.sh:126-129, but Paseo is intentionally absent fromFM_BACKEND_VISIBLE_CAPTUREand 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=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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,” butfm_backend_paseo_captureonly prepends status text to diagnostic logs atbin/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 onlyFM_TASK_ID,FIRSTMATE_HOME, andFIRSTMATE_STATEatbin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated--envatbin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards atbin/fm-spawn.sh:3968andbin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated--envarguments as required.bin/backends/paseo.sh:123- The change introduces two unused parallel backend surfaces,fm_backend_paseo_list_liveandfm_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 ambientPASEO_WORKSPACE_IDatbin/fm-spawn.sh:2838. On a fresh spawn,bin/fm-spawn.sh:2870then passes it tobin/backends/paseo.sh:53-55, which uses--workspaceinstead of creating a new isolated worktree.env -u PASEO_AGENT_IDdoes 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, butpaseo run --workspacereturns agent data withoutworkspaceIdand reportsUsing workspace ..., while the parser only accepts JSON workspace fields orCreated workspace ...atbin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test attests/fm-backend-paseo.test.sh:39-41cannot catch this because its stub emitsCreated workspaceeven for--workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.bin/backends/paseo.sh:102- Paseo's nativeerrorstatus is converted toidleatbin/backends/paseo.sh:102; the watcher then returnsidle paseo-nativeatbin/fm-busy-lib.sh:1055, and stop proof accepts it atbin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, includingerror, atbin/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 documentserroras a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.tsbin/fm-spawn.sh:2859- The latest fix round reads allowlisted environment values and appends them as literal--env KEY=valuearguments atbin/fm-spawn.sh:2854-2859, then invokes Paseo atbin/fm-spawn.sh:2870. With an allowlist such asOPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract atdocs/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 addsfm_backend_paseo_visible_captureatbin/backends/paseo.sh:126-129, but Paseo is intentionally absent fromFM_BACKEND_VISIBLE_CAPTUREand 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 passesFM_PASEO_ENV_FILE=<path>via--env; nothing in this repository or the documentedpaseo runinterface sources that file, so allowlisted credentials/settings silently never reach the worker. The added test attests/fm-backend-paseo.test.sh:45asserts 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-1674deliberately reuses the recorded workspace andbin/fm-spawn.sh:2899-2903setsPASEO_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-3150callsfm_backend_killwith zellij-specific extra arguments, sofm_backend_paseo_killreceives no workspace id; thenbin/fm-teardown.sh:3165-3195returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence isfm-teardown.sh <secondmate> --forcewith 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-envatbin/fm-teardown.sh:3208-3213; the preflight path remains generic atbin/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=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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 onlyFM_TASK_ID,FIRSTMATE_HOME, andFIRSTMATE_STATEatbin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated--envatbin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards atbin/fm-spawn.sh:3968andbin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated--envarguments as required.bin/fm-spawn.sh:2838- The latest fix round inherits ambientPASEO_WORKSPACE_IDatbin/fm-spawn.sh:2838. On a fresh spawn,bin/fm-spawn.sh:2870then passes it tobin/backends/paseo.sh:53-55, which uses--workspaceinstead of creating a new isolated worktree.env -u PASEO_AGENT_IDdoes 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, butpaseo run --workspacereturns agent data withoutworkspaceIdand reportsUsing workspace ..., while the parser only accepts JSON workspace fields orCreated workspace ...atbin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test attests/fm-backend-paseo.test.sh:39-41cannot catch this because its stub emitsCreated workspaceeven for--workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.bin/backends/paseo.sh:102- Paseo's nativeerrorstatus is converted toidleatbin/backends/paseo.sh:102; the watcher then returnsidle paseo-nativeatbin/fm-busy-lib.sh:1055, and stop proof accepts it atbin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, includingerror, atbin/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 documentserroras a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.tsbin/fm-spawn.sh:2859- The latest fix round reads allowlisted environment values and appends them as literal--env KEY=valuearguments atbin/fm-spawn.sh:2854-2859, then invokes Paseo atbin/fm-spawn.sh:2870. With an allowlist such asOPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract atdocs/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-1674deliberately reuses the recorded workspace andbin/fm-spawn.sh:2899-2903setsPASEO_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-3150callsfm_backend_killwith zellij-specific extra arguments, sofm_backend_paseo_killreceives no workspace id; thenbin/fm-teardown.sh:3165-3195returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence isfm-teardown.sh <secondmate> --forcewith 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-envatbin/fm-teardown.sh:3208-3213; the preflight path remains generic atbin/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 atbin/fm-busy-lib.sh:1027-1029, so statusworkingnever reaches the new branch atbin/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 passesGOTMPDIR=/tmp/fm-$ID/gotmpto asynchronouspaseo run --backgroundatbin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started atbin/fm-spawn.sh:2902-2903. A worker whose first command isgo testorgo buildcan 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 atbin/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=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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 onlyFM_TASK_ID,FIRSTMATE_HOME, andFIRSTMATE_STATEatbin/fm-spawn.sh:2833-2834, despite the adapter supporting repeated--envatbin/backends/paseo.sh:66; the generated hook/settings and launch-environment setup are skipped by the Paseo guards atbin/fm-spawn.sh:3968andbin/fm-spawn.sh:4647. Configured launch-env values and task-specific settings therefore never reach Paseo workers. Thread the generated values through repeated--envarguments as required.bin/fm-spawn.sh:2838- The latest fix round inherits ambientPASEO_WORKSPACE_IDatbin/fm-spawn.sh:2838. On a fresh spawn,bin/fm-spawn.sh:2870then passes it tobin/backends/paseo.sh:53-55, which uses--workspaceinstead of creating a new isolated worktree.env -u PASEO_AGENT_IDdoes 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, butpaseo run --workspacereturns agent data withoutworkspaceIdand reportsUsing workspace ..., while the parser only accepts JSON workspace fields orCreated workspace ...atbin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test attests/fm-backend-paseo.test.sh:39-41cannot catch this because its stub emitsCreated workspaceeven for--workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.bin/backends/paseo.sh:102- Paseo's nativeerrorstatus is converted toidleatbin/backends/paseo.sh:102; the watcher then returnsidle paseo-nativeatbin/fm-busy-lib.sh:1055, and stop proof accepts it atbin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, includingerror, atbin/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 documentserroras a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.tsbin/fm-spawn.sh:2859- The latest fix round reads allowlisted environment values and appends them as literal--env KEY=valuearguments atbin/fm-spawn.sh:2854-2859, then invokes Paseo atbin/fm-spawn.sh:2870. With an allowlist such asOPENAI_API_KEY, the credential is exposed in the Paseo CLI process argv, contrary to the existing launch-environment contract atdocs/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-1674deliberately reuses the recorded workspace andbin/fm-spawn.sh:2899-2903setsPASEO_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-3150callsfm_backend_killwith zellij-specific extra arguments, sofm_backend_paseo_killreceives no workspace id; thenbin/fm-teardown.sh:3165-3195returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence isfm-teardown.sh <secondmate> --forcewith 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-envatbin/fm-teardown.sh:3208-3213; the preflight path remains generic atbin/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 atbin/fm-busy-lib.sh:1027-1029, so statusworkingnever reaches the new branch atbin/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 passesGOTMPDIR=/tmp/fm-$ID/gotmpto asynchronouspaseo run --backgroundatbin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started atbin/fm-spawn.sh:2902-2903. A worker whose first command isgo testorgo buildcan 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 atbin/fm-spawn.sh:4087-4096.bin/fm-control.sh:375- The f841604 control-path fix made Paseo lifecycle calls reachable, butfm-control.shnever sources the Paseo adapter.wait_paseo_statuscalls the undefinedfm_backend_paseo_status(bin/fm-control.sh:375), anddo_exitcalls undefinedfm_backend_paseo_stop_status_proof/fm_backend_paseo_archive_agent(bin/fm-control.sh:499-502).fm-control.sh <paseo-task> exittherefore fails before stopping or archiving; relaunch fails through the samedo_exitpath. 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_classifyexits asunknown codex-unverifiedatbin/fm-busy-lib.sh:1027-1029, so the native Paseo branch atbin/fm-busy-lib.sh:1051-1055is 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.erroris mapped toidleatbin/backends/paseo.sh:110, so the watcher reportsidle 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, includingerror, throughbin/fm-control.sh:375-379andbin/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/gotmpis passed in the environment atbin/fm-spawn.sh:2851-2857, butpaseo run --backgroundhas already returned only atbin/fm-spawn.sh:2891whenmkdir -pruns atbin/fm-spawn.sh:2902-2903. A worker whose first command isgo testorgo buildcan start before that directory exists and fail. Create the required directory before invokingfm_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 callsfm_backend_killwith the zellij argument shape sofm_backend_paseo_killreceives 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-envfrom recursive artifact cleanup (bin/fm-teardown.sh:3208-3213). A realfm-teardown.sh <secondmate> --forcewith 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 newgemini)Paseo environment branch (bin/fm-spawn.sh:2889) is unreachable because the Paseo provider map rejectsgeminiatbin/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=1atbin/fm-spawn.sh:2844is never cleared, sospawn_abort_cleanupcallsfm_backend_paseo_killatbin/fm-spawn.sh:1223even 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 runaccepts a prompt, butfm_backend_paseo_create_taskappends the brief filepath itself atbin/backends/paseo.sh:67; the worker receives/.../brief.mdas 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 ambientPASEO_WORKSPACE_IDatbin/fm-spawn.sh:2838. On a fresh spawn,bin/fm-spawn.sh:2870then passes it tobin/backends/paseo.sh:53-55, which uses--workspaceinstead of creating a new isolated worktree.env -u PASEO_AGENT_IDdoes 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, butpaseo run --workspacereturns agent data withoutworkspaceIdand reportsUsing workspace ..., while the parser only accepts JSON workspace fields orCreated workspace ...atbin/backends/paseo.sh:76-77. A valid relaunch therefore fails with “did not return ... workspace id.” The added test attests/fm-backend-paseo.test.sh:39-41cannot catch this because its stub emitsCreated workspaceeven for--workspace. Preserve the supplied workspace id or parse the actual existing-workspace response.bin/backends/paseo.sh:102- Paseo's nativeerrorstatus is converted toidleatbin/backends/paseo.sh:102; the watcher then returnsidle paseo-nativeatbin/fm-busy-lib.sh:1055, and stop proof accepts it atbin/backends/paseo.sh:112-113. The relaunch wait path independently accepts any nonempty status, includingerror, atbin/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 documentserroras a lifecycle status: https://github.com/getpaseo/paseo/blob/main/packages/protocol/src/agent-lifecycle.tsbin/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-1674deliberately reuses the recorded workspace andbin/fm-spawn.sh:2899-2903setsPASEO_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-3150callsfm_backend_killwith zellij-specific extra arguments, sofm_backend_paseo_killreceives no workspace id; thenbin/fm-teardown.sh:3165-3195returns or deletes the Paseo-owned worktree through Treehouse/generic removal. A real sequence isfm-teardown.sh <secondmate> --forcewith 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-envatbin/fm-teardown.sh:3208-3213; the preflight path remains generic atbin/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 atbin/fm-busy-lib.sh:1027-1029, so statusworkingnever reaches the new branch atbin/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 passesGOTMPDIR=/tmp/fm-$ID/gotmpto asynchronouspaseo run --backgroundatbin/fm-spawn.sh:2856,2891, but creates that directory only after the worker may already have started atbin/fm-spawn.sh:2902-2903. A worker whose first command isgo testorgo buildcan 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 atbin/fm-spawn.sh:4087-4096.bin/fm-control.sh:375- The f841604 control-path fix made Paseo lifecycle calls reachable, butfm-control.shnever sources the Paseo adapter.wait_paseo_statuscalls the undefinedfm_backend_paseo_status(bin/fm-control.sh:375), anddo_exitcalls undefinedfm_backend_paseo_stop_status_proof/fm_backend_paseo_archive_agent(bin/fm-control.sh:499-502).fm-control.sh <paseo-task> exittherefore fails before stopping or archiving; relaunch fails through the samedo_exitpath. 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_classifyexits asunknown codex-unverifiedatbin/fm-busy-lib.sh:1027-1029, so the native Paseo branch atbin/fm-busy-lib.sh:1051-1055is 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.erroris mapped toidleatbin/backends/paseo.sh:110, so the watcher reportsidle 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, includingerror, throughbin/fm-control.sh:375-379andbin/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/gotmpis passed in the environment atbin/fm-spawn.sh:2851-2857, butpaseo run --backgroundhas already returned only atbin/fm-spawn.sh:2891whenmkdir -pruns atbin/fm-spawn.sh:2902-2903. A worker whose first command isgo testorgo buildcan start before that directory exists and fail. Create the required directory before invokingfm_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 callsfm_backend_killwith the zellij argument shape sofm_backend_paseo_killreceives 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-envfrom recursive artifact cleanup (bin/fm-teardown.sh:3208-3213). A realfm-teardown.sh <secondmate> --forcewith 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, butfm_backend_paseo_provider claudeaccepts it becausepaseo provider diagnostic claudeexits 0 despite semantic unavailability. Gate on semantic provider availability and add a behavioral test.bash tests/fm-backend-paseo.test.shLive Paseo runtime/status/busy/liveness checksReal CLI secret-safe launch refusal checkReal 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 nativeworkingtask is classifiedunknown codex-unverifiedinstead of busy.bin/backends/paseo.sh:115- Paseo nativeerrorstatus is mapped toidle, allowing failed agents to appear healthy and satisfy stop proof.paseo daemon status; real adapter provider callsbash tests/fm-backend-paseo.test.shbash tests/fm-backend.test.shbash tests/fm-control.test.shbash tests/fm-teardown-endpoint-safety.test.shpaseo 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 probeExecutable native-status and error-state adversarial checksgit 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.fm-send.shplus Paseo inspect/log outputfm-control.sh live-probe exittranscriptfm-teardown.sh live-probe --forcetranscripttests/fm-backend-paseo.test.shtests/fm-busy-state.test.shtests/fm-control.test.shtests/fm-backend.test.shtests/fm-control-relaunch.test.shpaseo --version && paseo daemon statusisolated realfm-spawn.sh --backend paseoisolated realfm-send.shisolated realfm-control.sh ... exitisolated realfm-teardown.sh ... --force🔧 Fix applied.
✅ Re-checked - no issues remain.
fm_busy_classify paseo ...returnedbusy paseo-nativefor a real running Codex task.bin/fm-spawn.sh ... --harness gemini --backend paseorejected before agent creation.fm-spawn.shpluspaseo inspect,paseo logs, andpaseo workspace ls.fm-control.sh ... exitfollowed byfm-teardown.sh ... --force; final inspect showed closed/archived and no workspaces.bash tests/fm-backend-paseo.test.shbash tests/fm-busy-state.test.shbash tests/fm-control.test.shpaseo daemon statusisolated realbin/fm-spawn.sh ... --harness codex --backend paseolivefm_busy_classify paseo ...livebin/fm-control.sh live-slow exitlivebin/fm-teardown.sh live-slow --forcelive unsupported-provider spawn rejectionfinal worktree cleanup and status check✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.