Skip to content

fix(heartbeat): restore file-based prompt resolution and workspace dir#2246

Merged
alexey-pelykh merged 1 commit intomainfrom
fix/heartbeat-file-resolution
Apr 10, 2026
Merged

fix(heartbeat): restore file-based prompt resolution and workspace dir#2246
alexey-pelykh merged 1 commit intomainfrom
fix/heartbeat-file-resolution

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Restores the file-based heartbeat prompt resolution that was lost during workspace cleanup (WI-179) and DIFF-SYNC
  • Adds file field to HeartbeatSchema and HeartbeatConfig type so heartbeat prompts can be loaded from a file path relative to the agent workspace
  • Updates resolveHeartbeatPrompt to async with { prompt, file, workspaceDir } options — prompt takes precedence, file is read at runtime, gracefully falls back on missing/empty files
  • Wires resolveAgentWorkspaceDir into the heartbeat-runner prompt resolution pipeline
  • Updates resolveHeartbeatSummaryForAgent to show [file: ...] indicator in the summary when file-based prompt is configured
  • Updates web heartbeat-runner caller for the new async signature

Closes #2194

Test plan

  • Core resolveHeartbeatPrompt tests: empty, whitespace, trimmed prompt, prompt precedence over file, file reading, absolute paths, missing files, empty file content
  • Heartbeat-runner integration tests pass (23 tests)
  • All heartbeat test files pass (47 tests, 1 pre-existing skip)
  • Type-check clean (no new errors in changed files)
  • Lint clean, format clean
  • Pre-commit hook passes (pnpm check green)

🤖 Generated with Claude Code

#2194)

Restore the file-based heartbeat prompt resolution that was lost during
workspace cleanup (WI-179) and DIFF-SYNC. Pre-B3, resolveHeartbeatPrompt
accepted { prompt, file, workspaceDir } and could load prompts from a
file path relative to the agent workspace — the current version only
accepted a raw string.

Changes:
- Add `file` field to HeartbeatSchema and HeartbeatConfig type
- Restore async resolveHeartbeatPrompt with file + workspaceDir support
- Wire resolveAgentWorkspaceDir into heartbeat-runner prompt resolution
- Update resolveHeartbeatSummaryForAgent to show [file: ...] indicator
- Update web heartbeat-runner for new async signature
- Update tests with file-based resolution coverage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 10, 2026 15:44
@alexey-pelykh alexey-pelykh disabled auto-merge April 10, 2026 15:44
@alexey-pelykh alexey-pelykh merged commit be2976a into main Apr 10, 2026
9 checks passed
@alexey-pelykh alexey-pelykh deleted the fix/heartbeat-file-resolution branch April 10, 2026 15:54
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.

Restore heartbeat file-based prompt resolution and workspace dir

1 participant