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 6f2e804
Browse filesBrowse the repository at this point in the historyBrowse files
fix(agents): prefer background completion wake over polling (#60877)
* fix(agents): prefer completion wake over polling
* fix(changelog): note completion wake guidance
* fix(agents): qualify quiet exec completion wake
* fix(agents): qualify disabled exec completion wake
* fix(agents): split process polling from control actions
- Gateway/auth: serialize async shared-secret auth attempts per client so concurrent Tailscale-capable failures cannot overrun the intended auth rate-limit budget. Thanks @Telecaster2147.
98
98
- Doctor/config: compare normalized `talk` configs by deep structural equality instead of key-order-sensitive serialization so `openclaw doctor --fix` stops repeatedly reporting/applying no-op `talk.provider/providers` normalization. (#59911) Thanks @ejames-dev.
99
99
- Gateway/device auth: reuse cached device-token scopes only for cached-token reconnects, while keeping explicit `deviceToken` scope requests and empty-cache fallbacks intact so reconnects preserve `operator.read` without breaking explicit auth flows. (#46032) Thanks @caicongyang.
100
+
- Agents/scheduling: steer background-now work toward automatic completion wake and treat `process` polling as on-demand inspection or intervention instead of default completion handling. (#60877) Thanks @vincentkoc.
100
101
- Google Gemini CLI auth: improve OAuth credential discovery across Windows nvm and Homebrew libexec installs, and align Code Assist metadata so Gemini login stops failing on packaged CLI layouts. (#40729) Thanks @hughcube.
101
102
- Mattermost/config schema: accept `groups.*.requireMention` again so existing Mattermost configs no longer fail strict validation after upgrade. (#58271) Thanks @MoerAI.
102
103
- Agents/failover: scope Anthropic `An unknown error occurred` failover matching by provider so generic internal unknown-error text no longer triggers retryable timeout fallback. (#59325) Thanks @aaron-he-zhu.
"Execute shell commands with background continuation for work that starts now.",
1121
1121
"Use yieldMs/background to continue later via process tool.",
1122
+
"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.",
1122
1123
params?.hasCronTool
1123
1124
? "Do not use exec sleep or delay loops for reminders or deferred follow-ups; use cron instead."
"Use poll/log when you need status, logs, quiet-success confirmation, or completion confirmation when automatic completion wake is unavailable. Use write/send-keys/submit/paste/kill for input or intervention.",
123
124
params?.hasCronTool
124
125
? "Do not use process polling to emulate timers or reminders; use cron for scheduled follow-ups."
"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.",
420
+
);
421
+
expect(processWithCron.description).toContain(
422
+
"completion confirmation when automatic completion wake is unavailable.",
423
+
);
424
+
expect(processWithCron.description).toContain(
425
+
"Use write/send-keys/submit/paste/kill for input or intervention.",
426
+
);
418
427
expect(execWithCron.description).toContain(
419
428
"Do not use exec sleep or delay loops for reminders or deferred follow-ups; use cron instead.",
"Use exec/process only for commands that start now and continue running in the background.",
126
126
);
127
+
expect(prompt).toContain(
128
+
"For long-running work that starts now, start it once and rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use process to confirm completion, and use it for logs, status, input, or intervention.",
129
+
);
127
130
expect(prompt).toContain(
128
131
"Do not emulate scheduling with sleep loops, timeout loops, or repeated polling.",
"Use exec/process only for commands that start now and continue running in the background.",
297
300
);
301
+
expect(prompt).toContain(
302
+
"For long-running work that starts now, start it once and rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use process to confirm completion, and use it for logs, status, input, or intervention.",
303
+
);
298
304
expect(prompt).toContain("Completion is push-based: it will auto-announce when done.");
299
305
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="Manage background exec sessions for commands already started";
247
+
"Run shell commands (pty available for TTY-required CLIs; use for work that starts now, not delayed follow-ups; background completion may wake automatically when enabled)";
248
+
constprocessToolSummary=
249
+
"Manage background exec sessions for commands already started (poll/log for inspection, debugging, input, intervention, or completion confirmation when auto-wake is unavailable)";
249
250
constcronToolSummary=
250
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)";
251
252
constcoreToolSummaries: Record<string,string>={
@@ -477,10 +478,12 @@ export function buildAgentSystemPrompt(params: {
477
478
? [
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.`,
479
480
`Use ${execToolName}/${processToolName} only for commands that start now and continue running in the background.`,
481
+
`For long-running work that starts now, start it once and rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use ${processToolName} to confirm completion, and use it for logs, status, input, or intervention.`,
480
482
"Do not emulate scheduling with sleep loops, timeout loops, or repeated polling.",
481
483
]
482
484
: [
483
485
`For long waits, avoid rapid poll loops: use ${execToolName} with enough yieldMs or ${processToolName}(action=poll, timeout=<ms>).`,
486
+
`For long-running work that starts now, start it once and rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use ${processToolName} to confirm completion, and use it for logs, status, input, or intervention.`,
484
487
]),
485
488
"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