Repository navigation
Description
- Codex 0.164.0 rejects a valid npm-generated symlink while fingerprinting the context-mode plugin.
- The hook fails before its script runs; focused checks of esbuild, TypeScript execution, and the MCP server succeeded.
- The source inspection below identifies the rejection path. The proposed compatibility fix must preserve hook trust guarantees.
Environment
- Codex CLI: 0.164.0 at the time of the failure.
- Platform: macOS.
- Plugin: context-mode 1.0.169.
- Subscription, model, terminal version, and Codex doctor report: not included in this report.
What issue are you seeing?
I see this hook failure with context-mode installed (home directory redacted):
Hook failed
└ unsupported plugin entry type: /Users/<user>/.codex/plugins/cache/context-mode/context-mode/1.0.169/node_modules/.bin/esbuild
The rejected entry is a normal npm-generated symlink:
node_modules/.bin/esbuild -> ../esbuild/bin/esbuild
During the original investigation, the target existed and executed successfully. The plugin contained additional npm-generated symlinks, so handling only this particular entry would not address the general problem.
What steps can reproduce the bug?
- Use Codex CLI 0.164.0 with context-mode 1.0.169 installed and its lifecycle hooks configured.
- Ensure the plugin's installed dependencies include
node_modules/.bin/esbuildas the symlink shown above. - Start a Codex session that loads the plugin hooks.
- Observe the fingerprinting error before the hook script executes.
These steps describe the observed installation. I have not yet verified a clean-install reproduction. The original cache path is no longer present, so I have not repeated the runtime reproduction in its current state.
What is the expected behavior?
Plugins with valid npm-generated symlinks pointing to files inside the plugin directory should load their hooks after the usual trust review.
Fingerprinting should account for supported symlinks without weakening change detection or allowing links to escape the plugin directory.
Additional information
The 0.164.0 fingerprint implementation uses symlink_metadata and accepts only directories and regular files. Symlinks reach the fallback branch, which emits the exact error above. The recursive scan includes node_modules.
PR #54619 introduced plugin-content fingerprinting for hook trust. This supports a compatibility regression in the new validation path; I have not established the first affected release through version bisection.
Focused local checks succeeded for the linked esbuild executable, TypeScript execution, and the context-mode MCP server. Successful MCP operation does not establish successful hook loading.
Related issues #18863 and #24770 concern symlinks being dropped during plugin installation. This report concerns existing symlinks being rejected during hook fingerprinting.
Activity
mfbgull commentedon Oct 25, 2026
Confirmed on Linux (Codex CLI 0.164.0) — second affected plugin and a reproducible workaround
Hit the same failure today on Linux (Ubuntu, x86_64), so this is not macOS-specific. Same binary, same error, same root cause — adding evidence here rather than opening a duplicate.
Additional affected plugin
The bug is not limited to context-mode.
omo@sisyphuslabs(5.1.40, installed from a local marketplace) fails with the same class of error:Its plugin tree contained 15 symlinks, and fingerprinting rejects more exotic variants than the original report shows:
.binshims (same as context-mode)~/.npm/_npx/...— a cache npx can legitimately purge, so dangling links are a real-world state, not a corruption case)~/.npm/_npx/...The last two make "just resolve the target" insufficient as a fix policy: resolving an escaping or dangling link inside a trust-fingerprint walk has security implications the fix must handle explicitly.
Where it comes from (binary string table)
The message originates from
hooks/src/engine/plugin_fingerprint.rs; sibling strings confirm the walk is enumerating plugin entries to compute the hook-trust fingerprint:esbuildandcomment-checkerare not special — each is just the alphabetically-first symlink in the respective plugin'snode_modules/.bin. Any npm-installed plugin with dependencies will hit this, sincenpm installalways materializes.binshims as symlinks.Verified workaround (survives until the next plugin update)
Replacing every symlink in the plugin cache with real files lets fingerprinting complete, hooks load, and approval succeed:
#!/bin/shexec-wrappers with the absolute target path (a dereferenced byte copy breaks JS shims that rely on their real path forrequire)cp -adereferenced copiesAfter this: zero
unsupported plugin entry typeerrors, one clean "plugin contents changed; hook approval required" prompt, hooks functional (validatedpretooluse.mjsreturns valid JSON on stdin-driven invocation, and all shimmed binaries execute).Two caveats for anyone using the workaround:
rmfirst) silently corrupts the real target files — dormbefore writing.Suggested fix
In
plugin_fingerprint.rs, treat symlinks during the walk as one of:node_modules/.binlayout.Option (a) matches what the trust model actually needs: the fingerprint's job is detecting hook content changes, and symlinked build artifacts inside
node_modulesare not part of the trust surface.ChrisWeinrich commentedon Oct 25, 2026
The workaround works on my macOS setup with Codex CLI 0.164.0 and context-mode 1.0.169. Replacing the 14 internal file symlinks with executable wrappers removed the unsupported-entry failure; esbuild, tsc, tsx, and the Context Mode MCP checks pass. Full end-to-end hook execution has not yet been verified.