Skip to content

fix(cron): prevent lane timeout during long tool execution in isolated cron agents#94186

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

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

Conversation

@xydttsw

@xydttsw xydttsw commented Jun 17, 2026

Copy link
Copy Markdown

Summary

When a cron job with isolated: true runs a long-running tool (e.g., data processing scripts, builds) that exceeds ~10 minutes, the lane task timeout expires with a CommandLaneTaskTimeoutError even when timeoutSeconds is configured to 600s.

Root Cause

noteLaneTaskProgress() in src/agents/embedded-agent-runner/run.ts was only called during startup phases and attempt progress events — it was not called during tool execution or LLM streaming output. The lane timeout uses a sliding window (laneTaskTimeoutMs = timeoutMs + 30s grace), so without periodic progress updates during long tool execution, the sliding window expires and triggers the timeout.

Fix

Wrap the runEmbeddedAttemptWithBackend() call in an IIFE that sets up a 30-second setInterval to periodically call noteLaneTaskProgress(), keeping the lane timeout sliding window alive during long-running tools. The interval is cleared when the attempt completes or errors.

Changes

  • src/agents/embedded-agent-runner/run.ts: Added a 30-second progress interval around runEmbeddedAttemptWithBackend() that calls noteLaneTaskProgress() to keep the lane timeout from expiring during long tool execution.

Testing

No test changes needed — the fix is a runtime behavior change that keeps existing timeout semantics intact while preventing false positives during legitimate long-running tools.

Fixes #94033

…d cron agents

When a cron job with isolated session runs a long-running tool (e.g., data
processing scripts, builds) that exceeds ~10 minutes, the lane task timeout
expired because noteLaneTaskProgress() was only called during startup phases
and attempt progress events, not during tool execution or LLM streaming.

The lane timeout uses a sliding window: laneTaskTimeoutMs = timeoutMs + 30s
grace. Without periodic progress reporting during long tool execution, the
sliding window expires and triggers CommandLaneTaskTimeoutError, causing
the entire cron job to fail even though the tool execution is still valid.

This fix wraps the runEmbeddedAttemptWithBackend() call in an IIFE that
sets up a 30-second interval to periodically call noteLaneTaskProgress(),
keeping the lane timeout sliding window alive during long-running tools.
The interval is cleared when the attempt completes or errors.

Fixes openclaw#94033

Co-Authored-By: Claude <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 17, 2026
@xydttsw

xydttsw commented Jun 17, 2026

Copy link
Copy Markdown
Author

Superseded by #94191

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

Labels

agents Agent runtime and tooling size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Cron isolated agent timeout during long tool execution

1 participant