Skip to content

fix(pstack): keep runtime dependency installs out of plugin directory #293

Done

Description

@davidrobertson

Problem

Running the pstack watch-pr tool can cause subsequent Codex sessions to fail the pstack hook trust check with:

Hook failed
unsupported plugin entry type: .../skills/poteto-mode/scripts/node_modules/.bin/tsc

watch-pr calls ensureDependenciesInstalled(), which runs bun install --frozen-lockfile in the installed plugin's skills/poteto-mode/scripts directory. Bun creates node_modules/.bin/tsc as a symbolic link there. Codex's plugin trust fingerprinting rejects that entry type when it scans the plugin, so the pstack session-start hook fails. This was observed with pstack 1.21.0 and Codex CLI 0.167.0 on macOS; the current upstream bootstrap still installs in the same location.

Steps to reproduce

  1. Install pstack in Codex with a clean plugin cache.
  2. Invoke the bundled watch-pr command, for example with --help, so its first-run bootstrap installs dependencies.
  3. Start another Codex session that loads the pstack hook.

The bootstrap creates dependencies under the installed plugin directory. Subsequent hook loading reports the unsupported symlink. watch-pr should be usable without mutating the plugin tree or preventing later hooks from starting.

I also reproduced this in a disposable Codex installation: the trusted session-start hook completed before running watch-pr --help, then a fresh session reported hook/completed as failed with the same unsupported tsc entry. Codex hooks/list also reported the fingerprint warning.

Proposed direction

Install runtime dependencies in a user-writable cache outside the plugin tree, keyed by the dependency manifests, and resolve them from there. Preserve the Bun runtime guard and normal command behavior. Add regression coverage for a clean install and repeat invocation.

Codex's handling of symlinks is separately tracked in openai/codex#56520.

Activity

  1. ericlitman commented on Dec 1, 2026

    @ericlitman
    Owner

    Opened PR #314 (starting from davidrobertson's PR #294): #314

  2. ericlitman commented on Dec 1, 2026

    @ericlitman
    Owner

    #293: fix(pstack): keep runtime dependency installs out of plugin directory

    Merged in PR #314 (a362079f, head 98a89f81), preserving contributor davidrobertson's commits (80a734e, 27d7dd1) from closed fork PR #294.

    • Move watch-pr runtime dependency installation out of the installed plugin directory into a per-user cache keyed by manifest and lockfile hash so Codex hook loading hits no node_modules/.bin/tsc symlink inside the plugin cache: done as written. Proved by bun run test (cold-start, concurrent cold-start, and changed-manifest cache tests) and pro14 exact-head live gate --self-test --feature codex:shipped-tools:watch-pr (comment 7313616155, evidence /var/folders/w8/z8fzv6v14_3gvvx2rmp9l6780000gn/T/open-pstack-evidence-314c.dMu6SE), which ran watch-pr --help and then verified the Codex startup hook in the same installation with no node_modules inside the plugin tree.
    • Keep ensureDependenciesInstalled compatible, preserve the early Bun runtime guard, and stage installs atomically for concurrent starts: done as written for the guard and atomic staging (bootstrap.ts retains the early Bun guard before imports; tested with --production on Bun 1.4.0). Reader addition (Sync Cursor pstack 0.14.3 verified multi-PR checklist #17): The ticket asked for regression coverage for both a clean install and a repeat invocation; bootstrap.test.ts covers cold start, concurrent cold starts, and a changed manifest, with no dedicated repeat-invocation cache-reuse unit test (live repeat invocation ran cleanly on installed 1.22.0 during --help followed by --status-only).

    Full checked closeout record: projects/open-pstack/records/2026-12-01-batch-293/closeout.md (Open Pstack v1.22.0).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions