Skip to content

Bug: Cron isolated agent timeout during long tool execution #94033

Description

@JingWang-Star996

Bug: Cron isolated agent timeout during long tool execution

Problem

Cron jobs with isolated: true fail with CommandLaneTaskTimeoutError when tool execution exceeds ~10 minutes, even though timeoutSeconds is configured to 600s (10 minutes).

Root Cause

In dist/embedded-agent-*.js, the noteLaneTaskProgress() function is only called during:

  • Startup phases
  • Attempt progress events

It is NOT called during:

  • Tool execution (e.g., exec commands running 5+ minutes)
  • LLM streaming output

The lane timeout uses a sliding window: laneTaskTimeoutMs = timeoutMs + 30s grace. If no progress is reported during long tool execution, the sliding window expires and triggers CommandLaneTaskTimeoutError.

Evidence

  • Error: CommandLaneTaskTimeoutError: Lane task timed out after 630000ms
  • Occurs consistently when cron jobs execute long-running tools (e.g., data processing scripts, builds)
  • Same jobs work fine when triggered manually (non-cron context)

Fix

Wrap runEmbeddedAttemptWithBackend() call in an IIFE that periodically calls noteLaneTaskProgress() every 30 seconds:

const rawAttempt = await (() => {
    const progressInterval = setInterval(() => noteLaneTaskProgress(), 30000);
    return runEmbeddedAttemptWithBackend({
        // ... existing params
    }).catch((err) => {
        throw postCompactionAbortError ?? err;
    }).finally(() => {
        clearInterval(progressInterval);  // <-- Add this
        parentAbortSignal?.removeEventListener?.("abort", relayParentAbort);
        if (postCompactionAbortController === attemptAbortController) postCompactionAbortController = void 0;
    });
})();

Impact

  • Cron jobs with long-running tools fail unpredictably
  • Users must set artificially high timeoutSeconds to work around the issue
  • Affects all isolated cron agents executing tools that take >5 minutes

Environment

  • OpenClaw version: 2026.6.5 - 2026.6.8
  • Node.js: v24.14.0
  • OS: Linux (WSL Ubuntu 24.04)

Workaround

Until this is fixed upstream, users can patch dist/embedded-agent-*.js manually (see fix above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions