mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 23:32:54 +00:00
fix(heartbeat): default target none and internalize relay prompts
This commit is contained in:
21
src/infra/heartbeat-events-filter.test.ts
Normal file
21
src/infra/heartbeat-events-filter.test.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user