Skip to content

fix(update): harden npm cache recovery preflight logs - #557

Draft
lidge-jun wants to merge 16 commits into
devfrom
codex/pr533-update-recovery-hardening
Draft

fix(update): harden npm cache recovery preflight logs#557
lidge-jun wants to merge 16 commits into
devfrom
codex/pr533-update-recovery-hardening

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Maintainer takeover follow-up for #533. This keeps the contributor PR unmerged and addresses the two high-severity review blockers from the latest Wibias review:

  • fail closed when the npm cache is same-UID but not effectively readable/searchable/writable before any proxy stop path runs
  • sanitize persisted update job command/log/error fields so installer output does not retain raw home/cache paths or uid/gid values

The medium policy question around nonzero installer recovery behavior is intentionally left for maintainer review; this PR is draft and should not be merged automatically.

Verification

  • bun test tests/update-npm-cache-preflight.test.ts tests/update-job.test.ts → 70 pass / 0 fail
  • bun test tests/update-npm-cache-preflight.test.ts tests/update-stop-first.test.ts tests/update-job.test.ts tests/update-install-process.test.ts tests/config.test.ts tests/ocx-launcher-source.test.ts tests/windows-deploy-close-regressions.test.ts → 162 pass / 0 fail
  • bun x tsc --noEmit → pass
  • git diff --check origin/dev...HEAD → pass
  • bun run privacy:scan → pass
  • pre-push bun scripts/test.ts → 5127 pass / 0 fail
  • pre-push React Doctor changed scope → no issues found

Refs #533.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dbe26b3b-2269-4239-96ad-578488ac10e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pr533-update-recovery-hardening

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

@github-actions github-actions Bot added the bug Something isn't working label Jul 27, 2026
@WZBbiao

WZBbiao commented Jul 28, 2026

Copy link
Copy Markdown

Thanks for taking over this change. I agree that #557 should be the merge vehicle.

For the remaining nonzero-installer policy, I recommend keeping the current fail-closed behavior and documenting the manual recovery path. Without reliable descendant containment, automatically starting a recovery package could race with an installer process that is still mutating the global package tree.

Once #557 is ready and merged, #533 can be closed as superseded. Please also retain attribution to #533 and @WZBbiao in the PR description and final merge commit. The imported commits currently preserve the original wzb author identity, but GitHub does not link that email to the WZBbiao account.

Alvin0412 pushed a commit to Alvin0412/opencodex that referenced this pull request Jul 28, 2026
WP1 docs-only cycle. Five decade docs at diff-level precision, ordered by
dependency (auth gate -> response layer -> adapter -> PR cleanup) rather
than effort:

- 010 SSH remote proxy: isLoopbackRequestHost couples loopback identity to
  port equality, so ssh -L on a different local port 403s the whole /v1/*
  data plane. The sibling isLoopbackOriginValue already dropped its port
  check in e4e0612 for the same reason.
- 020 issue lidge-jun#553: the same three-line 'Provider unreachable' shape repeats
  at core.ts 1197/1746/1788; fold into one helper and give
  ERR_TLS_CERT_ALTNAME_INVALID its own wording plus a verification command.
- 030 issue lidge-jun#545: the anthropic adapter prepends the Claude Code identity
  unconditionally on OAuth, so a classifier that already carries it loses
  output budget it capped at 64 tokens and retries.
- 040 PR lidge-jun#527: its first commit already landed on dev as 9dd3c42, which
  is what makes the branch dirty; rebase keeping only a64aa58.
- 050 PR lidge-jun#557: no code work remains, only a security-boundary decision.

No production code changed in this cycle.
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.

2 participants