From 94c25a29815e0968f51a18193c3c9587d12035d2 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sat, 20 Dec 2025 07:55:54 -0800 Subject: [PATCH] fix(statusline): count only polecats in mayor status bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mayor tmux status line was counting all gt-* sessions as polecats, including witnesses, refineries, deacon, and crew workers. Now uses categorizeSession() to properly identify only actual polecats. Also removes dead code handling gt-witness- pattern (only gt--witness is valid). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/agents.go | 8 -------- internal/cmd/statusline.go | 14 +++++++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/internal/cmd/agents.go b/internal/cmd/agents.go index 25d163fd..af534321 100644 --- a/internal/cmd/agents.go +++ b/internal/cmd/agents.go @@ -99,13 +99,6 @@ func categorizeSession(name string) *AgentSession { return session } - // Witness uses gt-witness- naming - if strings.HasPrefix(suffix, "witness-") { - session.Type = AgentWitness - session.Rig = strings.TrimPrefix(suffix, "witness-") - return session - } - // Rig-level agents: gt-- or gt--crew- parts := strings.SplitN(suffix, "-", 2) if len(parts) < 2 { @@ -125,7 +118,6 @@ func categorizeSession(name string) *AgentSession { // Check for other agent types switch remainder { case "witness": - // Alternate naming gt--witness (for compatibility) session.Type = AgentWitness return session case "refinery": diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go index 266d486a..f50e5f89 100644 --- a/internal/cmd/statusline.go +++ b/internal/cmd/statusline.go @@ -93,17 +93,17 @@ func runMayorStatusLine(t *tmux.Tmux) error { return nil // Silent fail } - // Count gt-* sessions (polecats) and rigs + // Count only actual polecats (not witnesses, refineries, deacon, crew) polecatCount := 0 rigs := make(map[string]bool) for _, s := range sessions { - if strings.HasPrefix(s, "gt-") && s != "gt-mayor" { + agent := categorizeSession(s) + if agent == nil { + continue + } + if agent.Type == AgentPolecat { polecatCount++ - // Extract rig name: gt-- - parts := strings.SplitN(s, "-", 3) - if len(parts) >= 2 { - rigs[parts[1]] = true - } + rigs[agent.Rig] = true } } rigCount := len(rigs)