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

@@ -51,6 +51,8 @@ async function withHeartbeatFixture(
);
};
await fs.writeFile(path.join(tmpDir, "HEARTBEAT.md"), "- Check status\n", "utf-8");
try {
return await run({ tmpDir, storePath, seedSession });
} finally {
@@ -136,7 +138,7 @@ describe("runHeartbeatOnce heartbeat model override", () => {
});
it("passes per-agent heartbeat model override (merged with defaults)", async () => {
await withHeartbeatFixture(async ({ storePath, seedSession }) => {
await withHeartbeatFixture(async ({ tmpDir, storePath, seedSession }) => {
const cfg: OpenClawConfig = {
agents: {
defaults: {
@@ -149,6 +151,7 @@ describe("runHeartbeatOnce heartbeat model override", () => {
{ id: "main", default: true },
{
id: "ops",
workspace: tmpDir,
heartbeat: {
every: "5m",
target: "whatsapp",