Repository navigation
fix: keep test compiler caches out of workspace synchronization - #176802
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: needs maintainer review before merge. What this changesThis PR excludes three generated test outputs and their cache-only parent directories from workspace capture and retained-result recovery. Example: A test run produces .artifacts/vitest-worker-cache/run-cache-0/outputs/dist/worker.js alongside source.txt.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it addresses a current workspace synchronization defect through the existing owner, and inspection found no definite introduced bug. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway workspace owner captures local and remote filesystem inventories, authenticates retained manifests, and reconciles eligible source changes into the managed checkout. flowchart TD
A[Test tools generate caches] --> B[Workspace inventory]
B --> C[Shared path projection]
D[Authenticated historical manifests] --> C
C --> E[Eligible workspace changes]
E --> F[Reconciliation and recovery]
Technical reviewBest possible solution: Extend the existing exact-root classifier and shared manifest projection while preserving authenticated receipts, authored files, staged inputs, and genuine empty directories. Do we have a high-confidence way to reproduce the issue? Current-main producer paths and exclusions establish the mismatch, and the linked report records cache-bearing pending results; this review did not independently execute the reproduction. Is this the best way to solve the issue? The smallest complete fix uses the existing classification owner plus one serializable projection shared by local parsing and remote capture; the added tests cover distinct producer, transport, empty-directory, and historical-recovery failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b34a4659de9c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +36, Tests +244, Docs +2. Total +282 across 9 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 October 18, 2026, 11:24 PM ET / October 19, 2026, 03:24 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: generated test caches no longer block workspace synchronization or recovery of preserved source changes. |
…claw#176802) Keep generated test compiler caches out of workspace synchronization and recovery while preserving source changes, reports and genuine conflicts. Refs openclaw#176778.
Refs #176778.
What Problem This Solves
Ordinary tests can leave disposable compiler caches in a managed workspace's pending changes. If the host later removes a cache directory that an older result still records, synchronization treats its changed descendants as conflicting work. Review and refresh can then remain blocked even when the actual source edits already agree.
The missing paths are
.artifacts/vitest-worker-cache/,.cache/bun-transpiler/, and the generated.artifacts/vitest-shard-timings.jsonscheduler data. Existing exclusions cover other test caches but not these current producer outputs.User Impact
These test caches stay with the runtime that created them instead of becoming authored workspace results. The existing recovery path also recognizes them in older authenticated results, allowing the preserved source work to settle normally.
Source edits, ignored reports and logs, nested fixtures, explicitly staged inputs, genuine source conflicts, and invalid-result rejection remain protected. The change does not exclude all ignored files or general
.artifacts,.cache, ordistcontents.Why This Change Was Made
Capture, transfer, manifest comparison, staged-result validation and recovery already use one shared classification rule. The rule now covers the three verified producer paths. Historical manifest projection and remote non-Git capture also omit parent directories whose contents are entirely excluded caches, while retaining genuine empty directories. This keeps the existing capture paths consistent without relocating caches or adding another synchronization mechanism.
The recovery regression retains the original manifest bytes and digest, with the cache-only parent absent from the host. Raw manifest validation and authentication still happen before projection; actual obstructions continue to conflict. A producer check calls the existing worker-cache retention, test-process environment and shard-timing writers, then captures their output through the workspace owner. That connects the exclusion to the paths the tools actually select.
Evidence
On the original production source, authenticated pending-result settlement returns the preserved-workspace conflict, and cache-only expiry fails as unaccepted work. The corrected source passes those same recovery paths, including the case where source changes were already copied, while keeping independent source-conflict and malformed-tree controls.
Remote Linux validation passed:
The literal-file batches use the existing native test runner; equivalent focused commands include
pnpm test src/gateway/worker-environments/workspace-generated-paths.test.ts --maxWorkers=1andpnpm test test/scripts/workspace-test-caches.test.ts --maxWorkers=1(the latter's final Vitest wall time was 1.01 seconds).Independent review is clean after two corrected findings; the scoped automated review is also clean. Current-head CI passed every selected family except an inherited mock-export ratchet in
test/scripts/ci-node-test-plan.test.tsand its aggregate status. The identical failure was reproduced on unchanged upstream source; this patch changes none of its causal inputs. ClawSweeper reported no findings, with Gold overall and Platinum patch quality. A containing-runtime guest recheck follows source delivery; no running server was changed by this PR. Initial fixture setup, typing and formatting failures were corrected and retained in the validation record.