Fix witness session parsing in categorizeSession

Witness sessions use format gt-witness-<rig> but categorizeSession was
parsing them as gt-<rig>-<type>, incorrectly setting Rig="witness".
This caused the mayor status line to count "witness" as a third rig.

Added special case to handle gt-witness-<rig> format before the generic
rig-level parsing. Also updated tests to cover both actual and legacy formats.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-21 23:07:52 -08:00
parent 53d9d7349d
commit 19fd7e05b2
2 changed files with 13 additions and 2 deletions

View File

@@ -99,6 +99,13 @@ func categorizeSession(name string) *AgentSession {
return session
}
// Witness sessions use different format: gt-witness-<rig>
if strings.HasPrefix(suffix, "witness-") {
session.Type = AgentWitness
session.Rig = strings.TrimPrefix(suffix, "witness-")
return session
}
// Rig-level agents: gt-<rig>-<type> or gt-<rig>-crew-<name>
parts := strings.SplitN(suffix, "-", 2)
if len(parts) < 2 {