Skip to content

[Bug]: pnpm global-store links fail updater package verification #8183

Closed

Description

@oliver-mee

Client or integration

Other: OpenCodex CLI

Area

Installation or packaging

Summary

ocx update rejects a working pnpm global installation before it reaches the update. The verifier reports missing Bun and Zod even though both are linked in the package's pnpm global virtual-store dependency directory and the CLI and proxy start successfully. The proxy is left running.

Reproduction

  1. Install @bitkyc08/opencodex globally with pnpm 12 using a global virtual store. In the affected installation, the active package is a symlink into store/v11/links/.../node_modules/@bitkyc08/opencodex; its sibling node_modules/bun and node_modules/zod are valid links.
  2. Start the proxy and run ocx update --tag latest.
  3. The updater reports that the active package failed verification and exits before stopping the proxy. This occurs with both 2.96.0 and 2.97.0. A direct call to verifyPnpmInstallTree reports the two missing sentinel dependencies.

Expected: the verifier recognises the package's pnpm-owned dependency links and allows a valid installation to proceed, while retaining its ownership and integrity checks.

The verifier treats an enclosing node_modules as pnpm-owned only if it contains .pnpm or .modules.yaml, or is beneath .pnpm. The affected global-store link directory has neither marker. This looks like a layout not covered by the fix in #4235. The same checks are present on main at cab7eb7d0332ae0ebb4289d7c6bac1de666b6e40; the live reproduction was on the published package, not a clean source checkout.

Version

2.96.0 and 2.97.0

Operating system

Ubuntu 24.04.5 LTS, Linux arm64, pnpm 12.16.1

Provider and model

Not applicable.

Logs or error output

opencodex: the active pnpm package failed verification; aborting before stopping the proxy.

The verifier's failure list is sentinel dependency missing: bun and sentinel dependency missing: zod.

Screenshots and supporting files

None.

Redacted configuration

pnpm global virtual-store layout as described above.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    bug
    install
    on Nov 5, 2026
  3. Ingwannu commented on Nov 7, 2026

    @Ingwannu
    Owner

    Confirmed on dev (aaa3c20f3f). The update path recognizes the pnpm global virtual-store layout. install-detection.mjs:255 matches store/v<N>/links/, and tests/update/update-pnpm.test.ts:45 covers .../store/v11/links/@bitkyc08/opencodex/<version>/node_modules/@bitkyc08/opencodex. The verifier does not:

    • ownedDependencyRoots adds the realpath's enclosing node_modules only when isPnpmManagedRoot accepts it (src/update/transactional-install.mjs:78-90, line 88).
    • isPnpmManagedRoot accepts only a path below .pnpm, or a directory that contains .pnpm or .modules.yaml (transactional-install.mjs:65-69).

    A store/v<N>/links/.../node_modules group has none of these markers. The sibling bun and zod links are never probed, so verifyPnpmInstallTree reports both sentinels as missing. Its own docstring (transactional-install.mjs:156-160) says it supports global virtual-store links.

    A narrow fix is to treat an enclosing node_modules inside a pnpm store/v<N>/links/ tree as pnpm-owned. It should apply to the realpath group only, so an unrelated ancestor install stays excluded. It also needs a verifier regression for this layout. To make sure the fixture matches your tree, please post the redacted output of realpath "$(pnpm root -g)/@bitkyc08/opencodex" (replace the home directory with ~). In particular, show whether a hash segment appears between the version and node_modules.

  4. Ingwannu commented on Nov 7, 2026

    @Ingwannu
    Owner

    Fix proposed in #8298: the pnpm verifier now treats the package's realpath node_modules group as pnpm-owned when it sits inside a store/v<N>/links/ tree, with regression tests for this layout and its boundaries. The redacted realpath output requested above is still welcome to confirm the fixture matches your tree; the fix does not depend on whether a hash segment is present.

  5. oliver-mee commented on Nov 10, 2026

    @oliver-mee
    ContributorAuthor

    Here is the realpath output from the affected install (pnpm 12.16.1, @bitkyc08/opencodex 2.99.0, Linux arm64). This is the same tree where ocx update currently aborts with "the active pnpm package failed verification".

    $ realpath ~/.local/share/pnpm/global/v11/202b34-18e6a093ce165469-0/node_modules/@bitkyc08/opencodex
    ~/.local/share/pnpm/store/v11/links/@bitkyc08/opencodex/2.99.0/7ba413d88a00b8c4f55e9e2bd396345c3f7d89355a15d06f81b90df429a92e1c/node_modules/@bitkyc08/opencodex
    

    A 64 character hash segment does sit between the version and node_modules, so the fixture with a hash matches this tree. Small correction to the command in the request: pnpm root -g returns ~/.local/share/pnpm/global/v11, and the package lives one group directory below it, so I took the exposed path from pnpm list -g --depth=0 --json.

    The dependency group beside the package holds the sentinels as sibling links and has neither pnpm marker file:

    ~/.local/share/pnpm/store/v11/links/@bitkyc08/opencodex/2.99.0/<hash>/node_modules
      @bitkyc08/  @bufbuild/  @modelcontextprotocol/  @napi-rs/
      bun     -> ../../../../../@/bun/1.4.4/<hash>/node_modules/bun
      zod     -> ../../../../../@/zod/4.6.6/<hash>/node_modules/zod
      wreq-js -> ../../../../../@/wreq-js/2.3.1/<hash>/node_modules/wreq-js
    

    .pnpm and .modules.yaml are both absent from that group. The verifier reports:

    {"ok":false,"failures":["sentinel dependency missing: bun","sentinel dependency missing: zod"]}
    

    One detail that may matter for #8298's coverage. In the real CLI the module path is already the store path, because the launcher resolves the shim, so realpath(packageDir) === packageDir and the group is reached through realGroup rather than the real !== packageDir branch. I applied the head of #8298 (5df4611) over a 2.99.0 tree and checked both shapes, the exposed symlink and the store path passed directly. Both now return {"ok":true,"failures":[]} where the unpatched tree failed as shown above. Pinning the no-symlink shape as a regression case would keep that branch covered.

  6. lidge-jun commented on Nov 13, 2026

    @lidge-jun
    Owner

    Fixed by #8331 (merged as 6788d42242).

    ocx update now accepts a pnpm 11/12 global install whose package lives in pnpm's global virtual store (<pnpm home>/store/v11/links/...). The acceptance is bound to the store pnpm itself reports: pnpm 11 or 12, pnpm store path --dir=<pnpm home> without --store-dir, cross-checked with pnpm list -g, and the package's realpath inside that store. Every link must stay inside the global group or that store.

    Evidence: the regression in tests/update/update-pnpm-global-store.test.ts fails on dev with this issue's symptom and passes after the change. With real pnpm 12.16.1 and 11.20.0 on macOS arm64, a default global install is accepted after one store query, and a symlinked pnpm home or an outside relay is refused.

    Not verified on real hardware: pnpm 12 on Linux arm64 (the reported platform) and Windows. If the update still refuses there, please share the full ocx update message; it now names the cause and the fallback (pnpm add -g @bitkyc08/opencodex@latest).

  7. added a commit that references this issue on Nov 13, 2026
    6788d42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buginstall

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions