Skip to content

fix: bundle OMO component hook CLIs#46

Closed
IndianMarshmello wants to merge 6 commits into
code-yeongyu:mainfrom
IndianMarshmello:lazycodex/bug-fix-issue-45-component-dist
Closed

fix: bundle OMO component hook CLIs#46
IndianMarshmello wants to merge 6 commits into
code-yeongyu:mainfrom
IndianMarshmello:lazycodex/bug-fix-issue-45-component-dist

Conversation

@IndianMarshmello

@IndianMarshmello IndianMarshmello commented Jun 10, 2026

Copy link
Copy Markdown

Problem Situation

LazyCodex issue #45 reports that OMO 4.8.1 hook commands point at components/*/dist/cli.js, but the marketplace plugin bundle omitted those built files, causing Node MODULE_NOT_FOUND before hooks can parse input.

Reproduction Logs

RED: node --test test/aggregate-hooks.test.mjs failed with missing targets including components/git-bash/dist/cli.js, components/ulw-loop/dist/cli.js, components/comment-checker/dist/cli.js, components/lsp/dist/cli.js, components/rules/dist/cli.js, components/start-work-continuation/dist/cli.js, components/telemetry/dist/cli.js, and components/ultrawork/dist/cli.js.

Approach

Commit the generated dist outputs for every component referenced by plugins/omo/hooks/hooks.json and add an aggregate packaging regression test that extracts ${PLUGIN_ROOT}/components/*/dist/cli.js hook command targets and asserts each exists in the bundle.

Why I Am Confident

The new regression test failed before the bundled outputs and passes after them. A direct invocation of the reported git-bash hook target exits without MODULE_NOT_FOUND, and a broad smoke check confirms all eight component CLI targets exist and load.

Risks

Low-to-medium: this adds generated bundle files to the marketplace repository. The risk is artifact drift if the upstream sync process is skipped again; the new test makes that failure visible in this repository.

User-Visible Behavior Changes

Fresh LazyCodex/OMO plugin cache installs include the hook CLI files referenced by hooks/hooks.json, so PreToolUse, PostToolUse, Stop, SessionStart, and related hooks no longer fail at Node module resolution.

Verification

  • RED: node --test test/aggregate-hooks.test.mjs failed on missing components/*/dist/cli.js targets before generated outputs were added
  • GREEN: node --test test/aggregate-hooks.test.mjs passed after adding bundled dist outputs
  • Manual QA: printf '{}' | node plugins/omo/components/git-bash/dist/cli.js hook pre-tool-use exited 0 with no MODULE_NOT_FOUND
  • Smoke: all eight hook CLI target paths exist=true and load enough to print usage or process arguments
  • Note: npm test is not fully runnable from this LazyCodex mirror checkout; existing tests expect upstream monorepo paths such as packages/omo-codex and @oh-my-opencode/shared-skills. The targeted aggregate hook regression passed.

This PR was debugged, implemented, and created with LazyCodex.
Tag: lazycodex-generated


Summary by cubic

Bundle OMO component hook CLIs and all configured MCP runtimes inside the plugin (including LSP via bundled @code-yeongyu/lsp-tools-mcp and ast-grep) so hooks resolve components/*/dist/cli.js and MCP servers run from the bundle. Fixes MODULE_NOT_FOUND on fresh installs and aligns LSP/MCP paths; addresses LazyCodex issue #45.

  • Bug Fixes
    • Bundled compiled CLIs for comment-checker, git-bash, lsp, and rules under plugins/omo/components/*/dist/cli.js to match plugins/omo/hooks/hooks.json; kept the rules hook dependency-free and aligned its dist CLI mode for consistent execution.
    • Vendored components/lsp-tools-mcp and wired components/lsp to it: components/lsp/.mcp.json runs ../lsp-tools-mcp/dist/cli.js mcp, and the omo-lsp CLI delegates to the bundled runtime and exposes hook post-tool-use and hook post-compact.
    • Bundled components/ast-grep-mcp runtime to satisfy the ast_grep MCP server from the plugin manifest.
    • Removed the root git_bash MCP entry from plugins/omo/.mcp.json; README updated to include ast-grep-mcp and reflect MCP changes.

Written for commit 12be80c. Summary will update on new commits.

Review in cubic

@code-yeongyu

Copy link
Copy Markdown
Owner

Thanks for digging into this — your aggregate hooks-target regression test idea was spot on. The fix landed upstream in code-yeongyu/oh-my-openagent@b4c96895c rather than here, at a different layer: the root cause was publish-step ordering (the oh-my-opencode/oh-my-openagent tarballs that feed the plugin cache were packed before the component build step; the components were built, just too late). Upstream now builds components before any plugin-shipping package packs, pins that ordering with a workflow test, and adds an install-time guard that resolves every ${PLUGIN_ROOT} hook command target from hooks.json and refuses to activate a payload with missing files — functionally your aggregate test, enforced at install time so a broken release can never replace a working cache.\n\nCommitting generated dist outputs into this distribution repo would drift from upstream builds, so we're closing this in favor of the pipeline fix. Ships in the next release — and thanks again for the thorough report on #45, the 0.1.0-vs-4.8.1 cache comparison was the key clue.

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.

2 participants