fix(handoff): use correct witness working directory (#444)

The witness role doesn't have a /rig worktree like the refinery does.
The handoff command was trying to cd to <rig>/witness/rig which doesn't
exist, causing the respawned pane to fail immediately and the session
to die.

Changed witness workdir from <rig>/witness/rig to <rig>/witness.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Julian Knutsen
2026-01-13 21:39:55 +00:00
committed by GitHub
parent 65c5e05c43
commit 1453b8b592

View File

@@ -442,10 +442,11 @@ func sessionWorkDir(sessionName, townRoot string) (string, error) {
return "", fmt.Errorf("cannot parse crew session name: %s", sessionName)
case strings.HasSuffix(sessionName, "-witness"):
// gt-<rig>-witness -> <townRoot>/<rig>/witness/rig
// gt-<rig>-witness -> <townRoot>/<rig>/witness
// Note: witness doesn't have a /rig worktree like refinery does
rig := strings.TrimPrefix(sessionName, "gt-")
rig = strings.TrimSuffix(rig, "-witness")
return fmt.Sprintf("%s/%s/witness/rig", townRoot, rig), nil
return fmt.Sprintf("%s/%s/witness", townRoot, rig), nil
case strings.HasSuffix(sessionName, "-refinery"):
// gt-<rig>-refinery -> <townRoot>/<rig>/refinery/rig