Fix Time Travel stale index.lock cleanup and await progress updates#1612
Open
zayzay109 wants to merge 1 commit into
Open
Fix Time Travel stale index.lock cleanup and await progress updates#1612zayzay109 wants to merge 1 commit into
zayzay109 wants to merge 1 commit into
Conversation
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
This PR fixes two small stability issues observed in Agent Zero runtime paths:
repo.git/index.lockwhen a Git subprocess is killed bysubprocess.TimeoutExpired, poisoning later snapshots for that workspace.code_execution_toolcalls asyncTool.set_progress()withoutawaitin two output-progress paths, producing coroutine warnings and potential progress/update instability under load.Changes
Time Travel
Adds a best-effort
_cleanup_git_index_lock()helper and calls it when Git subprocesses time out in:_run_git_dir()_git()_git_bytes()The timeout exception is re-raised. The patch does not change
GIT_TIMEOUT_SECONDS, does not suppress errors, and does not alter normal successful Git behavior.Code execution tool
Changes two bare calls:
to:
Why
If a Time Travel Git command times out, the killed Git process may leave
index.lockbehind. Later snapshot attempts then fail with:Cleaning the lock after timeout prevents one failed snapshot from permanently poisoning that workspace.
The
set_progresscalls are in async functions and should await the coroutine.Validation
Validated locally with:
Also validated in a live Agent Zero environment with a Time Travel stability guard after remediation:
{ "verdict": "PASS", "workspace_count": 9 }No current stale Time Travel
index.lockfiles remained after the fix.Notes
This is intentionally minimal defensive cleanup. It does not disable Time Travel, change timeout values, or add environment-specific behavior.