Repository navigation
fix(cron): bound runs before runner startup and retain cancellation - #188982
Merged
Merged
Conversation
Arm the job wall-clock watchdog before admission and bind marker cancellation directly to its run handle so registry retirement cannot strand an active occurrence. Co-authored-by: steipete <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
roboclaw-bot
marked this pull request as ready for review
October 31, 2026 02:39
roboclaw-bot
enabled auto-merge (squash)
October 31, 2026 02:43
Collaborator
Author
|
Merged via squash auto-merge.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 31, 2026
…penclaw#188982) Arm the job wall-clock watchdog before admission and bind marker cancellation directly to its run handle so registry retirement cannot strand an active occurrence. Co-authored-by: steipete <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #143624, #123419. Adjacent watchdog work: #184460 and #160804.
What Problem This Solves
Fixes: an automation can remain running indefinitely when its runner never reports startup, and disabling it can fail to cancel after run tracking is retired.
User Impact
Finite automation deadlines now cover admission, setup, execution, and delivery. Disabling an active occurrence still cancels its exact runner after registry retirement, allowing another forced run after settlement. Busy-session waits now consume the configured job budget; unlimited jobs remain unlimited. Existing live-work and receipt fences remain in place.
Why This Change Was Made
The deferred watchdog previously armed only its setup timer, which lane waiting clears; the wall-clock timer started only at
noteRunnerStarted. Start that timer at entry instead. Bind marker cancellation directly to its captured handle rather than looking it up in a registry that teardown can clear. This removes the superseded lookup helper and introduces no new state or options.A reported shared-session automation remained running past its 1700-second deadline after a Code Mode bridge error, with no active agent run or terminal cron record. The journal confirms that sequence, but does not establish where its agent promise stopped. The bridge catch already settles its failed reply; this repair targets the independently reproduced cron timeout and cancellation gaps rather than changing recoverable tool-error semantics.
Evidence
298546d88934bf05bc7e208d13bf6ce2c538e3f2. Real cron timer/runner owners with held external runners: both no-start cases fail on base because noTimeoutErroris raised; durable-disable-after-retirement fails because its controller remains un-aborted. Both pass after the fix, with terminaltimed_outhistory, clearedrunningAtMs, and successful forced re-admission after settlement.timeout 150, an explicitOPENCLAW_BUN_PATH,OPENCLAW_VITEST_RUNTIME=bun,node scripts/run-vitest.mjs <file> --maxWorkers=1:timer.timeout-watchdog.test.ts: 10 tests, 11.17 s command wall time.ops.disable-running.test.ts: 1 test, 8.05 s.command-timeout.test.ts: 10 tests, 8.57 s, including real child-process termination and retained output.session-run.test.ts: 14 tests, 8.27 s.active-run-cancellation.test.ts: 8 tests, 1.39 s, retaining shutdown/suspension visibility and sibling isolation.config/tsconfig/oxlint.core.json), formatting, andgit diff --checkpass. The initial lint invocation usingtsconfig.core.jsonfailed during unrelated plugin declaration preparation: installed@openclaw/fs-safedeclarations lackDirectoryModeand reject stringdirMode. The supported core-lint configuration avoids that package-boundary preparation. Full typecheck and broad proof are delegated to PR CI under the host IO emergency; no dependencies, operator state, or Gateway were changed.f216d0ccfb772c214a50b3a0dada3b3379e27248(530 s from run creation to completion). Security/dependency publication gates also passed.Requested by @steipete
Work sessions
Discussion, implementation and verification