fix(handoff): recognize polecat session pattern gt-<rig>-<name> (#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 <townRoot>/<rig>/polecats/<name>. Fixes: gm-lie6 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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-<rig>-<name> -> <townRoot>/<rig>/polecats/<name>
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user