Repository navigation
fix(sandbox): prevent missing workspace baselines after cleanup - #186278
Conversation
|
🦞👀 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 SummaryThis 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. |
|
Codex review: blocked before merge. What this changesThis PR rejects expired workspace preparations before publication and reconstructs missing baselines from verified pending checkpoints. Example: Workspace packs are prepared at sweep epoch 4, then cleanup advances to epoch 6 before publication.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a concrete workspace publication failure still present on main, and no definite introduced correctness or security defect was found. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe local workspace owner scans canonical and sandbox files, prepares immutable SQLite manifest packs, and publishes baseline or checkpoint references through the existing worker transaction. flowchart TD
A[Canonical and sandbox files] --> B[Manifest scan worker]
B --> C[Immutable pack preparation]
C --> D[Publication transaction]
E[Epoch cleanup] --> C
E --> D
D --> F[Saved baseline and checkpoint]
Technical reviewBest possible solution: Retain the existing epoch and transaction owners, reject expired publications, and repair only an exactly verified saved baseline. Do we have a high-confidence way to reproduce the issue? Source establishes that preparation and publication use separate transactions while cleanup can collect unpublished content after two sweeps; the supplied deterministic regression exercises that ordering. Is this the best way to solve the issue? The patch uses the smallest existing owners for the two failures: one transactional expiration check prevents invalid publication, and authenticated checkpoint reversal extends exact-baseline recovery without modifying live files. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a189175a709b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +79, Tests -13, Docs +18. Total +84 across 11 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 27, 2026, 4:45 PM ET / 20:45 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…claw#186278) * fix(sandbox): prevent missing workspace baselines after cleanup * perf(sandbox): read saved checkpoints only for baseline repair
What Problem This Solves
Fixes sandboxed managed sessions becoming stuck when manifest cleanup collects a stalled preparation before its baseline or checkpoint is published.
User Impact
A stale preparation now fails before publishing references to missing content, and retrying the session prepares the preserved live files again. Older missing baselines can recover from an intact pending-checkpoint result without discarding either workspace's edits. Unverifiable divergence still refuses recovery and reports both preserved paths with an inspection command.
Why This Change Was Made
Immutable pack preparation and root publication use separate worker transactions. Packs prepared at sweep epoch E are collectible at E+2, but publication previously accepted their digest without checking that window. Preparation now returns its epoch, and the writer checks the oldest preparation epoch before any mutation. Ordinary manifest reads omit the potentially large checkpoint payload; only repair requests load it. The existing schema, retention window, lease checks, and commit settlement remain unchanged.
Recovery can reverse an authenticated checkpoint delta in memory when a live workspace matches its resulting tree. It publishes repaired CAS metadata only if the reconstructed tree matches the saved baseline digest. Comparing or recreating workspaces cannot recover an unknown three-way merge base; no automatic selection between divergent edits is introduced.
Evidence
local-workspace-{store,manifest-scan,cas,conversion,projection}.test.tsthroughnode scripts/run-vitest.mjs ... --maxWorkers=1: 82 passed, 2 preexisting environment skips; 393.36s suite time / 423.38s wrapper wall time. The skipped cases require real Podman or raw non-UTF-8 filenames unsupported by this filesystem.test/tsconfig/tsconfig.core.test.gateway-other.jsonwith only the nine touched TypeScript files: passed. Focusedrun-oxlint.mjs,run-format.mts --checkfor all 11 changed files, andgit diff --check: passed.451ec41c26c67cca7d8a61b7da6b0188cf52249e, with complete publication/GC/recovery context: no actionable P0/P1 findings.e242a31b008570e7938a8d946ee44f79d7cbdff0found no actionable P0/P1 findings.CI Classification
Exact-head CI run 40578654178, attempt 1, failed only
check-lint-core-2(job 122454243417) and its downstreamopenclaw/ci-gate;security-fastpassed. The root failure is fiveeslint(curly)errors inui/src/pages/new-session/draft-body.browser.test.tsx(lines 31–32) andui/src/pages/chat/chat-content-column.browser.test.tsx(lines 288–289 and 362). Reactive-use and max-lines diagnostics are warnings.Core stripe 4/5 was run locally on CI's main parent
5010c3e80f8bb2271bbd347d4639218f84f9fac4and reproduced exactly those five errors, including identical files, messages, and locations. The UI tree, lint rule/configuration owners, dependency manifests, and warning-source objects are identical between that parent and tested mergefb4746a70ec39bf378a50ceac661e2a71857c89c, whose second parent is the reviewed headf1a6f74fafbce52ff582af01a7ad4815f44549a7. These failures are unrelated to this worker-environment fix. CI remains failed; the authorized native pre-existing-failure exception is selected. No CI rerun or branch update was used.