Skip to content

fix(scheduler): the boot banner described heartbeats as if they all run - #986

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/heartbeat-banner-names-optin
Aug 18, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
fix/heartbeat-banner-names-optin

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The line

- Agent heartbeats run every 10 minutes with per-agent intervals

True about the dispatcher, silent about the gate. Since #800 the gate is the dominant fact about heartbeats: heartbeatEnabled !== true returns at schedulerService.ts:1023, before the interval is ever resolved — so an install that never opted in has no interval, no tick, and no cost. 166 of 245 active installs across 48 owners were found ticking hourly on the old default, each spending its owner's own model quota.

Every other line in that banner describes a job that simply runs. This one described a job that mostly does not, in the same voice.

Why now

It cost something today, in this repo, inside an hour.

@sprint-review read the line, went to resolveHeartbeatIntervalMinutes (default 60, not the 10 the banner implies), and computed a fleet heartbeat range of ~88–530 wakes over 22h across 4 seats — a number wide enough to change what a separate ADR claim was asserting. It was wrong for a reason the arithmetic could not reveal: resolveHeartbeatIntervalMinutes is not called until :1042, downstream of a gate none of those seats pass. They verified it and retracted on #974 (issuecomment-5325966029).

The retraction is durable. The sentence that produced it would have gone on producing it — which is the failure this repo has already logged as "a fix to a false model must land where the model is produced, not where it was diagnosed" (AX audit entry 13).

The change

- Agent heartbeats dispatch every 10 minutes; only installs with
  config.heartbeat.enabled === true fire, each on its own interval
  (config.heartbeat.everyMinutes, default 60)

Names the cadence, the gate, the per-install interval, and its default — the four things the old line invited a reader to go and guess at.

Test

Added to schedulerService.heartbeatOptIn.test.js, which already defends the undefined vs true distinction — the banner is the operator-facing half of the same invariant.

It asserts on the source text rather than by invoking start(), which schedules real cron jobs. It matches the gate's field name rather than the wording, so a rephrase stays green and a re-simplification back to "heartbeats run" goes red. It carries a control assertion (10 minutes) so a slice that captured nothing cannot pass as a match — an empty string satisfies no toContain and looks identical to a correct one otherwise.

Confirmed red against the old banner line before being kept. 5/5 in the file, no new tsc errors.

🤖 Generated with Claude Code

`- Agent heartbeats run every 10 minutes with per-agent intervals` is
true about the dispatcher and silent about the gate. Since #800 the gate
is the dominant fact: `heartbeatEnabled !== true` returns before anything
else, so an install that never opted in has no interval, no tick, and no
cost. 166 of 245 active installs were found ticking on the old default.

Every other line in that banner describes a job that simply runs. This
one described a job that mostly does not, in the same voice.

It cost something today. @sprint-review read the line, went to
`resolveHeartbeatIntervalMinutes` (default 60), and computed a fleet wake
range of ~88-530 over 22h — off a field never reached for these seats.
They retracted it on #974 within the hour. The retraction is durable; the
sentence that produced it would have gone on producing it.

The banner now names the gate, the per-install interval, and its default.

Test asserts the gate's field name is present, on the source text rather
than by invoking start() (which schedules real cron). Matching the name
rather than the wording keeps a rephrase green and a re-simplification
red, and it carries a control so an empty slice cannot pass as a match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lilyshen0722
lilyshen0722 merged commit 2ea94ce into main Aug 18, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/heartbeat-banner-names-optin branch August 18, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant