Skip to content

Commit 5b49cc4

Browse files
StingNingningding97Takhoffman
authored
fix(cron): notify user when cron job is auto-disabled after repeated errors (#29098) thanks @ningding97
Verified: - pnpm install --frozen-lockfile - pnpm check - pnpm test -- --run src/cron/service.runs-one-shot-main-job-disables-it.test.ts Co-authored-by: ningding97 <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
1 parent 504c1f3 commit 5b49cc4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Docs: https://docs.openclaw.ai
7777

7878
### Fixes
7979

80+
- Cron/Schedule errors: notify users when a job is auto-disabled after repeated schedule computation failures. (#29098) Thanks .
81+
- Cron/Schedule errors: notify users when a job is auto-disabled after repeated schedule computation failures. (#29098) Thanks .
8082
- Onboarding/Custom providers: raise default custom-provider model context window to the runtime hard minimum (16k) and auto-heal existing custom model entries below that threshold during reconfiguration, preventing immediate `Model context window too small (4096 tokens)` failures. (#21653) Thanks @r4jiv007.
8183
- Web UI/Assistant text: strip internal `<relevant-memories>...</relevant-memories>` scaffolding from rendered assistant messages (while preserving code-fence literals), preventing memory-context leakage in chat output for models that echo internal blocks. (#29851) Thanks @Valkster70.
8284
- Dashboard/Sessions: allow authenticated Control UI clients to delete and patch sessions while still blocking regular webchat clients from session mutation RPCs, fixing Dashboard session delete failures. (#21264) Thanks @jskoiz.

src/cron/service/jobs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ function recordScheduleComputeError(params: {
208208
{ jobId: job.id, name: job.name, errorCount, err: errText },
209209
"cron: auto-disabled job after repeated schedule errors",
210210
);
211+
212+
// Notify the user so the auto-disable is not silent (#28861).
213+
const notifyText = `⚠️ Cron job "${job.name}" has been auto-disabled after ${errorCount} consecutive schedule errors. Last error: ${errText}`;
214+
state.deps.enqueueSystemEvent(notifyText, {
215+
agentId: job.agentId,
216+
sessionKey: job.sessionKey,
217+
contextKey: `cron:${job.id}:auto-disabled`,
218+
});
219+
state.deps.requestHeartbeatNow({
220+
reason: `cron:${job.id}:auto-disabled`,
221+
agentId: job.agentId,
222+
sessionKey: job.sessionKey,
223+
});
211224
} else {
212225
state.deps.log.warn(
213226
{ jobId: job.id, name: job.name, errorCount, err: errText },

0 commit comments

Comments
 (0)