diff --git a/src/agents/pi-tools.deferred-followup-guidance.test.ts b/src/agents/pi-tools.deferred-followup-guidance.test.ts index fc1dce427b1..99d7170eb18 100644 --- a/src/agents/pi-tools.deferred-followup-guidance.test.ts +++ b/src/agents/pi-tools.deferred-followup-guidance.test.ts @@ -20,17 +20,25 @@ describe("createOpenClawCodingTools deferred follow-up guidance", () => { const exec = findToolDescription("exec", true); const process = findToolDescription("process", true); - expect(exec.toolNames).toContain("cron"); - expect(exec.description).toContain("use cron instead"); - expect(process.description).toContain("use cron for scheduled follow-ups"); + expect(exec.toolNames).toEqual(["exec", "process", "cron"]); + expect(exec.description).toBe( + "Execute shell commands with background continuation for work that starts now. Use yieldMs/background to continue later via process tool. For long-running work started now, rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use process to confirm completion. Use process whenever you need logs, status, input, or intervention. Do not use exec sleep or delay loops for reminders or deferred follow-ups; use cron instead. Use pty=true for TTY-required commands (terminal UIs, coding agents).", + ); + expect(process.description).toBe( + "Manage running exec sessions for commands already started: list, poll, log, write, send-keys, submit, paste, kill. Use poll/log when you need status, logs, quiet-success confirmation, or completion confirmation when automatic completion wake is unavailable. Use poll/log also for input-wait hints. Use write/send-keys/submit/paste/kill for input or intervention. Do not use process polling to emulate timers or reminders; use cron for scheduled follow-ups.", + ); }); it("drops cron-specific guidance when cron is unavailable", () => { const exec = findToolDescription("exec", false); const process = findToolDescription("process", false); - expect(exec.toolNames).not.toContain("cron"); - expect(exec.description).not.toContain("use cron instead"); - expect(process.description).not.toContain("use cron for scheduled follow-ups"); + expect(exec.toolNames).toEqual(["exec", "process"]); + expect(exec.description).toBe( + "Execute shell commands with background continuation for work that starts now. Use yieldMs/background to continue later via process tool. For long-running work started now, rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use process to confirm completion. Use process whenever you need logs, status, input, or intervention. Use pty=true for TTY-required commands (terminal UIs, coding agents).", + ); + expect(process.description).toBe( + "Manage running exec sessions for commands already started: list, poll, log, write, send-keys, submit, paste, kill. Use poll/log when you need status, logs, quiet-success confirmation, or completion confirmation when automatic completion wake is unavailable. Use poll/log also for input-wait hints. Use write/send-keys/submit/paste/kill for input or intervention.", + ); }); });