Summary
bin/fm-spawn.sh refuses to launch a crewmate when the project is registered as a symlink
under projects/<name> that points at a real repo elsewhere on disk. treehouse actually
creates a correct isolated worktree, but fm-spawn's worktree-entry detection mis-fires and the
isolation guard then (correctly) refuses — with an error that blames treehouse.
Root cause
PROJ_ABS is computed as cd "$dir" && pwd (symlink-preserving), e.g.
.../projects/tkt-env. The launch template cds the pane into that path, then fm-spawn waits
for the pane's reported cwd to change away from $PROJ_ABS:
for _ in $(seq 1 60); do
p=$(spawn_current_path "$T" ...)
if [ -n "$p" ] && [ "$p" != "$PROJ_ABS" ]; then WT="$p"; break; fi
...
But the pane reports its resolved cwd (the symlink's real target, e.g.
/Users/me/repos/tkt-env), which already != $PROJ_ABS on the very first poll — before
treehouse get has entered a worktree. So WT is set to the repo root, and
validate_spawn_worktree refuses with:
error: treehouse get did not yield an isolated worktree (resolved '<repo-root>';
worktree root '<repo-root>'; primary '<symlink-path>'); refusing to launch ...
The message points at treehouse, but treehouse worked; the real cause is the symlink/realpath
mismatch in the cwd-change heuristic.
Reproduction
ln -s /abs/path/to/repo projects/myrepo
bin/fm-spawn.sh task-x projects/myrepo → refuses (blames treehouse).
bin/fm-spawn.sh task-x /abs/path/to/repo → works cleanly.
Impact
Registering an existing live repo (rather than a fresh clone under projects/) via the
natural projects/<name> symlink is silently broken, and the error misattributes the failure
to treehouse.
Suggested fixes (any one)
- Canonicalize
PROJ_ABS with pwd -P so it matches the pane's resolved cwd, and/or
- Compare resolved paths in the cwd-change loop (
realpath/pwd -P both sides), and/or
- Document that a live repo must be registered by absolute path, not a
projects/ symlink.
🤖 Claude Code · claude-opus-4-8 · 2026-07-15
Summary
bin/fm-spawn.shrefuses to launch a crewmate when the project is registered as a symlinkunder
projects/<name>that points at a real repo elsewhere on disk. treehouse actuallycreates a correct isolated worktree, but fm-spawn's worktree-entry detection mis-fires and the
isolation guard then (correctly) refuses — with an error that blames treehouse.
Root cause
PROJ_ABSis computed ascd "$dir" && pwd(symlink-preserving), e.g..../projects/tkt-env. The launch templatecds the pane into that path, then fm-spawn waitsfor the pane's reported cwd to change away from
$PROJ_ABS:But the pane reports its resolved cwd (the symlink's real target, e.g.
/Users/me/repos/tkt-env), which already!= $PROJ_ABSon the very first poll — beforetreehouse gethas entered a worktree. SoWTis set to the repo root, andvalidate_spawn_worktreerefuses with:The message points at treehouse, but treehouse worked; the real cause is the symlink/realpath
mismatch in the cwd-change heuristic.
Reproduction
ln -s /abs/path/to/repo projects/myrepobin/fm-spawn.sh task-x projects/myrepo→ refuses (blames treehouse).bin/fm-spawn.sh task-x /abs/path/to/repo→ works cleanly.Impact
Registering an existing live repo (rather than a fresh clone under
projects/) via thenatural
projects/<name>symlink is silently broken, and the error misattributes the failureto treehouse.
Suggested fixes (any one)
PROJ_ABSwithpwd -Pso it matches the pane's resolved cwd, and/orrealpath/pwd -Pboth sides), and/orprojects/symlink.