Skip to content

fix: managed npm LSP installs - #27

Merged
ian-pascoe merged 1 commit into
mainfrom
codex/fix-lsp-managed-npm-installs
Jul 4, 2026
Merged

fix: managed npm LSP installs#27
ian-pascoe merged 1 commit into
mainfrom
codex/fix-lsp-managed-npm-installs

Conversation

@ian-pascoe

Copy link
Copy Markdown
Contributor

Summary

  • isolate managed npm language-server installs from inherited user npm config
  • capture bounded npm stdout/stderr so install failures include actionable details
  • add installer regression coverage and a patch changeset

Root Cause

The managed npm installer ran npm install --ignore-scripts --prefix <cache> <package>@<version> while inheriting user npm config. On this machine, allow-scripts=@nubjs/nub caused npm 11 to reject the project-scoped install with EALLOWSCRIPTS. The installer used stdio: "ignore", so downstream callers only saw an opaque exit code.

Validation

  • pnpm test tests/unit/installer.test.ts
  • pnpm run typecheck
  • pnpm run lint
  • pnpm run format:check
  • pnpm run build
  • pre-push hook: oxfmt . --check, oxlint ., tsgo -p tsconfig.json --noEmit, vitest run (27 files, 335 tests), pnpm run build

@ian-pascoe
ian-pascoe marked this pull request as ready for review July 4, 2026 11:54
@ian-pascoe ian-pascoe changed the title [codex] Fix managed npm LSP installs fix: managed npm LSP installs Jul 4, 2026
@ian-pascoe

Copy link
Copy Markdown
Contributor Author

@codex review for bugs and security vulns

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ead97a61c1

ℹ️ 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".

resolve();
return;
}
const detail = compactInstallOutput(stderr) || compactInstallOutput(stdout);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wait for stdio close before reporting npm failure

With stdio switched to pipes, building the error detail in the exit handler can run before the child stdout/stderr streams have closed, so npm failures that write diagnostics as the process terminates can still surface the old opaque message or a truncated one. This affects the managed install failure path this patch is trying to improve; wait for close (or otherwise wait for both streams to finish) before calling compactInstallOutput.

Useful? React with 👍 / 👎.

@ian-pascoe
ian-pascoe merged commit e519bd2 into main Jul 4, 2026
3 checks passed
@ian-pascoe
ian-pascoe deleted the codex/fix-lsp-managed-npm-installs branch July 4, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant