Skip to content

fix(cron): cron turns into a busy CLI-backed session time out before the runner starts - #160804

Closed
changeroa wants to merge 3 commits into
openclaw:mainfrom
changeroa:contrib/cron-cli-lane-wait
Closed

changeroa wants to merge 3 commits into
openclaw:mainfrom
changeroa:contrib/cron-cli-lane-wait

Conversation

@changeroa

@changeroa changeroa commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #160302
Related (same error text, different boundary, not duplicates):

What Problem This Solves

Fixes: a cron agentTurn job aimed at a busy CLI-backed session (for example claude-cli with sessionTarget: "session:<key>") is aborted with cron: isolated agent setup timed out before runner start whenever that session's current turn runs longer than 60 seconds. The run is lost, and one-shot at jobs never deliver.

User Impact

User impact: cron and follow-up jobs that target a live CLI-backed conversation now wait their turn in the session lane and run when the active turn finishes. The embedded runtime already behaves this way. Cancelling such a queued job (for example openclaw automations rm) still settles it right away, even while the session stays busy.

Important

Maintainer decision requested: should a queued CLI cron turn keep its cron run slot while it waits for a busy session?

With this PR, a cron turn queued behind a busy CLI session keeps its cron run slot (DEFAULT_CRON_MAX_CONCURRENT_RUNS) for as long as the session's active turn runs. Operator cancellation (openclaw automations rm) is the only thing that bounds that wait, and after the second commit it settles immediately.

Facts that bear on the decision:

  • This is what the embedded runtime already does. Its cron branch forwards onLaneWait (src/cron/isolated-agent/run-executor.ts, embedded runEmbeddedAgent call), the lane controller reports waiting: true, and the setup watchdog pauses. The session-lane taskTimeoutMs clock only starts when the task starts (src/process/command-queue.ts, startedAtMs), so an embedded cron turn queued behind a busy session also waits without a bound while holding its slot. This PR doesn't add a new availability class; it removes a CLI-only 60 s abort.
  • Before this PR, the CLI path's only "bound" was losing the run. It hit the setup watchdog at 60 s and never retried into success (the reported bug: 35 lost runs in 2 days).
  • Cancellation works while waiting. The queued entry is removed and the run settles as soon as the owner aborts (see the live Scenario B below).

Options:

  1. Keep parity with the embedded path (this PR as is). Recommended.
  2. Parity now, plus a follow-up that caps session-lane wait for both runtimes, for example at the job's execution timeout. That lives in the shared cron watchdog, so it's out of scope for a CLI parity fix.
  3. Release the cron slot while the turn is lane-waiting and reacquire it on admission. This is a larger scheduler change, affecting both runtimes.

I'm happy to adjust this PR (or open the follow-up) based on the decision.

Why This Change Was Made

The cron setup watchdog (CRON_AGENT_SETUP_WATCHDOG_MS = 60_000) pauses while a run waits for its session lane: onLaneWait({ waiting: true }) stops the setup timer, and { waiting: false } restarts it. The embedded runtime reports those transitions. The direct CLI path didn't:

  1. withLocalSessionPlacementTurnSettlement queued the CLI turn on session:<key> but reported only onQueued (capacity wait), not onLaneWait.
  2. The cron executor's CLI branch never passed params.onLaneWait into it.

The PR has two commits:

Commit Change
fix(cron): report CLI session-lane waits to the setup watchdog Report waiting: true when the CLI turn is actually queued and waiting: false right before it runs, the same contract the embedded lane controller uses. Also forward onLaneWait on the cron CLI branch.
fix(cron): cancel a queued CLI turn when its owner aborts Pausing the watchdog means nothing else bounds the wait, so the owner's abortSignal is now passed to the session-lane enqueue (the embedded lane controller already does this). Cancelling the cron run removes the queued entry and settles the run immediately, instead of waiting for a predecessor that may never finish. This addresses the ClawSweeper P2 finding.

run-executor.ts sits exactly at its grandfathered line cap, so the one forwarding line is offset by inlining the single-use cliAbortSignal alias (deferredLifecycle.signal is a fixed property). There is no behavior change from that inline. The watchdog itself is unchanged.

Evidence

1. Live Gateway run with a real CLI backend (before → after)

Setup. An isolated OPENCLAW_STATE_DIR Gateway runs a tiny local CLI backend plugin (fakecli, registered through api.registerCliBackend, output: "text", input: "stdin"). Its script sleeps 80 s when the prompt contains HOLD-SESSION and otherwise replies immediately. The run reports runner: "cli", provider: "fakecli".

Scenario A: cron into a busy CLI session. Session agent:main:proof runs an 80 s turn. Six seconds later:

openclaw agent --session-key proof --message "HOLD-SESSION busy turn" --json   # 80 s turn
openclaw automations add --name lane-proof --at 3s \
  --session session:agent:main:proof --message "cron follow-up after the busy turn" --no-deliver
Cron run result Details
before (main @ ad76695) ❌ status: error, completionStatus: failed error: "cron: isolated agent setup timed out before runner start" after 59 997 ms. The Gateway log shows lane wait exceeded … waitedMs=72156 activeAhead=1, then lane task error … durationMs=1. The cron turn never started.
after (this PR) ✅ status: ok, completionStatus: succeeded It waited behind the busy turn and ran the moment it finished (busy turn done 00:19:42, cron CLI turn started 00:19:42). durationMs: 70805, well past the 60 s setup watchdog.

Scenario B: cancel a queued cron turn while the session stays busy (this PR). Session agent:main:proof2 runs an 80 s turn. A cron job is queued behind it, and after about 15 s it is removed:

09:20:11.902 [gateway] cron: job added
09:20:31.254 [model-fallback/decision] model fallback chain stopped: reason=caller_signal_aborted candidate=fakecli/default
09:20:31.255 [gateway] cron: job removed
09:20:31.270 [diagnostic] message processed: channel=cron … sessionKey=agent:main:proof2 outcome=error duration=17492ms error="Cron job removed by operator."

The run settled 15 ms after automations rm, while the busy turn was still running (it finished at 00:21:25). The fake CLI log shows the cancelled cron turn never executed, not even after the lane freed up.

Fake CLI backend used for the proof
// index.js (loaded through plugins.load.paths; manifest declares "cliBackends": ["fakecli"])
export default {
  id: "fakecli",
  register(api) {
    api.registerCliBackend({
      id: "fakecli",
      config: { command: "<dir>/fake-cli.sh", args: [], output: "text", input: "stdin", sessionMode: "none" },
    });
  },
};
# fake-cli.sh
prompt=$(cat)
if [[ "$prompt" == *HOLD-SESSION* ]]; then sleep 80; fi
echo "fakecli reply: ${prompt:0:40}"

2. Regression tests

src/agents/session-placement-admission.test.ts:

Test Asserts Without the fix
reports session-lane waits for a queued CLI turn so setup watchdogs can pause callback order waiting → admitted → task behind an occupied lane ❌ expected [] to deeply equal [ 'waiting' ]
settles a queued CLI turn when its owner aborts while the session stays busy aborting while the predecessor never releases the lane settles the run with the abort reason, and the task never runs ❌ expected 'pending' to be Error: cron run cancelled while queued
node scripts/run-vitest.mjs src/agents/session-placement-admission.test.ts src/cron/service/timer.timeout-watchdog.test.ts

✅ 33 passed (33) plus the watchdog suite's 13 passed (13). The existing timer.timeout-watchdog.test.ts already proves that onLaneWait({ waiting: true/false }) pauses and restarts the setup watchdog.

3. Checks

  • node scripts/check-changed.mjs on this head: typecheck core + core tests, format, line-cap / max-lines / assertion ratchets, dead-export scan, and boundary checks all pass. The first run flagged one no-promise-executor-return lint in the new test, fixed in test(cron): keep the queued-abort test promise executor lint-clean. oxlint and oxfmt on the changed files are clean.
  • Measured cost: pnpm test src/agents/session-placement-admission.test.ts --maxWorkers=1 takes 45 s wall with a cold transform cache (Vitest 41.8 s, 95% transform). The two new cases take about 1 ms each.
  • Codex autoreview (branch mode, P1) on the new head: scoped-clean.

A cron agentTurn queued behind an active turn in a CLI-backed session kept
its 60s setup watchdog running and aborted with "isolated agent setup timed
out before runner start". Report the local session-lane wait and admission
to onLaneWait, matching the embedded runtime, and forward the cron callback
on the CLI branch.

Closes openclaw#160302
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 9:05 PM ET / September 29, 2026, 01:05 UTC (Revision 3).

ClawSweeper review

What this changes

Cron jobs targeting a busy CLI-backed session now pause the setup watchdog while queued and settle promptly if the run is cancelled.

Regression provenance

Possible regression — suspected (failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

The patch addresses a current cron failure, and the contributor’s Gateway trace shows the queued CLI turn running after its session becomes free. The prior cancellation finding is addressed. A maintainer still needs to accept or change the effect of an unbounded session wait on cron run capacity.

Priority: P1
Reviewed head: 43897c0729f29a5c8d13806a25caa35c32fd24dc
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused production-path traces, regression coverage, and a narrow patch support the fix; the cron capacity tradeoff awaits owner acceptance.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The contributor’s captured trace exercises the changed cron-to-CLI placement path through an isolated Gateway and registered local CLI backend: the queued turn succeeds after its busy predecessor, and operator removal settles another queued turn before that predecessor finishes. The patch changes no stored-data contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The contributor’s captured trace exercises the changed cron-to-CLI placement path through an isolated Gateway and registered local CLI backend: the queued turn succeeds after its busy predecessor, and operator removal settles another queued turn before that predecessor finishes. The patch changes no stored-data contract.
Evidence reviewed 8 items Current main still has the failure path: The current-main CLI placement helper has no lane-wait callback, and the cron CLI branch does not forward one; only the embedded branch forwards onLaneWait.
Introduced queue and cancellation behavior: The pinned merge-base-to-head diff forwards the cron lane-wait callback, reports queue and admission transitions, and supplies the owner abort signal to the session queue.
Queue and watchdog contract: The queue calls onQueued only while an entry remains queued, removes a queued entry on abort, and starts its task timeout on admission. The cron watchdog clears its setup timer on lane wait and starts it on admission.
Findings None None.
Security None None.

How this fits together

The Gateway cron scheduler admits scheduled agent turns and sends them to either the embedded runtime or a CLI backend. A session lane serializes turns for the same conversation before the runner starts and the scheduler records the result.

flowchart LR
  A[Scheduled agent turn] --> B[Cron run slot]
  B --> C{CLI or embedded runtime}
  C --> D[Session lane]
  D --> E{Wait or admit}
  E --> F[Runner and result]
  E --> G[Cancellation settles run]
Loading

Decision needed

Question Recommendation
May a cron turn queued behind a busy CLI-backed session hold one of the eight cron run slots without a wait limit, matching the embedded runtime? Accept runtime parity: Land the fix with the existing embedded-runtime capacity behavior and track a shared wait limit separately if operational evidence warrants it.

Why: The patch restores parity and prevents lost runs, but its capacity effect can delay unrelated jobs; choosing that scheduler tradeoff requires owner intent.

Before merge

  • Resolve merge risk (P1) - A CLI cron turn can now wait indefinitely behind a busy session while holding one of the eight cron run slots, delaying unrelated scheduled jobs if enough sessions remain busy; no maintainer acceptance of that tradeoff is recorded.
  • Complete next step (P2) - Have the cron scheduler owner decide whether an indefinitely queued CLI turn may retain a run slot before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +16, Tests +69. Total +85 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 23 7 +16
Tests 1 69 0 +69
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 92 7 +85

Review metrics

Metric Value Why it matters
Focused test cost 2 new cases; 45 s cold suite wall time reported The contributor reports about 1 ms for the new assertions, with most wall time spent transforming the existing test suite.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160302
Summary: This PR is the candidate fix for the busy CLI-session cron failure; the other linked reports describe different failure boundaries.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the shared wait behavior (recommended)
    Approve the existing embedded-runtime policy for CLI turns too, with operator cancellation as the immediate escape.
  2. Set a shared wait limit
    Pause landing until a bounded queue-wait policy covers both runtimes without losing the scheduled turn.

Technical review

Best possible solution:

Preserve the working CLI session-lane behavior, then have the cron owner decide whether queued turns may retain run slots indefinitely or need a shared bounded-wait policy for both runtimes.

Do we have a high-confidence way to reproduce the issue?

Yes, at the source boundary: current main omits the CLI lane-wait callback, and a queued turn leaves the 60-second setup timer running. The contributor also supplies a before-and-after Gateway trace; this reviewer did not execute it.

Is this the best way to solve the issue?

Yes, for the reported failure: the patch uses the existing queue and watchdog contracts and adds prompt cancellation. Whether the resulting unbounded slot wait is acceptable remains an explicit scheduler decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e1ccea91271f.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The reported CLI-session failure loses scheduled turns, including one-shot jobs, in an active user workflow.
  • merge-risk: 🚨 availability: Queued CLI turns can now retain scarce cron run capacity for as long as their target sessions stay busy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The contributor’s captured trace exercises the changed cron-to-CLI placement path through an isolated Gateway and registered local CLI backend: the queued turn succeeds after its busy predecessor, and operator removal settles another queued turn before that predecessor finishes. The patch changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor’s captured trace exercises the changed cron-to-CLI placement path through an isolated Gateway and registered local CLI backend: the queued turn succeeds after its busy predecessor, and operator removal settles another queued turn before that predecessor finishes. The patch changes no stored-data contract.

Evidence

What I checked:

  • Current main still has the failure path: The current-main CLI placement helper has no lane-wait callback, and the cron CLI branch does not forward one; only the embedded branch forwards onLaneWait. (src/agents/session-placement-admission.ts:239, e1ccea91271f)
  • Introduced queue and cancellation behavior: The pinned merge-base-to-head diff forwards the cron lane-wait callback, reports queue and admission transitions, and supplies the owner abort signal to the session queue. (src/agents/session-placement-admission.ts:298, 43897c0729f2)
  • Queue and watchdog contract: The queue calls onQueued only while an entry remains queued, removes a queued entry on abort, and starts its task timeout on admission. The cron watchdog clears its setup timer on lane wait and starts it on admission. (src/process/command-queue.ts:571, 43897c0729f2)
  • Cron capacity tradeoff: Cron retains an admitted run slot until execute settles, and the service limit is eight. Pausing the setup watchdog can therefore hold a slot while the session remains busy. (src/cron/service/run-admission-capacity.ts:110, 43897c0729f2)
  • Contributor production-path proof: The captured PR body reports an isolated Gateway with a registered local CLI backend: before the patch, a busy-session cron turn failed near 60 seconds; after the patch, it ran when the 80-second predecessor finished. A second trace reports cancellation settling in 15 ms while the predecessor remained busy. These are contributor-provided observations, not a reviewer-executed run. (43897c0729f2)
  • Prior finding addressed: The earlier review asked for cancellation of a queued CLI turn. The current head passes the abort signal into the queue and adds a regression case that checks settlement without releasing the predecessor. (src/agents/session-placement-admission.test.ts:291, 43897c0729f2)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Lee: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-29T00:01:49.182Z sha 9337360 :: needs real behavior proof before merge. :: [P2] Cancel the queued CLI turn when its owner aborts
  • reviewed 2026-09-29T00:43:21.700Z sha 43897c0 :: blocked before merge. :: none

Reporting the session-lane wait pauses the cron setup watchdog, so a
queued CLI turn must also be removable: pass the owner abort signal to
the session-lane enqueue (as the embedded lane controller already does)
so cancelling a cron run settles it even while the active turn never
releases the lane.
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@obviyus

obviyus commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Independently reproduced with an isolated Gateway and a registered mock CLI backend (Node 24.21.0, secretless Docker), using the real 60-second watchdog and an 85-second busy turn in agent:main:proof:

  • Current main af80e86b3a2abe61ad740eeb78c2158202cb2afe: the first cron receipt is error after 60,009 ms, with cron: isolated agent setup timed out before runner start. When the lane opens after 81,319 ms of waiting, that original turn fails immediately. Current main subsequently retries and succeeds; this proof establishes the premature timeout, not permanent loss of every job.
  • PR head 43897c0729f29a5c8d13806a25caa35c32fd24dc: the cron turn waits 81,248 ms, then the CLI executes immediately after its predecessor; the sole receipt is ok after 81,512 ms.
  • Regression contrast: both contributed cases fail against current main (missing wait notification; cancellation remains pending), and pass on the PR head. The full candidate placement suite passes 33/33 and watchdog suite 13/13 (46.4 seconds combined). The genuine setup-hang control uses the existing integration test's fake timers and still produces the setup timeout. The initial test attempts overlapped builds and failed on compiler topology mutation before running tests; these were setup failures, resolved by completing builds first. Applying the historical full test file to current main also exposes two unrelated assertion-shape differences (assertCurrent); those are not failures of the candidate.

No overlap with Pash/Sarah changes was found in the three touched files. Thanks to @Oldrich333 for the report and @changeroa for the fix and regression coverage.

The existing exact-head ClawSweeper owner-decision hold remains unresolved; no changes were pushed. Cron scheduler owner question: may a CLI cron turn queued behind a busy session retain one of the eight cron run slots indefinitely, matching the embedded runtime, with cancellation as the escape? The relevant capacity owner is src/cron/service/run-admission-capacity.ts:110; the callback handoff is src/cron/isolated-agent/run-executor.ts:594. Recent scheduler/watchdog history points to Peter Steinberger; CODEOWNERS has no cron-specific owner. This comment supplies proof, not acceptance of that tradeoff.

@obviyus

obviyus commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

@steipete: handing this off for a cron-owner decision. The proof is in #160804 (comment).

ClawSweeper's review of exact head 43897c0729f29a5c8d13806a25caa35c32fd24dc is blocked only on this question: may a cron agentTurn queued behind a busy CLI session hold one of the eight cron slots for as long as the lane stays busy? Embedded runs already behave that way, and the review recommends matching them, but it needs your sign-off.

Proof: real Gateways in secretless Docker, with a mock CLI kept busy for 85 s against the real 60 s watchdog.

  • main: fails at 60,009 ms with "setup timed out". The original queued turn fails at admission.
  • This head: waits about 81 s, runs after the earlier turn finishes and records a single ok receipt.
  • Genuine setup hang: still times out.
  • CI: green on this head.

@Oldrich333

Copy link
Copy Markdown
Contributor

Agent-written on behalf of @Oldrich333 · agent: hive-admin/executor · model: claude-cli/claude-opus-5-5 · origin: agent-initiated

Production data for the cron-owner decision, from the reporter side (#160302).

  • measured: cron run receipts (error_text = 'cron: isolated agent setup timed out before runner start') on 5 self-hosted gateways, 7 d (2026-09-27 → 2026-10-04). An equivalent local fix (CLI branch reports the lane wait to the setup watchdog, as the embedded branch does) went live 2026-09-28 08:59 UTC.
  • before the local fix: 35 setup-timeout receipts in ~13 h, all agentTurn into session:<key> targets on a CLI backend (mostly one-shot continuation jobs).
  • after: 0 session-target setup timeouts in ~6 days, while the precondition kept occurring (≈450 cron runs into session: targets in 7 d). One queued turn waited 10.2 h behind a wedged session turn and was then aborted by its own abort path; the 60 s watchdog would have failed it at 60 s.

steipete added a commit that referenced this pull request Oct 11, 2026
Cancelling CLI work while it waits behind an active session turn previously left the caller blocked until the predecessor finished. Forward the caller's abort signal to the existing command queue so cancellation promptly removes and rejects the queued turn without executing it.

Strengthen the existing regression to await rejection before releasing the predecessor. The regression fails before the fix; all 39 focused owner, caller-scope and queue cancellation tests pass afterward.

Victor Jaepyo Jo (@changeroa) previously identified the same cancellation defect in #160804, which also contains distinct cron watchdog work. This narrow fix was independently reproduced.

Co-authored-by: Victor Jaepyo Jo <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
Cancelling CLI work while it waits behind an active session turn previously left the caller blocked until the predecessor finished. Forward the caller's abort signal to the existing command queue so cancellation promptly removes and rejects the queued turn without executing it.

Strengthen the existing regression to await rejection before releasing the predecessor. The regression fails before the fix; all 39 focused owner, caller-scope and queue cancellation tests pass afterward.

Victor Jaepyo Jo (@changeroa) previously identified the same cancellation defect in #160804, which also contains distinct cron watchdog work. This narrow fix was independently reproduced.

Co-authored-by: Victor Jaepyo Jo <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 9607478)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
Cancelling CLI work while it waits behind an active session turn previously left the caller blocked until the predecessor finished. Forward the caller's abort signal to the existing command queue so cancellation promptly removes and rejects the queued turn without executing it.

Strengthen the existing regression to await rejection before releasing the predecessor. The regression fails before the fix; all 39 focused owner, caller-scope and queue cancellation tests pass afterward.

Victor Jaepyo Jo (@changeroa) previously identified the same cancellation defect in openclaw#160804, which also contains distinct cron watchdog work. This narrow fix was independently reproduced.

Co-authored-by: Victor Jaepyo Jo <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
@roboclaw-bot

roboclaw-bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks @changeroa for the fix and queued-cancellation coverage. This has since been addressed on main: #165310 (c42bd6eae5e8) moved session waiting ahead of preparation and reported it to cron; #175837 unified session admission; #188982 (02e31abcc672) made the configured job deadline include that wait.

I checked the current code path: both CLI and embedded turns now wait through withCronSessionPreparation before backend selection. Waiting clears the 60-second setup watchdog while the configured job deadline continues. Expiry records timed_out with cron: job execution timed out, rather than the premature setup error.

Verified on main cd56ab1a54c81: all 28 tests passed across timer.timeout-watchdog.test.ts, command-timeout.test.ts, and run.session-lane.test.ts, including fake-timer deadlines, genuine setup hangs, and queued cancellation (Testbox run; test payload passed, parent Actions run cancelled during lease cleanup). The subsequent main commit only changes locale-refresh CI. Closing as already fixed; no additional change needs lifting from this patch. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

4 participants