You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(pm-stack): stack sentinel flaps on single probe timeouts — paging Drew for load spikes #9049
Drew is being paged by PM-stack "front-end fails" that are not failures. The stack sentinel (pm-stack/aggregator/scripts/stack-sentinel.ts) flips a service to down on a single failed probe and posts the transition to the alert throat; the aggregator's notification engine then pages on the resulting stack-health candidate whenever the 6h cooldown has lapsed.
Diagnosis (2026-11-12, live laptop state):
~/.local/state/pm-aggregator/notifications.jsonl: 433 notification events today, 30 sent. service:projector alone: 118 events, 4 sent; service:opencode flapped the same way.
pm-projector.servicenever crashed — active (running) since 2026-11-10, same PID. What fails is the probe: probe failed: The operation timed out (3s probe timeout) while the laptop sits at load average 8–10 under the fleet burn. One slow probe → down; next round answers → recovered; repeat.
The projector itself is fine; the health signal cries wolf under load.
Fix
Flap damping in the sentinel:
A service flips to down (for state + notification purposes) only after 3 consecutive failed probes at the 30s cadence (~90s of continuous failure). A single failed probe never flips state and never posts.
Probe timeouts for the 3s probes (projector, kaneo, dispatch, opencode, queue-broker) raised to 10s so a slow-but-alive service under load answers in time (aggregator's /board probe already uses 15s).
A recovery transition is only ever posted after the corresponding down was actually posted (the postedState bookkeeping already guarantees this; the damping keeps it true — a blip that never became a posted down produces no recovery).
The first-sighting baseline is amended to match: a failed first probe now starts the failure streak instead of posting an immediate down (a genuinely down service is still declared after 3 probes, ~90s after sentinel start).
health:fleet-feed also sent 4 pushes today but is a different mechanism — a 5-minute feed-staleness window in src/health.ts, not a single-probe flip — and is deliberately out of scope here.
Ordered by Drew, main chat 2026-11-12: "Tune the health check so load spikes stop paging me." Follow-up to #8568 (Phase 1, closed).
Tests: 12/12 new oracle tests pass; neighboring suites (alerts, notifications, health, preferences, section-risk, projector, watchdog) 133 pass — the only failures are the known environmental server-boot flakes (5s hook timeouts under load, one port-4871 bind conflict with the live aggregator), unrelated to this change. No tsc errors in touched files.
Deploy:pm-stack-sentinel.service restarted 2026-11-12 22:06:09Z (new PID 1978485) on the merged code. Deploy note: the primary checkout is 38+ commits behind main and pm-git-sync is failing on another change's uncommitted .opencode/opencode.jsonc dirt (left untouched); the three merged files were checked out from origin/main byte-identical into the primary, so the running code is exactly main's.
Observation window (~13 min post-restart, 5 samples):notifications.jsonl 1065 → 1065 lines (zero new events, zero sends); all six services up at every sample; the aggregator's stack-health.json recorded no transitions; zero transition posts in the sentinel journal; /board, /api/attention.json, /api/quota.json all 200 before and after.
Honest caveat: laptop load fell during the window (8–10 → ~3–6.5) and no probe timed out at a sampled round, so the window demonstrates zero paging and stable state, while the blip-absorption behavior itself is pinned by the unit tests rather than a captured live blip.
health:fleet-feed was left as-is per the issue scope (different mechanism: 5-minute feed-staleness window).
Activity
developing-today commentedon Nov 12, 2026
CODE-2765
Merge pull request #9053 from developing-today/fix/sentinel-flap-damp…
developing-today-fleet commentedon Nov 12, 2026
Fixed and verified live.
ba12d12d— newsrc/sentinel-damping.tsfold (3 consecutive failed probes beforedown; recovery only after a posted down; legacy state entries migrated at load), sentinel probes folded through it, probe timeouts 3s → 10s (aggregator stays 15s).pm-stack-sentinel.servicerestarted 2026-11-12 22:06:09Z (new PID 1978485) on the merged code. Deploy note: the primary checkout is 38+ commits behind main andpm-git-syncis failing on another change's uncommitted.opencode/opencode.jsoncdirt (left untouched); the three merged files were checked out fromorigin/mainbyte-identical into the primary, so the running code is exactly main's.notifications.jsonl1065 → 1065 lines (zero new events, zero sends); all six servicesupat every sample; the aggregator'sstack-health.jsonrecorded no transitions; zero transition posts in the sentinel journal; /board, /api/attention.json, /api/quota.json all 200 before and after.health:fleet-feedwas left as-is per the issue scope (different mechanism: 5-minute feed-staleness window).