feat(daemon): respect rig operational state for auto-start
Update daemon to check rig config before auto-starting agents: - Check wisp config "status" - skip if parked or docked - Check "auto_restart" config - skip if blocked or false - Log skip reason for visibility Affects ensureWitnessRunning, ensureRefineryRunning, restartPolecatSession, and lifecycle restartSession. (gt-68c46) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -339,6 +339,15 @@ func (d *Daemon) restartSession(sessionName, identity string) error {
|
||||
return fmt.Errorf("parsing identity: %w", err)
|
||||
}
|
||||
|
||||
// Check rig operational state for rig-level agents (witness, refinery, crew, polecat)
|
||||
// Town-level agents (mayor, deacon) are not affected by rig state
|
||||
if parsed.RigName != "" {
|
||||
if operational, reason := d.isRigOperational(parsed.RigName); !operational {
|
||||
d.logger.Printf("Skipping session restart for %s: %s", identity, reason)
|
||||
return fmt.Errorf("cannot restart session: %s", reason)
|
||||
}
|
||||
}
|
||||
|
||||
// Determine working directory
|
||||
workDir := d.getWorkDir(config, parsed)
|
||||
if workDir == "" {
|
||||
|
||||
Reference in New Issue
Block a user