From 956f8cc5f033a25e86dfd481ade0b550f0ca2e4d Mon Sep 17 00:00:00 2001 From: Tanwa Arpornthip <72845369+CommanderCrowCode@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:36:14 +0700 Subject: [PATCH] fix(handoff): recognize polecat session pattern gt-- (#373) sessionWorkDir had cases for mayor, deacon, crew, witness, and refinery but not polecats. When gt handoff was run from a polecat session like gt-tanwa_info-slit, it failed with "unknown session type". Fix uses session.ParseSessionName to parse the session name and extract rig/name for polecat sessions, mapping to //polecats/. Fixes: gm-lie6 Co-authored-by: Claude Opus 4.5 --- internal/cmd/handoff.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/cmd/handoff.go b/internal/cmd/handoff.go index bde0c400..023fc838 100644 --- a/internal/cmd/handoff.go +++ b/internal/cmd/handoff.go @@ -444,7 +444,16 @@ func sessionWorkDir(sessionName, townRoot string) (string, error) { return fmt.Sprintf("%s/%s/refinery/rig", townRoot, rig), nil default: - return "", fmt.Errorf("unknown session type: %s (try specifying role explicitly)", sessionName) + // Assume polecat: gt-- -> //polecats/ + // Use session.ParseSessionName to determine rig and name + identity, err := session.ParseSessionName(sessionName) + if err != nil { + return "", fmt.Errorf("unknown session type: %s (%w)", sessionName, err) + } + if identity.Role != session.RolePolecat { + return "", fmt.Errorf("unknown session type: %s (role %s, try specifying role explicitly)", sessionName, identity.Role) + } + return fmt.Sprintf("%s/%s/polecats/%s", townRoot, identity.Rig, identity.Name), nil } }