feat(heartbeat): re-apply heartbeat protocol improvements from v2026.3.1#2257
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
…3.1 (#2206) Re-apply upstream heartbeat protocol improvements that were lost during PR #2191 wholesale restoration of heartbeat-runner.ts. Changes re-applied: - ackMaxChars configuration — configurable max chars for heartbeat ack responses, preventing verbose acks from flooding channels - HEARTBEAT.md file gating — skip heartbeat when file is effectively empty, with bypass for exec/cron/wake events and ENOENT handling - HEARTBEAT_TOKEN structured protocol — heartbeat OK uses structured token instead of raw text, paired with stripHeartbeatToken extraction - buildOutboundSessionContext — session-aware outbound delivery for heartbeat-originated messages - Exec fallback text — better exec-completion handling when token stripping empties the response - HeartbeatSkipReason type — typed skip reasons for heartbeat skip reporting - stripLeadingHeartbeatResponsePrefix — regex boundary fix preventing short prefixes like "Hi" from stripping words like "History" Intentionally NOT re-applied (gutted subsystem code): - bootstrapContextMode / lightContext (Pi bootstrap) - includeReasoning / resolveHeartbeatReasoningPayloads (Pi reasoning) - resolveHeartbeatPrompt signature change (deferred to #2194) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Re-applies upstream heartbeat protocol improvements from v2026.3.1 that were lost during PR #2191 wholesale restoration of
heartbeat-runner.ts. Closes #2206.Changes re-applied:
HEARTBEAT_OK) instead of raw text, paired withstripHeartbeatTokenextractionIntentionally NOT re-applied (gutted subsystem code):
bootstrapContextMode/lightContext(Pi bootstrap context)includeReasoning/resolveHeartbeatReasoningPayloads(Pi reasoning payloads)resolveHeartbeatPromptsignature change (deferred to Restore heartbeat file-based prompt resolution and workspace dir #2194)All dependency modules verified to exist before importing.
Test plan
🤖 Generated with Claude Code