From 59799f551cd978eb0e1c061cdb47d1fae87c3ef6 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 6 Jan 2026 23:57:46 -0800 Subject: [PATCH] fix(doctor): only cycle patrol roles on --fix, not crew/polecats (hq-qthgye) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/doctor/claude_settings_check.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/doctor/claude_settings_check.go b/internal/doctor/claude_settings_check.go index 6bcc6d9a..d1bb77cf 100644 --- a/internal/doctor/claude_settings_check.go +++ b/internal/doctor/claude_settings_check.go @@ -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) + } } }