Agent → Watchdog supervision (Layer A4) — should it live in the agent, the watchdog, or somewhere else? #854
Replies: 3 comments
-
|
@bdunncompany — spinning up a Project board for this so the close-out work + your A4 proposal land in one place: Watchdog Supervision (Discussion #854) Seeded 14 tracks. Three things stand out as blocking before code: 1. Where A4 lives (your direct question). I'm leaning (b) scoped reading — agent goroutine for v1, with the explicit caveat that the agent-supervises-watchdog goroutine is narrowly scoped to "is the sibling service in Stopped state? if so, Start it." Not config repair, not restart-from-disabled, no growing scope into general process supervision. The Layer B "main agent is unreliable" constraint argues against putting reliability-critical logic in the agent in general; but A4 isn't reliability-critical for the watchdog — it's a best-effort self-heal, the watchdog still works without it. Worst case A4 fails silently and we fall back to the operator noticing. I'd want to draw a hard line: A4 doesn't grow. If we ever need supervision of OTHER sidecars (helper, broker, future PAM broker, future ZTNA gateway), that's a separate design conversation — see the "Design doc: should A4 grow into a generic sidecar supervisor?" item on the board. 2. The GPO-disabled gap. Your discussion explicitly calls out the case neither A4 nor #853 closes — SCM refuses to start a Disabled service, and A4 only does
I'd defer for now and document the gap. GPO-disable is an active misconfiguration; expecting silent self-repair invites surprises for the admin who did it on purpose. But if you have an opinion either way, say. 3. Linux/macOS A4. Your proposal makes A4 Windows-only since launchd/systemd already supervise. That's right for the stopped case, but neither covers If the answers above match your read, please rebase Also relevant on the board:
Direction approved on the discussion's core question. Schema/server pieces are unblocked; A4 implementation is unblocked pending your sign-off on the scope above. |
Beta Was this translation helpful? Give feedback.
-
|
Direction agreed on all three scope constraints — A4 stays narrowly bounded (Stopped/Paused → |
Beta Was this translation helpful? Give feedback.
-
|
Closing — #860 landed 2026-05-26 implementing direction (b) from this discussion (agent-side |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
#852 closed the watchdog-restarts-agent direction (Layer B): watchdog catches stale heartbeat → restart
BreezeAgent→ verify recovery → escalate to FAILOVER on 5+ restarts/24h.The spec for that work explicitly scoped out the inverse direction:
That makes sense for the wedged-main-agent case. But there's a sibling failure mode the watchdog can't catch by itself: the watchdog gets stopped while the main agent is healthy.
Failure modes #852 does NOT cover
sc stop BreezeWatchdogduring maintenance and forgets to start itsc configgets set to Disabled by a misapplied GPOThe "Disabled by GPO" + "manually stopped" cases are real for managed-endpoint fleets. The watchdog itself can't recover from being stopped — by definition.
Proposal (Layer A4)
A Windows-only goroutine inside
startAgent(agent/cmd/breeze-agent/main.go) that:BreezeWatchdogservice via SCMStoppedorPausedstate → callss.Start()*PendingtransientsshutdownAgentwritesShutdownIntent, so a clean stop doesn't race a supervisor-driven restartbreeze-watchdogat the OS level)Conservative by design:
s.Start()on a stopped servicerecovery_test.go(fake SCM controller, no realsvc.mgrin tests)The philosophical question
This puts watchdog supervision inside the main agent. The Layer B spec said "the main agent is unreliable; we fix this in the watchdog." Two ways to read that:
(a) Strict reading: nothing reliability-critical should live in the main agent, period. Then Layer A4 should live in a third process (or maybe in
breeze-watchdogitself, monitoring its own re-arm path — though that's circular).(b) Scoped reading: that constraint applies specifically to fixing main-agent wedges. Supervising a sibling service is a different concern — if main agent is healthy enough to talk to SCM, it's healthy enough to supervise the watchdog.
I read (b), and the code is written that way. But if Todd reads (a) and wants this in
breeze-watchdoginstead, that's a real difference. Posting here before sending a PR.What's already written (local branch)
fix/agent-watchdog-supervisionon my fork, one commit (fc3bf7de):agent/cmd/breeze-agent/main.go— registers supervisor goroutine instartAgent, cancels inshutdownAgentagent/cmd/breeze-agent/watchdog_supervisor_windows.go— Windows SCM logicagent/cmd/breeze-agent/watchdog_supervisor_other.go— Linux/macOS no-opagent/cmd/breeze-agent/watchdog_supervisor_windows_test.go— seam-based tests via fake SCMCan rebase + file as a PR within 10 min if the direction is agreed. Happy to redirect it into
breeze-watchdogif that's the call.Beta Was this translation helpful? Give feedback.
All reactions