fix(cron): prevent lane timeout during long tool execution in isolated cron agents#94186
Closed
xydttsw wants to merge 1 commit into
Closed
fix(cron): prevent lane timeout during long tool execution in isolated cron agents#94186xydttsw wants to merge 1 commit into
xydttsw wants to merge 1 commit into
Conversation
…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]>
Author
|
Superseded by #94191 |
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.
Summary
When a cron job with
isolated: trueruns a long-running tool (e.g., data processing scripts, builds) that exceeds ~10 minutes, the lane task timeout expires with aCommandLaneTaskTimeoutErroreven whentimeoutSecondsis configured to 600s.Root Cause
noteLaneTaskProgress()insrc/agents/embedded-agent-runner/run.tswas 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-secondsetIntervalto periodically callnoteLaneTaskProgress(), 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 aroundrunEmbeddedAttemptWithBackend()that callsnoteLaneTaskProgress()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