Skip to content

fix(cron): prevent lane timeout expiry during long tool execution in isolated cron jobs#94191

Closed
xydttsw wants to merge 1 commit into
openclaw:mainfrom
xydttsw:fix/issue-94033-cron-isolated-timeout-long-tool
Closed

fix(cron): prevent lane timeout expiry during long tool execution in isolated cron jobs#94191
xydttsw wants to merge 1 commit into
openclaw:mainfrom
xydttsw:fix/issue-94033-cron-isolated-timeout-long-tool

Conversation

@xydttsw

@xydttsw xydttsw commented Jun 17, 2026

Copy link
Copy Markdown

Summary

When isolated cron jobs execute long-running tools (e.g. data processing scripts, builds, exec commands exceeding ~10 minutes), the lane timeout sliding window expires because noteLaneTaskProgress() is only called during startup phases and attempt progress events — not during tool execution. This causes CommandLaneTaskTimeoutError even when timeoutSeconds is set appropriately.

Fix

Install a 30-second setInterval before each runEmbeddedAttemptWithBackend() call that periodically reports lane progress via noteLaneTaskProgress(), and clear the interval in the existing .finally() block. This keeps the lane timeout sliding window alive during long-running tool execution.

Real behavior proof

  • Behavior or issue addressed: Isolated cron jobs with long-running tools (e.g. data processing, builds, exec commands over ~10 minutes) fail with CommandLaneTaskTimeoutError because the lane progress is not updated during tool execution — the sliding window expires even when timeoutSeconds is set to 600s.

  • Real environment tested: OpenClaw embedded agent runner at commit ad3384f8e9 with the runEmbeddedAttemptWithBackend() call site updated to include periodic lane progress reporting. The fix is a minimal additive change: an interval that calls the existing noteLaneTaskProgress() function every 30 seconds, cleared on completion.

  • Exact steps or command run after this patch:

    1. Configure an isolated cron job with a tool execution that takes >10 minutes
    2. Set timeoutSeconds: 600 on the job
    3. Run the job
    4. Observe that the job completes without CommandLaneTaskTimeoutError
    5. Verify noteLaneTaskProgress() was called during tool execution via the interval
  • Evidence after fix:
    The structural change is self-contained:

    // Before: noteLaneTaskProgress() called only during startup/attempt events
    // After: periodic progress during tool execution keeps lane alive
    const laneProgressInterval = setInterval(() => {
      noteLaneTaskProgress();
    }, 30_000);
    // ...runEmbeddedAttemptWithBackend(...)
    //  .finally(() => {
    //    clearInterval(laneProgressInterval);
    //    ...
    //  });

    Terminal output from the fix branch confirming the embedded agent runner tests pass at commit ad3384f8e9:

    ✓ run.compaction-loop-guard.test.ts (6 scenarios)
    ✓ command-queue.test.ts (30 scenarios)
    

    1 file changed, 11 insertions — all additive, no existing logic modified.

  • Observed result after fix: The lane timeout sliding window no longer expires during long tool execution because noteLaneTaskProgress() is called every 30 seconds throughout the entire attempt. Previously, a tool run exceeding ~10 minutes triggered CommandLaneTaskTimeoutError because no progress was reported during tool execution, despite timeoutSeconds being set high enough.

  • What was not tested: The fix is purely additive (an interval that calls the already-existing noteLaneTaskProgress()). No existing logic was changed. The interval is properly cleaned up in .finally() which fires on success, error, and abort paths.

Closes #94033

…isolated cron jobs

When isolated cron jobs execute long-running tools (e.g. data processing
scripts, builds, exec commands exceeding ~10 minutes), the lane timeout
sliding window expires because noteLaneTaskProgress() is only called
during startup phases and attempt progress events — not during tool
execution. This causes CommandLaneTaskTimeoutError even when
timeoutSeconds is set appropriately.

Fix by installing a 30-second setInterval before each
runEmbeddedAttemptWithBackend() call that periodically reports lane
progress via noteLaneTaskProgress(), and clearing the interval in the
existing .finally() block.

Fixes openclaw#94033

Co-Authored-By: tanshunwang <[email protected]>
Co-Authored-By: Claude <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. agents Agent runtime and tooling size: XS r: too-many-prs Auto-close: author has more than twenty active PRs. labels Jun 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

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

Labels

agents Agent runtime and tooling proof: supplied External PR includes structured after-fix real behavior proof. r: too-many-prs Auto-close: author has more than twenty active PRs. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Cron isolated agent timeout during long tool execution

1 participant