Skip to content

Cron: apply timeout to startup catch-up runs#23966

Merged
Takhoffman merged 2 commits intomainfrom
fix-cron-startup-catchup-timeout
Feb 22, 2026
Merged

Cron: apply timeout to startup catch-up runs#23966
Takhoffman merged 2 commits intomainfrom
fix-cron-startup-catchup-timeout

Conversation

@Takhoffman
Copy link
Copy Markdown
Contributor

@Takhoffman Takhoffman commented Feb 22, 2026

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Startup catch-up executions in runMissedJobs bypassed cron timeout handling.
  • Why it matters: A stuck startup catch-up run could block catch-up completion indefinitely.
  • What changed: Startup catch-up now uses executeJobCoreWithTimeout(...), and a regression test verifies timeout/abort behavior.
  • What did NOT change (scope boundary): No schedule semantics, retry backoff policy, or delivery behavior changes.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #

User-visible / Behavior Changes

  • Cron startup catch-up isolated runs now honor timeoutSeconds the same way timer/manual runs do.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 22+, Vitest
  • Model/provider: N/A (test harness)
  • Integration/channel (if any): N/A
  • Relevant config (redacted): default test cron config

Steps

  1. Add an isolated one-shot cron job due at startup with timeoutSeconds: 0.01.
  2. Execute startup catch-up path (runMissedJobs).
  3. Assert the abort signal is observed and job ends in timeout error state.

Expected

  • Startup catch-up run times out and records error state.

Actual

  • Verified: run is aborted and timeout error is recorded.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: Ran pnpm -s vitest run src/cron/service.issue-regressions.test.ts in /Users/thoffman/openclaw-wt-cron-1.
  • Edge cases checked: Startup catch-up timeout-specific regression added and passing.
  • What you did not verify: Full-suite cron tests and multi-channel live integrations.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert this commit/PR.
  • Files/config to restore: src/cron/service/timer.ts, src/cron/service.issue-regressions.test.ts.
  • Known bad symptoms reviewers should watch for: Startup catch-up runs not timing out.

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk:
    • Mitigation: Regression coverage ensures startup catch-up follows existing timeout path.

Greptile Summary

This PR fixes a bug where startup catch-up executions in runMissedJobs bypassed cron timeout handling. The fix ensures that startup catch-up runs now use executeJobCoreWithTimeout(...) instead of executeJobCore(...), applying the same timeout behavior as timer and manual runs. The change is minimal and focused, with a comprehensive regression test that verifies the timeout abort signal is properly observed during startup catch-up.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple one-line fix replacing executeJobCore with executeJobCoreWithTimeout in the startup catch-up path. The implementation is already proven in the timer and manual execution paths. The regression test comprehensively validates the timeout behavior with real abort signal verification. No breaking changes to existing behavior.
  • No files require special attention

Last reviewed commit: 5ca52cb

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR docs Improvements or additions to documentation channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling size: XL and removed size: XS labels Feb 22, 2026
@Takhoffman Takhoffman force-pushed the fix-cron-startup-catchup-timeout branch from 813bb07 to 8ac52ba Compare February 22, 2026 22:51
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime labels Feb 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling size: XL labels Feb 22, 2026
@Takhoffman Takhoffman merged commit 73e5bb7 into main Feb 22, 2026
26 checks passed
@Takhoffman Takhoffman deleted the fix-cron-startup-catchup-timeout branch February 22, 2026 23:04
@Takhoffman
Copy link
Copy Markdown
Contributor Author

Merged via autoland after rebasing onto main and re-running verification.

Local verification:

  • pnpm build
  • pnpm check
  • pnpm test:macmini

Pinned merge head:

  • 8ac52badb7fe9092aaa9ddde71bcc5465e11de00

carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
gabrielkoo pushed a commit to gabrielkoo/openclaw that referenced this pull request Feb 23, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* Cron: apply timeout to startup catch-up runs

* Changelog: add cron startup timeout catch-up note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant