Summary
Running lazycodex doctor can appear to hang indefinitely because the LazyCodex passthrough path recursively invokes omo doctor while preserving OMO_INVOCATION_NAME=lazycodex.
The command does not reach the actual doctor surface; it repeatedly re-enters the LazyCodex installer/delegation path and spawns more Node/npm processes.
Environment
- LazyCodex version:
lazycodex-ai 4.7.5
- Codex version: not required to reproduce; the failure happens before Codex CLI is involved
- OS: macOS 26.5.1, arm64
- Node/npm: Node
v26.3.0, npm 11.16.0
- Install method: global/local bin links under
/Users/wknam/.bun/bin
- Relevant config:
/Users/wknam/.bun/bin/lazycodex and /Users/wknam/.bun/bin/omo both resolve to oh-my-openagent/bin/oh-my-opencode.js
Repository Decision
- Target repository:
code-yeongyu/lazycodex
- Why this belongs there: the failure is in the LazyCodex/lazycodex-ai alias and delegated command packaging path, not in upstream Codex CLI behavior.
- LazyCodex evidence:
bin/oh-my-opencode.js propagates the invocation name through OMO_INVOCATION_NAME; the packaged binary routes LazyCodex invocations to packages/omo-codex/scripts/install-local.mjs; install/cli-args.mjs treats doctor as a passthrough command; install/delegated-command.mjs delegates to npx --yes --package oh-my-openagent omo doctor.
- Upstream Codex source evidence from
/tmp/openai-codex-source: searching the cloned upstream source for lazycodex, OMO_INVOCATION_NAME, and this alias delegation path found no owning implementation. The affected files are LazyCodex package files under oh-my-openagent / packages/omo-codex.
Reproduction
- Install/use LazyCodex with
lazycodex and omo bin aliases available on PATH.
- Run:
- Observe that the command produces no doctor output and keeps spawning nested
node ... install-local.mjs doctor and npm exec omo doctor processes.
Expected Behavior
lazycodex doctor should delegate once to the real omo doctor surface and exit with the doctor report.
Actual Behavior
The command appears to hang. Runtime process inspection showed a repeating chain like:
node /Users/wknam/.bun/bin/lazycodex doctor
node .../oh-my-openagent-darwin-arm64/bin/oh-my-opencode.js doctor
node .../packages/omo-codex/scripts/install-local.mjs doctor
npm exec omo doctor
node /Users/wknam/.bun/bin/omo doctor
node .../oh-my-openagent-darwin-arm64/bin/oh-my-opencode.js doctor
node .../packages/omo-codex/scripts/install-local.mjs doctor
...
Evidence
lazycodex --version prints lazycodex-ai 4.7.5.
command -v lazycodex resolves to /Users/wknam/.bun/bin/lazycodex.
command -v omo resolves to /Users/wknam/.bun/bin/omo.
bin/oh-my-opencode.js:
getInvocationName() returns process.env.OMO_INVOCATION_NAME when present.
- child env is built with
OMO_INVOCATION_NAME: invocationName.
oh-my-openagent-darwin-arm64/bin/oh-my-opencode.js:
- if
OMO_INVOCATION_NAME is lazycodex or lazycodex-ai, it launches packages/omo-codex/scripts/install-local.mjs.
packages/omo-codex/scripts/install/cli-args.mjs:
doctor is included in PASSTHROUGH_COMMANDS.
packages/omo-codex/scripts/install/delegated-command.mjs:
- passthrough commands are delegated as
npx --yes --package oh-my-openagent omo <command>.
- Control check:
OMO_INVOCATION_NAME=omo npx --yes --package oh-my-openagent omo doctor
exits normally and prints the doctor report.
Root Cause
The LazyCodex wrapper intentionally sets OMO_INVOCATION_NAME=lazycodex so the packaged binary can route LazyCodex invocations into the Codex installer path. That environment variable is inherited by the delegated npx ... omo doctor process.
When the delegated omo wrapper starts, it sees OMO_INVOCATION_NAME=lazycodex, treats itself as another LazyCodex invocation, and re-enters install-local.mjs doctor. That repeats indefinitely.
Proposed Fix
Reset or remove OMO_INVOCATION_NAME when running delegated omo passthrough commands from the LazyCodex installer path.
One minimal fix path:
- Update
packages/omo-codex/scripts/install/process.mjs so defaultRunCommand() accepts an optional env.
- Update
packages/omo-codex/scripts/install/delegated-command.mjs so runDelegatedOmoCommand() calls the delegated command with OMO_INVOCATION_NAME=omo.
- Add a regression test around
runDelegatedOmoCommand() asserting delegated passthrough commands do not preserve OMO_INVOCATION_NAME=lazycodex.
A local hotfix with that shape made lazycodex doctor exit normally on the affected machine.
Verification Plan
- Run
lazycodex doctor from a shell where lazycodex is the invocation path and verify it exits with a doctor report.
- Run the delegated control command with
OMO_INVOCATION_NAME=omo and verify the report is unchanged.
- Add/update Node tests for the LazyCodex passthrough command path so
doctor, cleanup, and other passthrough commands cannot recurse through a stale LazyCodex invocation name.
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
Summary
Running
lazycodex doctorcan appear to hang indefinitely because the LazyCodex passthrough path recursively invokesomo doctorwhile preservingOMO_INVOCATION_NAME=lazycodex.The command does not reach the actual doctor surface; it repeatedly re-enters the LazyCodex installer/delegation path and spawns more Node/npm processes.
Environment
lazycodex-ai 4.7.5v26.3.0, npm11.16.0/Users/wknam/.bun/bin/Users/wknam/.bun/bin/lazycodexand/Users/wknam/.bun/bin/omoboth resolve tooh-my-openagent/bin/oh-my-opencode.jsRepository Decision
code-yeongyu/lazycodexbin/oh-my-opencode.jspropagates the invocation name throughOMO_INVOCATION_NAME; the packaged binary routes LazyCodex invocations topackages/omo-codex/scripts/install-local.mjs;install/cli-args.mjstreatsdoctoras a passthrough command;install/delegated-command.mjsdelegates tonpx --yes --package oh-my-openagent omo doctor./tmp/openai-codex-source: searching the cloned upstream source forlazycodex,OMO_INVOCATION_NAME, and this alias delegation path found no owning implementation. The affected files are LazyCodex package files underoh-my-openagent/packages/omo-codex.Reproduction
lazycodexandomobin aliases available onPATH.node ... install-local.mjs doctorandnpm exec omo doctorprocesses.Expected Behavior
lazycodex doctorshould delegate once to the realomo doctorsurface and exit with the doctor report.Actual Behavior
The command appears to hang. Runtime process inspection showed a repeating chain like:
Evidence
lazycodex --versionprintslazycodex-ai 4.7.5.command -v lazycodexresolves to/Users/wknam/.bun/bin/lazycodex.command -v omoresolves to/Users/wknam/.bun/bin/omo.bin/oh-my-opencode.js:getInvocationName()returnsprocess.env.OMO_INVOCATION_NAMEwhen present.OMO_INVOCATION_NAME: invocationName.oh-my-openagent-darwin-arm64/bin/oh-my-opencode.js:OMO_INVOCATION_NAMEislazycodexorlazycodex-ai, it launchespackages/omo-codex/scripts/install-local.mjs.packages/omo-codex/scripts/install/cli-args.mjs:doctoris included inPASSTHROUGH_COMMANDS.packages/omo-codex/scripts/install/delegated-command.mjs:npx --yes --package oh-my-openagent omo <command>.Root Cause
The LazyCodex wrapper intentionally sets
OMO_INVOCATION_NAME=lazycodexso the packaged binary can route LazyCodex invocations into the Codex installer path. That environment variable is inherited by the delegatednpx ... omo doctorprocess.When the delegated
omowrapper starts, it seesOMO_INVOCATION_NAME=lazycodex, treats itself as another LazyCodex invocation, and re-entersinstall-local.mjs doctor. That repeats indefinitely.Proposed Fix
Reset or remove
OMO_INVOCATION_NAMEwhen running delegatedomopassthrough commands from the LazyCodex installer path.One minimal fix path:
packages/omo-codex/scripts/install/process.mjssodefaultRunCommand()accepts an optionalenv.packages/omo-codex/scripts/install/delegated-command.mjssorunDelegatedOmoCommand()calls the delegated command withOMO_INVOCATION_NAME=omo.runDelegatedOmoCommand()asserting delegated passthrough commands do not preserveOMO_INVOCATION_NAME=lazycodex.A local hotfix with that shape made
lazycodex doctorexit normally on the affected machine.Verification Plan
lazycodex doctorfrom a shell wherelazycodexis the invocation path and verify it exits with a doctor report.OMO_INVOCATION_NAME=omoand verify the report is unchanged.doctor,cleanup, and other passthrough commands cannot recurse through a stale LazyCodex invocation name.This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated