Repository navigation
fix(worktrees): prevent session-aware GC regressions - #107989
Merged
Merged
Conversation
steipete
force-pushed
the
codex/pr-104146-regression-tests
branch
2 times, most recently
from
July 15, 2026 04:26
3dbef04 to
86f6efa
Compare
Co-authored-by: RickLin <[email protected]>
steipete
force-pushed
the
codex/pr-104146-regression-tests
branch
from
July 15, 2026 04:53
86f6efa to
04233d6
Compare
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 15, 2026
…law#107989) Co-authored-by: RickLin <[email protected]>
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…law#107989) Co-authored-by: RickLin <[email protected]>
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.
Closes #104108
Supersedes #104146 because GitHub rejected maintainer writes to its fork branch.
What Problem This Solves
Fixes an issue where manual managed-worktree cleanup could delete an idle-expired worktree while its owning session was still active. The production correction now exists on main through #106224, but the invariant was not pinned at every cleanup entry point, and the original contributor PR could no longer be updated by maintainers.
Why This Change Was Made
This test-only replacement preserves current main's cleanup-limit implementation and adds focused regression coverage. Scheduled maintenance, the worktrees.gc RPC, and the CLI command must all pass the same Gateway-owned session activity predicate. The predicate tests cover recent, stale, unsupported-owner, missing-session, and unreadable-session state.
The commit preserves RickLin's contribution with a co-author trailer.
User Impact
No new runtime behavior. The existing session-worktree data-loss fix now has durable coverage across every production GC caller.
Evidence
AI-assisted maintainer rewrite. The original PR, current main implementation, callers, service contract, sibling worktree protections, and tests were reviewed directly.