Skip to content

feat: smart heartbeat with state-diffing#545

Open
c2keesey wants to merge 1 commit intoasheshgoplani:mainfrom
c2keesey:feat/smart-heartbeat
Open

feat: smart heartbeat with state-diffing#545
c2keesey wants to merge 1 commit intoasheshgoplani:mainfrom
c2keesey:feat/smart-heartbeat

Conversation

@c2keesey
Copy link
Copy Markdown

@c2keesey c2keesey commented Apr 8, 2026

Summary

  • Adds heartbeat_smart config option to [conductor] settings that makes heartbeat scripts compare session states before firing
  • When enabled, heartbeat only wakes the conductor when session states have actually changed, avoiding redundant check-ins when everything is stable
  • Includes migration support: MigrateConductorHeartbeatScripts respects the setting and can upgrade/downgrade existing scripts

How it works

The smart heartbeat script snapshots all session title:status pairs (excluding the conductor itself), compares against the previous snapshot stored in .heartbeat-state, and only proceeds with the heartbeat send if something changed.

Config

[conductor]
heartbeat_smart = true  # default: false

Test plan

  • 7 new unit tests covering template content, managed script detection, config defaults, profile flag handling
  • All existing conductor tests pass
  • Full binary builds successfully

🤖 Generated with Claude Code

Adds a `heartbeat_smart` config option that makes the heartbeat script
compare session states before firing. When enabled, heartbeat only sends
a check-in to the conductor when session states have actually changed,
avoiding redundant wake-ups when everything is stable.

- New `conductorSmartHeartbeatScript` template with state-diffing logic
- `InstallHeartbeatScript` accepts optional smart flag
- `MigrateConductorHeartbeatScripts` respects the global setting
- Setup command passes smart flag and shows "(smart)" in output
- 7 new tests covering templates, detection, and config defaults

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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