feat(bin): launch cmux-backed secondmates in dedicated home-cwd workspaces - #3492
Open
Nitsur10 wants to merge 8 commits into
Open
feat(bin): launch cmux-backed secondmates in dedicated home-cwd workspaces#3492Nitsur10 wants to merge 8 commits into
Nitsur10 wants to merge 8 commits into
Conversation
…paces Remove fm-spawn.sh's cmux --secondmate refusal: a secondmate spawn now creates one dedicated cmux workspace whose cwd is the secondmate's home, titled with the launching primary's home label so every primary-side op, recovery, and cleanup verifies unchanged. Orca still refuses. cmux has no recovery-grade agent-state classifier, so a dead cmux secondmate is preserved and reported, never auto-relaunched; documented as an active limit. Adds a full-spawn fake-CLI regression and a guarded fm-test- live smoke case, plus dated live evidence (cmux 0.64.20, 2026-09-01).
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "no-mistakes(review): reclaim per-run tas..." | Re-trigger Greptile |
…ed temp in smoke cleanup Address PR review: resolve an unrecorded fm-test- secondmate workspace by its scoped title before the guarded close so a partial spawn cannot leak it, and remove /tmp/fm-<id> only when this run observed it absent first.
The title-based workspace fallback now adopts only an id absent from a pre-spawn snapshot, so a leftover workspace this run did not create is never closed on a reusable title match alone. The /tmp/fm-<id> temp root is deliberately left in place because no ownership check on a shared /tmp path is free of check-to-delete races.
…rship holds A reusable scoped title left every fallback-close ownership proof exposed to some race: a pre-existing leftover, a transiently failed snapshot read, or a concurrent invocation creating the same title after the snapshot. A per-run unique id removes the shared title entirely, so a live workspace carrying it can only be this run's own spawn, and the snapshot machinery is no longer needed. A crashed run's leftover keeps its own old title and is left open for recoverable by-hand cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable
bin/fm-spawn.sh <id> --secondmate --backend cmuxso a persistent second mate launches in its own dedicated cmux workspace, mirroring the per-home workspace Herdr already provides.What changed
bin/fm-spawn.sh: remove the cmux--secondmaterefusal; a secondmate spawn creates one dedicated workspace whose cwd is the secondmate's home (never a project worktree). The Orca refusal stays.fm-<primary-hometag>-<id>), because the primary owns the task record and performs every send/peek/state/teardown/recovery op with its ownFM_HOME, andfm_backend_cmux_target_readyre-derives the expected title from the caller's home on every op. The2ndmate-<id>label namespace remains what the secondmate's own crewmate workspaces carry. Contract documented inbin/backends/cmux.shand the spawn header (one-owner rule).fm_backend_agent_statereturnsunverified), so a dead cmux secondmate is preserved and reported by the startup liveness sweep, never auto-relaunched;--relaunchremains refused. Documented indocs/cmux-backend.mdinstead of claiming recovery works.bin/fm-remote-secondmate-control.shenforces this independently).Tests
tests/fm-backend-cmux.test.sh: new full-spawn secondmate regression on a subcommand-aware fake cmux CLI, asserting the primary-scoped title, home cwd, and full metadata (backend=cmux, workspace/surface UUIDs,window=,worktree=/home== the secondmate home).tests/fm-backend-cmux-smoke.test.sh: guarded live secondmate spawn against the real app using anfm-test-id, a throwaway seeded home, and the raw-launch-command escape hatch; cleanup only throughtests/cmux-test-safety.sh.docs/verification/runtime-backends.md). Orca secondmate-refuse regression still green;bin/fm-lint.shclean.Docs
docs/cmux-backend.md(new Secondmate launch section, updated active limits),docs/configuration.md,docs/verification/runtime-backends.md, plus stale refusal mentions indocs/architecture.md,docs/remote-secondmates.md, anddocs/trace-context.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01SEApWYsEQrv9oTAr2RwUQq