fix(heartbeat): honor top-level heartbeat.enabled=false setting#276
Open
ZVNC28 wants to merge 1 commit intoTinyAGI:mainfrom
Open
fix(heartbeat): honor top-level heartbeat.enabled=false setting#276ZVNC28 wants to merge 1 commit intoTinyAGI:mainfrom
ZVNC28 wants to merge 1 commit intoTinyAGI:mainfrom
Conversation
The Settings type declared heartbeat.enabled only at the per-agent level (AgentConfig.heartbeat.enabled). A top-level heartbeat.enabled flag in settings.json was silently ignored, and startHeartbeat() was called unconditionally in packages/main/src/index.ts, so users had no way to disable the heartbeat interval globally without editing every agent entry. - Add optional top-level heartbeat.enabled to the Settings interface - Add isHeartbeatEnabled() helper in heartbeat.ts - Short-circuit startHeartbeat() and tick() when the flag is false - Log a clear "Heartbeat disabled" message on startup when skipped Default behavior is unchanged (flag undefined = enabled).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
Settingstype declaredheartbeat.enabledonly at the per-agent level (AgentConfig.heartbeat.enabled). A top-levelheartbeat.enabledflag insettings.jsonwas silently ignored, andstartHeartbeat()was called unconditionally inpackages/main/src/index.ts:272, so users had no way to disable the heartbeat interval globally without editing every agent entry.This came up in practice running an 8-agent team against a single shared inference backend: every hour, all 8 heartbeats fire concurrently and serialize through the same GPU, creating a large backlog. The natural workaround —
heartbeat: { enabled: false }at the top ofsettings.json— compiled fine (TypeScript didn't complain because the field wasn't in the type) but did nothing at runtime.Changes
heartbeat?: { enabled?: boolean }to theSettingsinterface inpackages/core/src/types.tsisHeartbeatEnabled()helper inpackages/main/src/heartbeat.tsstartHeartbeat()when disabled, logging a clear"Heartbeat disabled (heartbeat.enabled=false in settings)"message instead of silently still creating the intervaltick()as a safety net, so runtime config changes take effect without a daemon restartDefault behavior is unchanged — when the flag is undefined (the common case), heartbeat continues to run exactly as before. Per-agent
agent.heartbeat.enabledremains fully supported.Testing
npm run build— clean compile, no new warningsheartbeat: { enabled: false }at the top level now logs"Heartbeat disabled"on daemon start and the interval is never createdChecklist
heartbeat.enabled; happy to add a note to the README if you'd prefer