fix(doctor): only cycle patrol roles on --fix, not crew/polecats (hq-qthgye)

gt doctor --fix was killing all sessions with stale settings, including
crew and polecats that cannot auto-recover. Now only kills patrol roles
(witness, refinery, deacon, mayor) which the daemon will restart.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-06 23:57:46 -08:00
committed by beads/crew/dave
parent 85d1e783b0
commit 59799f551c

View File

@@ -326,12 +326,15 @@ func (c *ClaudeSettingsCheck) Fix(ctx *CheckContext) error {
continue
}
// Check if agent has a running session
running, _ := t.HasSession(sf.sessionName)
if running {
// Cycle the agent by killing and letting gt up restart it
// (or the daemon will restart it)
_ = t.KillSession(sf.sessionName)
// Only cycle patrol roles that can auto-recover (daemon restarts them).
// Crew and polecats are spawned on-demand and won't auto-restart.
if sf.agentType == "witness" || sf.agentType == "refinery" ||
sf.agentType == "deacon" || sf.agentType == "mayor" {
running, _ := t.HasSession(sf.sessionName)
if running {
// Cycle the agent by killing and letting gt up restart it
_ = t.KillSession(sf.sessionName)
}
}
}