Skip to content

Restore heartbeat file-based prompt resolution and workspace dir #2194

@alexey-pelykh

Description

@alexey-pelykh

Problem

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

What's missing

  1. HeartbeatSchema (src/config/zod-schema.agent-runtime.ts) — needs file: z.string().optional()
  2. HeartbeatConfig type — needs file?: string
  3. src/auto-reply/heartbeat.tsresolveHeartbeatPrompt needs to accept { prompt, file, workspaceDir } and resolve file-based prompts
  4. src/infra/heartbeat-runner.ts — needs resolveAgentWorkspaceDir import and to pass { prompt, file, workspaceDir } to resolveHeartbeatPrompt

Pre-B3 reference

git show fdcbc3bd86~1:src/auto-reply/heartbeat.ts
git show fdcbc3bd86~1:src/infra/heartbeat-runner.ts

These have the correct file-based resolution. The restoration was blocked by compound type errors — HeartbeatSchema and heartbeat.ts both need updating simultaneously.

Context

Found during PR #2191 remediation. The heartbeat-runner was restored from pre-B3 but the surrounding heartbeat infrastructure (schema, type, resolver) was still in B3/B4 state without file support, causing 10 type errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions