You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b742909
Browse filesBrowse the repository at this point in the historyBrowse files
- Browser/profiles: reject remote browser profile `cdpUrl` values that violate strict SSRF policy before saving config, with clearer validation errors for blocked endpoints. (#60477) Thanks @eleqtrizit.
199
199
- Browser/screenshots: stop sending `fromSurface: false` on CDP screenshots so managed Chrome 146+ browsers can capture images again. (#60682) Thanks @mvanhorn.
200
200
- Mattermost/slash commands: harden native slash-command callback token validation to use constant-time secret comparison, matching the existing interaction-token path.
201
+
- Agents/scheduling: route delayed follow-up requests toward cron only when cron is actually available, while keeping background `exec`/`process` guidance scoped to work that starts now. (#60811) Thanks @vincentkoc.
201
202
- Cron/security: reject unsafe custom `sessionTarget: "session:..."` IDs earlier during cron add, update, and execution so malformed custom session keys fail closed with clear errors.
"Execute shell commands with background continuation. Use yieldMs/background to continue later via process tool. Use pty=true for TTY-required commands (terminal UIs, coding agents).";
"For long waits, avoid rapid poll loops: use exec with enough yieldMs or process(action=poll, timeout=<ms>).",
122
+
'For follow-up at a future time (for example "check back in 10 minutes", reminders, run-later work, or recurring tasks), use cron instead of exec sleep, yieldMs delays, or process polling.',
123
+
);
124
+
expect(prompt).toContain(
125
+
"Use exec/process only for commands that start now and continue running in the background.",
126
+
);
127
+
expect(prompt).toContain(
128
+
"Do not emulate scheduling with sleep loops, timeout loops, or repeated polling.",
123
129
);
124
130
expect(prompt).toContain("You have no independent goals");
125
131
expect(prompt).toContain("Prioritize safety and human oversight");
"For long waits, avoid rapid poll loops: use exec with enough yieldMs or process(action=poll, timeout=<ms>).",
296
+
'For follow-up at a future time (for example "check back in 10 minutes", reminders, run-later work, or recurring tasks), use cron instead of exec sleep, yieldMs delays, or process polling.',
297
+
);
298
+
expect(prompt).toContain(
299
+
"Use exec/process only for commands that start now and continue running in the background.",
291
300
);
292
301
expect(prompt).toContain("Completion is push-based: it will auto-announce when done.");
293
302
expect(prompt).toContain("Do not poll `subagents list` / `sessions_list` in a loop");
"Run shell commands (pty available for TTY-required CLIs; use for work that starts now, not delayed follow-ups)";
248
+
constprocessToolSummary=
249
+
"Manage background exec sessions for commands already started";
250
+
constcronToolSummary=
251
+
"Manage cron jobs and wake events (use for reminders, delayed follow-ups, and recurring tasks; for requests like 'check back in 10 minutes' or 'remind me later', use cron instead of exec sleep, yieldMs delays, or process polling; when scheduling a reminder, write the systemEvent text as something that will read like a reminder when it fires, and mention that it is a reminder depending on the time gap between setting and firing; include recent context in reminder text if appropriate)";
246
252
constcoreToolSummaries: Record<string,string>={
247
253
read: "Read file contents",
248
254
write: "Create or overwrite files",
@@ -251,15 +257,15 @@ export function buildAgentSystemPrompt(params: {
251
257
grep: "Search file contents for patterns",
252
258
find: "Find files by glob pattern",
253
259
ls: "List directory contents",
254
-
exec: "Run shell commands (pty available for TTY-required CLIs)",
255
-
process: "Manage background exec sessions",
260
+
exec: execToolSummary,
261
+
process: processToolSummary,
256
262
web_search: "Search the web",
257
263
web_fetch: "Fetch and extract readable content from a URL",
258
264
// Channel docking: add login tools here when a channel needs interactive linking.
259
265
browser: "Control web browser",
260
266
canvas: "Present/eval/snapshot the Canvas",
261
267
nodes: "List/describe/notify/camera/screen on paired nodes",
262
-
cron: "Manage cron jobs and wake events (use for reminders; when scheduling a reminder, write the systemEvent text as something that will read like a reminder when it fires, and mention that it is a reminder depending on the time gap between setting and firing; include recent context in reminder text if appropriate)",
268
+
cron: cronToolSummary,
263
269
message: "Send messages and channel actions",
264
270
gateway: "Restart, apply config, or run updates on the running OpenClaw process",
265
271
agents_list: acpSpawnRuntimeEnabled
@@ -347,7 +353,9 @@ export function buildAgentSystemPrompt(params: {
"- browser: control OpenClaw's dedicated browser",
459
467
"- canvas: present/eval/snapshot the Canvas",
460
468
"- nodes: list/describe/notify/camera/screen on paired nodes",
461
-
"- cron: manage cron jobs and wake events (use for reminders; when scheduling a reminder, write the systemEvent text as something that will read like a reminder when it fires, and mention that it is a reminder depending on the time gap between setting and firing; include recent context in reminder text if appropriate)",
469
+
`- cron: ${cronToolSummary.toLowerCase()}`,
462
470
"- sessions_list: list sessions",
463
471
"- sessions_history: fetch session history",
464
472
"- sessions_send: send to another session",
465
473
"- subagents: list/steer/kill sub-agent runs",
466
474
'- session_status: show usage/time/model state and answer "what model are we using?"',
467
475
].join("\n"),
468
476
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
469
-
`For long waits, avoid rapid poll loops: use ${execToolName} with enough yieldMs or ${processToolName}(action=poll, timeout=<ms>).`,
477
+
...(hasCronTool
478
+
? [
479
+
`For follow-up at a future time (for example "check back in 10 minutes", reminders, run-later work, or recurring tasks), use cron instead of ${execToolName} sleep, yieldMs delays, or ${processToolName} polling.`,
480
+
`Use ${execToolName}/${processToolName} only for commands that start now and continue running in the background.`,
481
+
"Do not emulate scheduling with sleep loops, timeout loops, or repeated polling.",
482
+
]
483
+
: [
484
+
`For long waits, avoid rapid poll loops: use ${execToolName} with enough yieldMs or ${processToolName}(action=poll, timeout=<ms>).`,
485
+
]),
470
486
"If a task is more complex or takes longer, spawn a sub-agent. Completion is push-based: it will auto-announce when done.",
0 commit comments