openclaw - 💡(How to fix) Fix Feature: Sub-agent should auto-save progress on timeout [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48964Fetched 2026-04-08 00:50:24
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1
RAW_BUFFERClick to expand / collapse

Problem

When a sub-agent times out (e.g. 5min/10min limit), all its work is lost. The parent agent only receives the last stdout output, not the actual file changes or progress made.

Current Behavior

  • Sub-agent runs a complex task (e.g. deploying a project)
  • Task exceeds timeout
  • Parent receives only the last terminal output
  • All file changes made by the sub-agent are preserved on disk, but the parent has no structured summary of what was done

Proposed Solution

On timeout, automatically:

  1. Run git diff (if in a git repo) to capture file changes
  2. Include a structured progress summary in the timeout result
  3. Optionally allow the parent to resume from where the sub-agent left off

Use Case

Today I deployed FreeTodo with a sub-agent. It timed out while downloading dependencies (uv sync). The sub-agent had already cloned the repo and started installing, but I had no structured way to know what was completed vs what remained.

Environment

  • OpenClaw 2026.3.13
  • Sub-agent model: MiniMax-M2.5
  • Timeout: 600s

extent analysis

Fix Plan

The fix involves modifying the sub-agent timeout handler to capture file changes and provide a structured progress summary.

Steps:

  • Modify the sub-agent code to run git diff on timeout and capture the output
  • Create a structured progress summary, including the last terminal output and file changes
  • Optionally, implement a resume feature to allow the parent agent to continue from where the sub-agent left off

Example Code:

import subprocess
import json

def handle_timeout():
    # Run git diff to capture file changes
    git_diff_output = subprocess.check_output(["git", "diff"]).decode("utf-8")
    
    # Create a structured progress summary
    progress_summary = {
        "last_terminal_output": get_last_terminal_output(),
        "file_changes": git_diff_output
    }
    
    # Optionally, allow the parent to resume from where the sub-agent left off
    resume_data = get_resume_data()
    if resume_data:
        progress_summary["resume_data"] = resume_data
    
    # Return the progress summary as JSON
    return json.dumps(progress_summary)

def get_last_terminal_output():
    # Implement logic to get the last terminal output
    pass

def get_resume_data():
    # Implement logic to get the resume data
    pass

Verification

To verify the fix, test the sub-agent with a task that exceeds the timeout limit. The parent agent should receive a structured progress summary, including the last terminal output and file changes.

Extra Tips

  • Ensure that the git diff command is only run if the sub-agent is operating within a Git repository.
  • Consider implementing a more robust resume feature, such as saving the sub-agent's state to a file or database.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING