Repository navigation
feat(orchestration): let users choose the worker heartbeat interval - #34071
Conversation
Dispatched workers are told to send a heartbeat every 5 minutes. A new "Worker heartbeats" switch under Settings > Agent Orchestration (on by default) lets users turn that off: newly dispatched workers are no longer told to send heartbeats, and the stale-heartbeat check is skipped. The interval the brief states and the stale check both derive from one resolver over the live setting, read from the runtime's own store like the other orchestration settings.
While worker heartbeats are on, Settings > Agent Orchestration now shows a "Heartbeat interval" field (1-60 minutes, default 5). Newly dispatched workers are told to check in at that interval, and the stale-heartbeat check uses twice it. The description explains the tradeoff: shorter gives more frequent check-ins and more messages, longer gives fewer messages and longer gaps. Out-of-range or malformed values fall back to 5, both when saved and when read. Both heartbeat settings now live in a settings group owned by the heartbeat module, composed into GlobalSettings like other feature groups.
673e786 to
b3a2350
Compare
…le' into brennanb2025/orch-heartbeat-interval # Conflicts: # src/renderer/src/components/settings/OrchestrationPane.test.tsx
|
Workers were always told to check in every five minutes. This adds a 1–60 minute interval in Settings → Orchestration while Worker heartbeats is on, keeping five minutes for existing profiles. The interval is indented beneath its parent switch using the existing child-setting treatment. Newly dispatched workers receive the chosen cadence; running workers keep their delivered brief. The copy explains more messages versus longer gaps without promising automatic stall detection. The full review converged in two passes with no production defects or open P0/P1 findings. Tests-only Final CI is green on
For Brennan's review: the screenshot shows the interval nested beneath Worker heartbeats. The main judgment points are the shared bounds/fallback, store normalization, and conditional child interval. |
|
No actionable comments were generated in the recent review.
|

Builds on the heartbeat on/off switch from merged #34070. This PR now targets main and contains only the interval change and its focused verification tests.
Problem
Dispatched orchestration workers are told to send a heartbeat every 5 minutes, and that number is fixed. Users who want quieter coordinators, or more frequent check-ins, can't change it.
Change
While Worker heartbeats is on, Settings → Agent Orchestration shows a Heartbeat interval field: whole minutes, 1–60, default 5. It's hidden while heartbeats are off.
src/shared/orchestration-heartbeat.ts, composed intoGlobalSettingsthroughglobal-settings-base.tslike other feature groups (the settings types file was at its line cap).Plan
Same design as #34070: one resolver over the live setting feeds every brief and the stale check. No saved field beyond the optional setting, and no wire change.
Testing
orchestration-heartbeat.test.ts: missing value → 5; chosen value used only while on; 0, 61, 2.5 and NaN fall back to 5.preamble.test.ts: brief states the chosen interval.OrchestrationPane.test.tsx: interval hidden while off; shows 5 by default; committing 15 savesorchestrationHeartbeatIntervalMinutes: 15; settings search finds "interval". The existing nested-depth "no max" check is now scoped to that input.Ran six named suites through the local test gate: 116 tests passed. Localization catalogs verified.
Real Store upgrade/save/reopen contract: profiles lacking both heartbeat settings retain 5 minutes; a saved interval of 15 survives reopen; raw 61 normalizes to 5 and persists that value.
The existing real CLI argv dispatch contract covers off and 15 minutes using the same setup, and checks the returned brief equals the delivered brief.
Real stale-query contract with interval 15: 11 and 30-minute-old heartbeats do not warn; 31 minutes warns at the 30-minute cutoff and leaves the task dispatched.
Full review completed without production fixes; the follow-up commit adds tests only. The final main merge after feat(orchestration): add a Settings switch to turn worker heartbeats off #34070 landed preserves the reviewed heartbeat behavior; its conflict resolutions were checked independently.
Branch-only Settings screenshot passed; no real-agent QA round is required for these settings/orchestration flows.