Repository navigation
Conversation
Record nested repositories as terminal preservation in the existing cleanup receipt. Cap missing-object and permission retries at three attempts, expose the reason to administrators, and require preserved contents before capacity or forced removal of these failures. No schema migration or configuration change.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 553b6df94c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR records bounded preservation failures, stops repeated automatic cleanup, and exposes recovery guidance to administrators. Example: A checkout fails cleanup three times because Git objects are missing.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this useful, maintainer-directed fix resolves all five earlier findings; exact-head CI still has an unattributed disk-headroom test failure. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe managed-worktree service receives CLI, Gateway, idle-cleanup, and capacity requests, captures recovery snapshots, and records cleanup outcomes through the existing SQLite registry. flowchart TD
A[CLI and Gateway requests] --> B[Managed worktree service]
B --> C[Idle and capacity cleanup]
C --> D[Snapshot and removal owners]
D --> E[Git checkout and objects]
D --> F[SQLite cleanup receipt]
F --> C
F --> G[Administrator status and recovery guidance]
Technical reviewBest possible solution: Keep preservation policy in the existing removal and registry owners, with explicit recovery through the existing retry command. Do we have a high-confidence way to reproduce the issue? Current-main source shows unlimited retry attempts, while supplied real Git regressions and CLI results establish preservation and explicit recovery; no target code was executed during this read-only review. Is this the best way to solve the issue? The change reuses typed worker errors, revision-bound registry receipts, and existing cleanup owners without adding a competing store or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b4fc05346afb. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +162, Tests +138, Docs +4, Other +181. Total +485 across 26 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 16, 2026, 10:19 PM ET / November 17, 2026, 03:19 UTC (Revision 2). |
|
Addressed every item in the latest ClawSweeper review on 73bdceb, including the landed #200335 integration:
The additional permission-policy documentation finding is corrected in managed-worktrees.md. Sanitized shipped-entry-point results (separate CLI processes, synthetic data only): All 78 integrated worktree tests pass, as does core typecheck. Fresh Codex autoreview of the complete integrated diff is clean through P2. Exact-head CI is running at https://github.com/openclaw/openclaw/actions/runs/44007250774. The final expanded local check and refreshed synthetic paired timing run remain in progress; these are not being represented as completed or green. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…aw#200350) * fix(worktrees): stop retrying preserved checkouts Record nested repositories as terminal preservation in the existing cleanup receipt. Cap missing-object and permission retries at three attempts, expose the reason to administrators, and require preserved contents before capacity or forced removal of these failures. No schema migration or configuration change. * fix: preserve explicit cleanup recovery and diagnostics
What Problem This Solves
Managed checkout cleanup keeps retrying snapshot refusals that require human repair. Nested repositories, unavailable Git objects and unreadable files remain safely preserved, but indefinite retries waste snapshot work and hide why disk space is not being reclaimed.
Related: #189288, #200299. Integrated with the landed checkout-custody changes in #200335.
User Impact
User impact: administrators can see why cleanup retained a checkout and when automatic retries have stopped. Nested repositories are preserved immediately; missing/corrupt objects and permission failures receive three attempts with 2h/4h backoff, then remain preserved. After repair, run
openclaw worktrees gc --retry-deferredto reopen cleanup, including when capacity is exceeded.Preserved files still occupy disk until an operator resolves them. These safety refusals also prevent force removal. No schema, migration, configuration or cache is added. The existing cleanup receipt stores the typed reason and terminal retry state; CLI status and administrator Gateway results expose the outcome.
Why This Change Was Made
The retry owner capped delays but never capped attempts. Typed snapshot refusals now reach that owner through the existing worker error transport. Both direct removal and capacity eviction record the outcome while holding checkout custody; automatic cleanup honors it before inspecting files. Explicit retry clears an obsolete receipt so a repaired checkout is not permanently blocked by an earlier failure.
Terminal preservation is the bounded option for nested Git repositories: a lossless nested snapshot would also need to preserve their refs, unreachable objects, alternate stores and linked worktrees. No checkout is removed without preserving its content.
Evidence
Real service/Git/registry regressions fail before the fix and pass afterward for nested preservation, capped missing-object/permission retries, and force-removal safety. The integrated focused worktree suites pass 78 tests. Wrapper closure and unreadable-path CLI regressions pass; affected CLI/Gateway mappings and UI browser/e2e consumers were checked. Codex autoreview is clean through P2 on the integrated diff.
A synthetic latest-stable
2026.11.4CLI upgrade preserved the existing registry row, inner Git history and file hashes. Fresh CLI processes retained terminal receipts; automatic GC above capacity made no repeated attempts; after repair, explicit retry safely removed the selected checkout, and restore recovered its tracked content. The sibling's unsaved files remained intact. Doctor used the existing backed-up migration and skipped service management for the isolated state/config. No live deployment or user data was used.Production-shaped synthetic btrfs proof uses 62,000 files / 1.1GB, 5,000 sessions / 35.11GiB DB, A/A controls and five interleaved A/B pairs. For missing objects, six failing baseline attempts become three attempts followed by unchanged terminal receipts. Late-sweep medians: wall 1804→753ms, process CPU 1993→953ms, main allocation 24.83→4.81MB. CPU excludes Git children; allocations exclude worker isolates; the DB is size-shaped with sparse transcript content. A/A wall3059/2592ms shows substantial host/cache noise, so operation counts are stronger than a production speedup claim. Nested late-sweep medians are 1055→719ms, CPU 1215→941ms, allocation 6.30→6.13MB; its baseline already avoids repeated snapshots through GC preflight, while the candidate records a durable typed terminal state. Runtime delta against the integrated baseline is +162 lines, covering typed outcomes, bounded persistence, recovery and status visibility.
Exact-head CI run is red only for the existing capacity concurrency test (
service.capacity.test.ts:469, expected one successful create, received zero) and its aggregate gate. It reproduces on exact integrated main parent9f441adc; the immediately preceding commit passes all24 tests. The introduction is #200335 (9f441adc), which narrowed allocation custody. The precise CI main parent6ba51132also reproduces the identical assertion in a bounded repetition of the original case, with unchanged production sources. Both requests reject at the4GiB safety reserve. The remaining repeats were stopped after two reproductions; passing isolated replays are not treated as a fix. The test and four allocation owners are byte-identical between main and the tested merge. This is an inherited main regression requiring follow-up, not a waived PR failure. Security-fast and all other selected jobs pass.Final narrow
pnpm check:changed --base 9f441adcpasses every scoped gate (format, types, lint and structural/database ratchets); the full command exits1 only for six inherited dead-export diagnostic entries. All are also present on the exact main baseline, with no new entries. ClawSweeper's final-head re-review has zero open items and accepts the shipped-entry-point/upgrade proof. Native landing uses the explicitly authorized, pinned inherited-failure route and retains both red results honestly.