fix(install-cli): track mktemp paths and clean up on EXIT#103725
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 8:34 PM ET / July 11, 2026, 00:34 UTC. Summary PR surface: Tests +61, Other +14. Total +75 across 2 files. Reproducibility: yes. Current main visibly allocates both temporary paths before fallible operations without EXIT cleanup, and the contributor’s terminal proof exercises the production Node staging path and observes the registered directory removed after forced failure. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge the centralized parent-shell cleanup and focused regression tests once the required exact-head checks complete successfully. Do we have a high-confidence way to reproduce the issue? Yes. Current main visibly allocates both temporary paths before fallible operations without EXIT cleanup, and the contributor’s terminal proof exercises the production Node staging path and observes the registered directory removed after forced failure. Is this the best way to solve the issue? Yes. Parent-shell registration is the narrowest maintainable solution because it matches AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b7d6291bfd6e. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +61, Other +14. Total +75 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
|
@clawsweeper re-review Updated PR body with authored What Problem This Solves + Evidence, and fixed temp registration so TMPFILES+= runs in the parent shell (command-substitution helpers were a no-op). |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated Evidence with forced failure through the real installer (OPENCLAW_INSTALL_CLI_SH_NO_RUN source + fail() after TMPFILES registration). Before leak vs after CLEANED terminal output included. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Proof now forces failure on the production |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fd9a6b3 to
c095c66
Compare
0bfe448 to
2444c8a
Compare
2444c8a to
63396f8
Compare
|
Land-ready proof for What changed:
Validation:
Known gap: no live checksum-mismatch download was induced. Both production temporary-path owners are covered at their failure boundary. CI attempt 1 hit an unrelated fs-safe test flake; the isolated rerun passed without code changes. |
|
Merged via squash.
|
* origin/main: fix(tui): preserve UTF-16 pairs in long tokens (#104024) fix(release): raise Telegram attestor buffer (#104025) fix(slack): apply sender policy to group DMs (#104007) feat(ui): add a background tasks pane to chat panes (#104010) docs(changelog): credit landed fixes fix(installer): clean temporary files on failure (#103725) fix(clickclack): sanitize outbound assistant text (#103142) fix(sms): normalize Twilio RCS webhook senders (#102373)
What Problem This Solves
scripts/install-cli.shcreates temporary paths for user-space Node staging and pnpm workspace rewrites. Failure aftermktempcould exit without removing those paths, leaving installer debris under the system temporary directory.Why This Change Was Made
The installer now owns one EXIT cleanup list. Each direct caller registers its temporary path in the parent shell immediately after creation, avoiding command-substitution subshell state and giving every later failure path the same cleanup behavior.
User Impact
Failed CLI installs no longer leak Node staging directories or pnpm workspace rewrite files. Successful installs retain their existing behavior.
Evidence
prepare-runpassed.No live Node tarball checksum failure was induced; the regressions cover both temporary-path owners at their production failure boundaries.
CI attempt 1 hit an unrelated
apply-patch.test.tsfs-safe unhandled-rejection flake; the isolated rerun passed without code changes.AI-assisted.