fix: skip heartbeat when HEARTBEAT.md does not exist (#20461)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: f6e5f8172a
Co-authored-by: vikpos <24960005+vikpos@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
vikpos
2026-02-19 06:09:33 +00:00
committed by GitHub
parent 48e6b4fca3
commit f855d0be4f
11 changed files with 456 additions and 56 deletions

View File

@@ -45,6 +45,7 @@ export async function withTempHeartbeatSandbox<T>(
},
): Promise<T> {
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), options?.prefix ?? "openclaw-hb-"));
await fs.writeFile(path.join(tmpDir, "HEARTBEAT.md"), "- Check status\n", "utf-8");
const storePath = path.join(tmpDir, "sessions.json");
const replySpy = vi.spyOn(replyModule, "getReplyFromConfig");
const previousEnv = new Map<string, string | undefined>();