Repository navigation
fix(repair): suppress target pnpmfile via npm_config env spelling - #1068
Conversation
pnpm 11 only honors npm_config_* environment settings, so the PNPM_CONFIG_IGNORE_PNPMFILE key in codexSubprocessEnv() was inert and a target repository's .pnpmfile.cjs could execute arbitrary code during repair installs (caught by the pnpm-deploy hook containment test). Scripts suppression only survived through the redundant npm_config_ignore_scripts key. Add npm_config_ignore_pnpmfile alongside the retained PNPM_CONFIG_* belt-and-braces keys, and make the test's unsafe-pnpmfile leg disable the spelling pnpm actually reads.
|
Codex review: needs real behavior proof before merge. Reviewed August 8, 2026, 2:17 AM ET / 06:17 UTC. ClawSweeper reviewWhat this changesThe PR sets Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep open. The small containment fix aligns Codex-launched pnpm deploys with the repair lane’s existing explicit Priority: P1 Review scores
Verification
How this fits togetherClawSweeper’s repair lane gives Codex a restricted subprocess environment before it runs package-manager commands in a target checkout. That environment is intended to prevent target install hooks and pnpmfiles from executing code during repair work. flowchart LR
A[Repair job] --> B[Codex subprocess environment]
B --> C[pnpm deploy in target checkout]
C --> D[pnpmfile suppression]
D --> E[Target hook execution]
E --> F[Contained repair result]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the environment-level fail-closed setting, remove the release-owned changelog edit, and attach a redacted current-head local-container trace proving that a target pnpmfile cannot alter Git configuration. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the focused fixture runs pnpm deploy against a target pnpmfile that changes Git configuration, but this read-only review did not independently execute it. Is this the best way to solve the issue? Yes. Environment-level suppression is the narrow maintainable boundary for arbitrary pnpm commands launched by Codex, and it matches the repair lane’s existing explicit pnpmfile suppression. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 62acb03356bb. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
|
Problem
test/repair/process-env.test.ts("Codex subprocess prevents pnpm deploy from installing target Git hooks") fails reproducibly on current main: the pnpmfile leg of the containment test observes a target.pnpmfile.cjsexecuting and installingcore.hooksPathdespitecodexSubprocessEnv()suppression.This is not the
@pnpm/exemirror resolution issue — the fixture deploys a local workspace package with no registry access, and the deploy succeeds; the containment assertion afterwards is what fails.Root cause
pnpm 11.10.0 (the pinned version) does not honor
PNPM_CONFIG_*environment settings at all — verified empirically for bothPNPM_CONFIG_IGNORE_PNPMFILEandPNPM_CONFIG_IGNORE_SCRIPTSagainstpnpm deploy. Onlynpm_config_*spellings (case-insensitive) and CLI flags work.Lifecycle-script suppression silently survived via the redundant
npm_config_ignore_scriptskey; pnpmfile suppression had no working spelling, so a target repository's.pnpmfile.cjscould run arbitrary code during Codex-driven installs.Fix
codexSubprocessEnv()now also setsnpm_config_ignore_pnpmfile=true; thePNPM_CONFIG_*keys stay as belt-and-braces for pnpm versions in target repos that may read them.false, and the unsafe-pnpmfile leg now disables the spelling pnpm actually reads.Proof
node --test test/repair/process-env.test.ts— 7/7 pass (previously failing).pnpm run check— exit 0.