fix(heartbeat): default target none and internalize relay prompts

This commit is contained in:
Peter Steinberger
2026-02-25 00:33:32 +00:00
parent 4d89548e59
commit e2362d352d
9 changed files with 191 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { buildCronEventPrompt, buildExecEventPrompt } from "./heartbeat-events-filter.js";
describe("heartbeat event prompts", () => {
it("builds user-relay cron prompt by default", () => {
const prompt = buildCronEventPrompt(["Cron: rotate logs"]);
expect(prompt).toContain("Please relay this reminder to the user");
});
it("builds internal-only cron prompt when delivery is disabled", () => {
const prompt = buildCronEventPrompt(["Cron: rotate logs"], { deliverToUser: false });
expect(prompt).toContain("Handle this reminder internally");
expect(prompt).not.toContain("Please relay this reminder to the user");
});
it("builds internal-only exec prompt when delivery is disabled", () => {
const prompt = buildExecEventPrompt({ deliverToUser: false });
expect(prompt).toContain("Handle the result internally");
expect(prompt).not.toContain("Please relay the command output to the user");
});
});