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
HeartbeatSchema (src/config/zod-schema.agent-runtime.ts) — needs file: z.string().optional()
HeartbeatConfig type — needs file?: string
src/auto-reply/heartbeat.ts — resolveHeartbeatPrompt needs to accept { prompt, file, workspaceDir } and resolve file-based prompts
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.
Problem
The heartbeat system lost file-based prompt resolution during workspace cleanup (WI-179) and DIFF-SYNC. Pre-B3,
resolveHeartbeatPromptaccepted{ 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
HeartbeatSchema(src/config/zod-schema.agent-runtime.ts) — needsfile: z.string().optional()HeartbeatConfigtype — needsfile?: stringsrc/auto-reply/heartbeat.ts—resolveHeartbeatPromptneeds to accept{ prompt, file, workspaceDir }and resolve file-based promptssrc/infra/heartbeat-runner.ts— needsresolveAgentWorkspaceDirimport and to pass{ prompt, file, workspaceDir }toresolveHeartbeatPromptPre-B3 reference
These have the correct file-based resolution. The restoration was blocked by compound type errors —
HeartbeatSchemaandheartbeat.tsboth 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
filesupport, causing 10 type errors.