Summary
On Ubuntu 24.04 with OMO/LazyCodex plugin 4.8.1, the configured PreToolUse, PostToolUse, Stop, and related hooks fail before they can parse hook input because the installed plugin cache is missing the built component CLI files referenced by hooks/hooks.json.
The failure is not caused by hook JSON shape or timeout behavior. Directly invoking the configured hook commands exits with Node MODULE_NOT_FOUND for components/<component>/dist/cli.js.
Environment
- OS: Ubuntu 24.04.4 LTS, Linux
6.8.0-124-generic x86_64
- Node:
v24.16.0
- OMO install metadata:
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1/lazycodex-install.json
packageName: oh-my-opencode
version: 4.8.1
- OMO plugin package metadata:
@sisyphuslabs/omo-codex-plugin 4.8.1
- Codex config has plugin hooks enabled and OMO enabled:
plugin_hooks = true
[plugins."omo@sisyphuslabs"] enabled = true
Reproduction
- Install/enable OMO
4.8.1 for Codex with plugin hooks enabled.
- Trigger any hook whose command points at a component dist CLI, for example PreToolUse on Bash, PostToolUse after an edit, or Stop.
- Or directly invoke one configured command:
PLUGIN_ROOT=/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1
printf '{}' | node "$PLUGIN_ROOT/components/git-bash/dist/cli.js" hook pre-tool-use
Expected Behavior
The installed plugin cache should contain the built hook CLIs referenced by hooks/hooks.json, and the hook command should start successfully. It may then accept or reject the hook input according to its own logic, but it should not fail at module resolution.
Actual Behavior
Every tested component hook command fails with MODULE_NOT_FOUND because dist/cli.js is absent.
Example:
Error: Cannot find module '/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1/components/git-bash/dist/cli.js'
code: 'MODULE_NOT_FOUND'
Node.js v24.16.0
exit=1
The same failure reproduces for these configured hook components:
git-bash
ulw-loop
comment-checker
lsp
rules
start-work-continuation
Evidence
hooks/hooks.json in the installed OMO 4.8.1 cache points hooks at built component CLIs, for example:
"command": "node \"${PLUGIN_ROOT}/components/git-bash/dist/cli.js\" hook pre-tool-use"
"command": "node \"${PLUGIN_ROOT}/components/comment-checker/dist/cli.js\" hook post-tool-use"
"command": "node \"${PLUGIN_ROOT}/components/lsp/dist/cli.js\" hook post-tool-use"
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop"
But the installed 4.8.1 cache contains no component dist/cli.js files:
find /home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1/components \
-maxdepth 3 -path '*/dist/cli.js' -print
Observed output: empty.
The older installed OMO 0.1.0 cache on the same machine does contain the expected built CLIs:
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/comment-checker/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/git-bash/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/lsp/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/rules/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/start-work-continuation/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/telemetry/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/ultrawork/dist/cli.js
/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/0.1.0/components/ulw-loop/dist/cli.js
The 4.8.1 component directories appear to contain TypeScript source, tests, tsconfig files, and package metadata, but not built dist outputs. Component package manifests still declare bins/files that expect dist, for example ./dist/cli.js.
I also checked current upstream Codex hook execution source. Codex plugin hook discovery injects PLUGIN_ROOT/PLUGIN_DATA, expands plugin hook entries, then the command runner spawns the configured command and writes the hook JSON to stdin. That behavior is consistent with this failure: the configured command path is invalid before stdin shape, matcher behavior, or timeout handling can matter.
Root Cause Assessment
This looks like an OMO/LazyCodex packaging or installation regression in 4.8.1: the active plugin cache contains component source trees but omits the build artifacts that hooks/hooks.json requires.
This is distinct from the previously closed Windows/nvm incomplete-cache report because this reproduction is on Linux and specifically shows OMO 4.8.1 installed with source-only component directories and missing all hook component dist/cli.js files.
Proposed Fix
- Ensure the OMO plugin release/install flow builds or packages
components/*/dist/cli.js for every component referenced from hooks/hooks.json.
- Add an install/release smoke test that parses
hooks/hooks.json, resolves ${PLUGIN_ROOT}, and asserts every referenced node .../dist/cli.js target exists.
- Add a minimal runtime smoke test for each hook CLI target, either using valid minimal hook fixtures or a deterministic help/version path.
- Fail install or preserve the previous active plugin cache if required hook command targets are missing after promotion.
Verification Plan
- Install the fixed OMO version into a fresh
~/.codex plugin cache.
- Confirm this returns every hook component CLI referenced by
hooks/hooks.json:
find ~/.codex/plugins/cache/sisyphuslabs/omo/<version>/components \
-maxdepth 3 -path '*/dist/cli.js' -print | sort
- Directly invoke representative hooks and confirm they no longer fail with
MODULE_NOT_FOUND.
- Trigger PreToolUse, PostToolUse, Stop, and SessionStart in Codex and confirm hook failures disappear.
- Keep the upstream Codex contract check:
PLUGIN_ROOT expansion and command spawning should not require an upstream Codex change for this failure mode.
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
Summary
On Ubuntu 24.04 with OMO/LazyCodex plugin
4.8.1, the configured PreToolUse, PostToolUse, Stop, and related hooks fail before they can parse hook input because the installed plugin cache is missing the built component CLI files referenced byhooks/hooks.json.The failure is not caused by hook JSON shape or timeout behavior. Directly invoking the configured hook commands exits with Node
MODULE_NOT_FOUNDforcomponents/<component>/dist/cli.js.Environment
6.8.0-124-genericx86_64v24.16.0/home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1/lazycodex-install.jsonpackageName:oh-my-opencodeversion:4.8.1@sisyphuslabs/omo-codex-plugin4.8.1plugin_hooks = true[plugins."omo@sisyphuslabs"] enabled = trueReproduction
4.8.1for Codex with plugin hooks enabled.Expected Behavior
The installed plugin cache should contain the built hook CLIs referenced by
hooks/hooks.json, and the hook command should start successfully. It may then accept or reject the hook input according to its own logic, but it should not fail at module resolution.Actual Behavior
Every tested component hook command fails with
MODULE_NOT_FOUNDbecausedist/cli.jsis absent.Example:
The same failure reproduces for these configured hook components:
Evidence
hooks/hooks.jsonin the installed OMO4.8.1cache points hooks at built component CLIs, for example:But the installed
4.8.1cache contains no componentdist/cli.jsfiles:find /home/uadmin/.codex/plugins/cache/sisyphuslabs/omo/4.8.1/components \ -maxdepth 3 -path '*/dist/cli.js' -printObserved output: empty.
The older installed OMO
0.1.0cache on the same machine does contain the expected built CLIs:The
4.8.1component directories appear to contain TypeScript source, tests, tsconfig files, and package metadata, but not builtdistoutputs. Component package manifests still declare bins/files that expectdist, for example./dist/cli.js.I also checked current upstream Codex hook execution source. Codex plugin hook discovery injects
PLUGIN_ROOT/PLUGIN_DATA, expands plugin hook entries, then the command runner spawns the configured command and writes the hook JSON to stdin. That behavior is consistent with this failure: the configured command path is invalid before stdin shape, matcher behavior, or timeout handling can matter.Root Cause Assessment
This looks like an OMO/LazyCodex packaging or installation regression in
4.8.1: the active plugin cache contains component source trees but omits the build artifacts thathooks/hooks.jsonrequires.This is distinct from the previously closed Windows/nvm incomplete-cache report because this reproduction is on Linux and specifically shows OMO
4.8.1installed with source-only component directories and missing all hook componentdist/cli.jsfiles.Proposed Fix
components/*/dist/cli.jsfor every component referenced fromhooks/hooks.json.hooks/hooks.json, resolves${PLUGIN_ROOT}, and asserts every referencednode .../dist/cli.jstarget exists.Verification Plan
~/.codexplugin cache.hooks/hooks.json:MODULE_NOT_FOUND.PLUGIN_ROOTexpansion and command spawning should not require an upstream Codex change for this failure mode.This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated