Merge: capable-mk3qt4k3 (gt-j44ri) - require --restart-sessions flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
mayor
2026-01-07 00:21:27 -08:00
committed by beads/crew/dave
3 changed files with 24 additions and 17 deletions

View File

@@ -495,14 +495,17 @@ func (c *ClaudeSettingsCheck) Fix(ctx *CheckContext) error {
continue
}
// 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)
// Only cycle patrol roles if --restart-sessions was explicitly passed.
// This prevents unexpected session restarts during routine --fix operations.
// Crew and polecats are spawned on-demand and won't auto-restart anyway.
if ctx.RestartSessions {
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)
}
}
}
}

View File

@@ -38,9 +38,10 @@ func (s CheckStatus) String() string {
// CheckContext provides context for running checks.
type CheckContext struct {
TownRoot string // Root directory of the Gas Town workspace
RigName string // Rig name (empty for town-level checks)
Verbose bool // Enable verbose output
TownRoot string // Root directory of the Gas Town workspace
RigName string // Rig name (empty for town-level checks)
Verbose bool // Enable verbose output
RestartSessions bool // Restart patrol sessions when fixing (requires explicit --restart-sessions flag)
}
// RigPath returns the full path to the rig directory.