Expand description
Agent process watchdog: kills agent panes that exceed max-runtime or idle-output limits.
Runs every 60 seconds and inspects every running agent: PTY agent panes and the persistent, subprocess, ACP, MSP and App Server controllers. Two independent kill conditions:
A) term:agentmaxruntimehours — wall-clock runtime since spawn (0 = disabled)
B) term:agentidletimeoutmins — minutes without output (0 = disabled).
A PTY pane is idle whenever its PTY is quiet. Any other agent is idle
only while a turn is in flight and no question waits for the user:
between turns, or on a question, the agent is waiting for the user,
not stuck.
Both limits default to 0 (disabled) so the watchdog is opt-in.
Functions§
- run_
watchdog_ loop - Run the agent watchdog loop. Never returns.