Skip to content

fix(codex): keep npm Node cache within inspection lifetime - #7585

Merged
lidge-jun merged 1 commit into
devfrom
codex/cli-update-stack-cache-20261023
Oct 23, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/cli-update-stack-cache-20261023

Conversation

@luvs01

@luvs01 luvs01 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Keep npm-spawned Node compile-cache writes within the inspection's owned temporary directory, so cleanup removes them with the npm metadata lifetime. Preserve the caller's independent npm configuration isolation.
  • This replaces fix(codex): keep npm Node cache within inspection lifetime #7562 as the same patch on an upstream-hosted parent branch for dependent CLI-update work. The original c129c1e and this commit have the same stable patch ID; no new runtime behavior was added during the move.

Verification

  • Bun 1.4.3 on Windows: plan and zero-effect tests passed 61 cases with 1 platform skip and 349 assertions on this new base.
  • bun run typecheck, bun run structure:check, bun run privacy:scan, and git diff HEAD^ HEAD --check passed.
  • The parent patch still changes the same three files, with 55 additions and 5 deletions. The previous PR's hosted CI is not counted as validation of this new commit.
  • Ubuntu CI run 39892411829 completed successfully for source HEAD d5e5b4158a713c4bf805f50826b24cf2698a942b. The actual checkout was refs/pull/7585/merge at 65597fc12bdbd1e15ff727825add817ca8ccd270, with base parent c51b0b4c875469548e70219a1be276a2395490d2 and source parent d5e5b4158a713c4bf805f50826b24cf2698a942b. All four Ubuntu test shards, the final CI aggregate, Typecheck, privacy, structure, storage policy, and Docker smoke passed. The macOS and Windows full test matrices were not run.
  • A full local suite was deferred because this Windows host shares dependencies and capacity with concurrent worktrees; focused cache lifetime and no-effect checks cover this patch locally, and the completed Ubuntu suite provides broader integration coverage. Real npm startup is exercised with fixed --version --offline arguments and synthetic registry replies; this verifies cache ownership and cleanup, not registry authenticity or a complete installation.
  • Rechecked both PR diffs: all three files and their added/removed patch content are preserved, with identical stable patch ID 699d364878085768767b6302b6c0ad7c2b813b27. No unresolved inline findings or submitted change requests were present at the readiness check; automated review may follow Ready.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes
    • CLI updates now keep Node’s compile-cache files inside the isolated temporary workspace. This prevents update-related cache files from being left in standard system locations and allows them to be cleaned up with the rest of the temporary update files.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between c51b0b4 and d5e5b41.

📒 Files selected for processing: 3
  • src/codex/cli-update-plan.ts
  • structure/codex-cli-update.md
  • tests/codex-integration/codex-cli-update-plan.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The npm update environment now directs Node’s compile cache into the isolated temporary root. Integration tests check the configured path and verify that cache files do not remain in ambient locations.

Changes: npm Cache Isolation

Layer / File(s) Summary
Isolated environment and validation
src/codex/cli-update-plan.ts, structure/codex-cli-update.md, tests/codex-integration/codex-cli-update-plan.test.ts
The resolver sets NODE_COMPILE_CACHE to a path inside the isolated root. Documentation describes the separate npm and Node caches. Tests check the configured path, run a real npm startup probe, and verify cache cleanup and residue.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d5e5b

The npm update cache-isolation change is mergeable after normal checks; no actionable issue remains identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately and concisely describes the main change: keeping npm-spawned Node compile-cache files within the inspection lifetime for cleanup.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete three-file diff at d5e5b4158a713c4bf805f50826b24cf2698a942b. The npm child replaces the ambient Node compile-cache path with an absolute path under its existing owned isolation directory, so npm-enabled cache output shares that directory's cleanup lifetime. The existing npm config isolation and supported proxy/CA inputs remain separate; no dependency or registry endpoint is changed. The structure contract matches.

Independent capped Linux/Bun 1.4.3: bun test tests/codex-integration/codex-cli-update-plan.test.ts -t 'npm and Node caches|real npm startup' — 2 pass / 55 filtered / 0 fail / 18 assertions. This executes the real npm startup control with --version --offline, synthetic registry evidence and disposable homes; it proves cache ownership/cleanup, not package authenticity or installation. Current-head hosted CI 39892411829, including gates/Typecheck, succeeded; no unresolved thread or standing change request was present.

Full local suite/typecheck were not repeated under the shared host limits. Broader Ubuntu coverage is the completed hosted run; macOS/Windows and a later dev union are not newly certified here. No real runtime configuration or service was changed.

@lidge-jun
lidge-jun merged commit 3ddcf5b into dev Oct 23, 2026
41 checks passed
@lidge-jun
lidge-jun deleted the codex/cli-update-stack-cache-20261023 branch October 23, 2026 07:27
@luvs01
luvs01 restored the codex/cli-update-stack-cache-20261023 branch October 23, 2026 08:03
@luvs01
luvs01 deleted the codex/cli-update-stack-cache-20261023 branch October 23, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants