Repository navigation
test(infra): clean exec approval temp roots - #113342
Conversation
|
Codex review: needs changes before merge. Reviewed August 2, 2026, 10:51 PM ET / August 3, 2026, 02:51 UTC. ClawSweeper reviewWhat this changesThe PR tracks temporary directories made by the shared exec-approval test fixture and removes them after each Vitest test. Merge readinessKeep this PR open: it solves real test-fixture leakage and includes credible after-fix proof, but its direct cleanup loop bypasses OpenClaw’s canonical retrying temporary-directory cleanup policy. The protected Priority: P3 Review scores
Verification
How this fits togetherExec-approval tests create real executable directories in the operating-system temporary root, then pass those paths into command-resolution and approval-policy code. The shared fixture serves multiple test suites, so it should own cleanup of the roots it creates without making every consumer implement teardown. flowchart LR
A[Exec-approval tests] --> B[Shared fixture helper]
B --> C[Temporary executable directory]
C --> D[Command-resolution tests]
D --> E[After-each cleanup]
E --> F[Operating-system temp root]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +14. Total +14 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep lifecycle ownership in the shared fixture, but have its hook call Do we have a high-confidence way to reproduce the issue? Yes, from source: current main’s shared fixture creates Is this the best way to solve the issue? No: centralizing cleanup in the fixture is the right owner boundary, but directly calling Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 443821f49b63. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
b22c185 to
6569792
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
The shared exec-approval fixture helper creates canonical real temporary directories for twelve consumer suites but did not own their lifecycle. Repeated tests therefore left
openclaw-exec-approvals-*roots behind, while two consumers attempted narrower one-off deletion loops.Why This Change Was Made
The shared producer now tracks only the canonical real paths it creates in a module-local
Set, registers one VitestafterEach, and delegates deletion exclusively tocleanupTempDirs. That repository helper owns recursive force removal, bounded retry/backoff, and collection clearing. The two consumer-localrmSyncloops were removed so this fixture class has one cleanup spelling.This directly addresses ClawSweeper's retry-policy finding and keeps lifecycle ownership at the producer rather than relying on every importer.
ClawSweeper's rank-up moves are addressed: deletion now uses
cleanupTempDirs, every current importer passed, the clean-box no-roots assertion passed, and normal maintainer handling continues through the repository-native landing flow.User Impact
Developers and CI workers no longer accumulate exec-approval fixture directories across tests. Production behavior is unchanged.
Windows cleanup is the main risk. The canonical helper uses Node recursive
fs.rmSyncwithforce: true,maxRetries: 5, andretryDelay: 20; Node 24 documents linear-backoff retries forEBUSY,EMFILE,ENFILE,ENOTEMPTY, andEPERM. A native Azure Windows proof was attempted, but the broker rejected the Windows image selector before creating a lease with HTTP 403admin_required. No Windows runtime pass is claimed.Evidence
node scripts/run-vitest.mjs src/infra/exec-approvals-config.test.ts -- -t 'exec approval temp fixture cleanup'):Tests 1 failed | 1 passed | 24 skipped[vitest] FAILED (exit 1)Tests 2 passed | 24 skipped[test] passed 1 Vitest shard in 4.05s[test] passed 2 Vitest shards in 9.91stbx_01kzk7h9b9b2m4h097f26vqak1no openclaw-exec-approvals-* roots remainrunStatus: succeeded,exitCode: 0node scripts/check-changed.mjs):tbx_01kzk71914g2z2be8mp6w5ab9a0 warnings and 0 errorsrunStatus: succeeded,exitCode: 0git diff --check: passed.656979297c5456ac57117599a4fd8a08b1102820: clean after one round; no accepted/actionable findings, confidence 0.99.node scripts/watch-pr-ci.mjs 113342 656979297c5456ac57117599a4fd8a08b1102820):GREEN,pending=0.AI-assisted: yes.