Skip to content

Fix ULW component CLI direct subcommand dispatch#43

Open
tully-8888 wants to merge 1 commit into
code-yeongyu:mainfrom
tully-8888:lazycodex/bug-fix-ulw-cli-direct-dispatch
Open

Fix ULW component CLI direct subcommand dispatch#43
tully-8888 wants to merge 1 commit into
code-yeongyu:mainfrom
tully-8888:lazycodex/bug-fix-ulw-cli-direct-dispatch

Conversation

@tully-8888

@tully-8888 tully-8888 commented Jun 9, 2026

Copy link
Copy Markdown

Problem Situation

omo ulw-loop status --json can fail after the OMO wrapper strips the ulw-loop prefix and invokes the omo-ulw-loop component binary, because the component entrypoint rejects direct subcommands such as status.

Reproduction Logs

RED: npm test -- test/cli-entrypoint.test.ts failed with AssertionError: expected '[omo] unknown command: status Usage:…' to contain '[ulw-loop] No ulw-loop plan found'.

Approach

Keep the existing ulw-loop <subcommand> and hook ... paths, but also dispatch known direct ULW subcommands to ulwLoopCommand(argv). Add a regression test that builds dist/cli.js and invokes status --json through the component entrypoint.

Why I Am Confident

The failing test reproduced the exact argv-shape bug before the fix; the same test passes after. Manual tmux QA ran direct dist/cli.js create-goals and dist/cli.js status with both commands exiting 0.

Risks

Low. The change only affects known ULW subcommands at the component entrypoint; hook ..., ulw-loop ..., and unknown-command behavior are preserved.

User-Visible Behavior Changes

Users and wrapper scripts can invoke omo ulw-loop status, omo ulw-loop create-goals, and other ULW subcommands without needing a duplicated ulw-loop argument.

Verification

  • RED: /tmp/lazycodex-fix-ulw-cli-direct-dispatch-red.log
  • GREEN: /tmp/lazycodex-fix-ulw-cli-direct-dispatch-green-targeted.log
  • Changed-file Biome, typecheck, build, and full component tests: /tmp/lazycodex-fix-ulw-cli-direct-dispatch-verify.log
  • Manual QA tmux transcript: /tmp/lazycodex-fix-ulw-cli-direct-dispatch-tmux-qa.txt

Fixes #42


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


Summary by cubic

Fix CLI dispatch so omo ulw-loop <subcommand> works without repeating ulw-loop. Known ULW subcommands like status now route directly via the component entrypoint.

  • Bug Fixes
    • Dispatch known ULW subcommands (status, create-goals, complete-goals, etc.) directly to ulwLoopCommand(argv).
    • Preserve ulw-loop <subcommand>, hook ..., and unknown-command behavior.
    • Add a regression test that builds dist/cli.js and verifies status --json is handled as expected.

Written for commit eb26359. Summary will update on new commits.

Review in cubic

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb26359612

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import { afterAll, beforeAll, describe, expect, it } from "vitest";

const execFileAsync = promisify(execFile);
const repoRoot = resolve(import.meta.dirname, "..");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a Node 20.0-compatible dirname fallback

On Node 20.0–20.10, which is still allowed by this package's engines: >=20.0.0 and the component AGENTS.md guidance, import.meta.dirname is not available, so this module throws during evaluation before the test can run. The existing tests use fileURLToPath(import.meta.url)/dirname(...); use that pattern here or raise the supported Node floor to a version that provides import.meta.dirname.

Useful? React with 👍 / 👎.

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.

ULW component CLI rejects direct subcommands after wrapper dispatch

1 participant