fix: codex update targets correct npm prefix on multi-prefix systems - #132
Conversation
Adds explicit --prefix flag to npm install -g in installTarget(), derived from packageDir. Fixes update on machines with multiple npm global prefixes where the wrong prefix was silently updated instead of the running installation. Includes fixture-based regression tests (prefixA/prefixB isolation via fake npm binary). Version bump and npm publish deferred to next upstream release per project policy. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bef7635665
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const latestAuditedVersion = manifest.latest_audited_version; | ||
| const testVersion = '0.144.4'; // Older version for testing | ||
|
|
||
| test('installTarget with prefixA uses correct --prefix', async (t) => { |
There was a problem hiding this comment.
Run the new updater tests in CI
In the checked .github/workflows/npm-package.yml workflow, the syntax-check step explicitly runs only sync-public-release-from-manifest.test.js and magi-node-launcher.test.js, and this package has no test script that discovers suites automatically. Consequently, this newly added prefix regression suite is never executed on pull requests or pushes, so regressions in the behavior it covers can pass CI; add node --test lib/check-updates.test.js to that workflow.
Useful? React with 👍 / 👎.
Summary
--prefixflag tonpm install -gininstallTarget(), derived frompackageDirprefixA/prefixBisolation via fake npm binary)Test plan
npm pack→ install → verify update targets correct prefix (not needed for code review, test fixtures cover scenarios)🤖 Generated with Claude Code