Windows: generated omo.cmd uses invalid quote comparison and exits 255
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- bun, node.js, typescript
调研方向
从 plugins/omo/dist/cli-node/index.js 中的 windowsNodeDiscoveryLines() 开始,然后使用带引号和不带引号的 NODE_REPL_NODE_PATH 值,通过 cmd.exe /d /c 复现生成的 wrapper。为组件 shim 和 root omo.cmd wrapper 都添加 Windows 回归覆盖,并确认 --version 和 ulw-loop --help 执行成功,同时现有的 installer 和 bootstrap 测试仍保持通过。
由索引模型根据 Issue 内容生成。
描述
Summary
On Windows, the generated omo.cmd launcher exits with code 255 before dispatching to Bun or Node. This breaks direct omo CLI usage, including omo ulw-loop, while the plugin hooks and MCP servers can still load normally.
Environment
- LazyCodex version: 4.19.1
- Codex version: 0.144.5
- OS: Windows 10.0.26200 x64
- Install method:
npx lazycodex-ai install - Relevant config:
omo@sisyphuslabsenabled; plugin hooks and Git Bash, CodeGraph, and Context7 MCP entries enabled
Repository Decision
- Target repository:
code-yeongyu/lazycodex - Why this belongs there: the failure is emitted by LazyCodex's generated Windows command wrapper before Codex or the OMO Node runtime starts.
- LazyCodex evidence: the latest
v4.19.1source at commit3efc603ac474f5a4f77001641d0b2736dc121e85generates the malformed conditions inplugins/omo/dist/cli-node/index.js:74482-74483. - Upstream Codex source evidence: the failure reproduces in an isolated ASCII-only
.cmdsnippet without invoking Codex, so upstream Codex is not on the failing path.
Reproduction
-
Install LazyCodex on Windows:
npx lazycodex-ai install -
Run the generated launcher from the installer bin directory, for example:
& "$env:USERPROFILE\.local\bin\omo.cmd" --version $LASTEXITCODE -
Observe the command parser failure before either runtime is invoked.
Minimal isolated reproduction:
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "OMO_NODE_BINARY=node"
if "!OMO_NODE_BINARY:~0,1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"
echo SURVIVED
Expected Behavior
omo.cmd --version should print the installed LazyCodex version and exit 0. omo ulw-loop should dispatch to its generated command wrapper.
Actual Behavior
The syntax of the command is incorrect.
exit code: 255
The isolated reproduction fails under both code page 65001 and 437. It also fails with ASCII-only paths, so the behavior is not caused by a non-ASCII Windows user profile.
Evidence
-
Installed wrapper contains:
if "!OMO_NODE_BINARY:~0,1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!" if "!OMO_NODE_BINARY:~-1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!" -
Latest source generates those lines in
windowsNodeDiscoveryLines():plugins/omo/dist/cli-node/index.js:74482plugins/omo/dist/cli-node/index.js:74483
-
The malformed comparison was reproduced twice with exit 255.
-
Replacing only
=="^""with==""""made the isolated wrapper printSURVIVED=nodeand exit 0 twice. -
Running the bundled Node runtime directly still works:
4.19.1 DIRECT_OMO_NODE_EXIT=0
Root Cause
windowsNodeDiscoveryLines() emits =="^"" when it tries to compare the first or last character of OMO_NODE_BINARY with a double quote. That sequence is not valid CMD comparison syntax, so cmd.exe aborts parsing before the wrapper reaches runtime discovery or dispatch. Both windowsCommandShim() and windowsRuntimeWrapper() consume the shared generated lines.
Proposed Fix
Generate the valid CMD quote comparison:
if "!OMO_NODE_BINARY:~0,1!"=="""" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"
if "!OMO_NODE_BINARY:~-1!"=="""" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!"
Add a Windows regression test that writes the generated wrapper and executes it through cmd.exe /d /c, rather than only checking the generated text. Cover both quoted and unquoted NODE_REPL_NODE_PATH values because the shared helper is used by component command shims and the root omo.cmd runtime wrapper.
Verification Plan
-
omo.cmd --versionprints4.19.1and exits 0 on Windows. -
omo.cmd ulw-loop --helpreaches the ulw-loop wrapper. - Generated wrappers accept quoted and unquoted
NODE_REPL_NODE_PATH. - The wrapper succeeds under Windows code pages 65001 and 437.
- Existing Codex plugin installer and bootstrap tests remain green.
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
- 主要语言
- TypeScript
- 星标
- 3.8k
- 派生
- 246
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
code-yeongyu/lazycodex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
code-yeongyu/lazycodex#170 ·
-
Fix Codex browser QA routing before standalone Playwright可能已有人在做 @berkshirehathaways 于 85 天前认领。 未关闭
难度 2/5 1-2 天 新手友好度 72/100
code-yeongyu/lazycodex#148 ·
-
难度 5/5 一周以上 新手友好度 35/100
code-yeongyu/lazycodex#172 ·
-
[5.0.0-beta.78] High cost and rapid quota consumption: use role-appropriate agent model defaults未关闭
难度 4/5 3-5 天 新手友好度 48/100
code-yeongyu/lazycodex#166 ·
-
难度 4/5 3-5 天 新手友好度 35/100
code-yeongyu/lazycodex#163 ·
查看 code-yeongyu/lazycodex 的全部 Issue
相似的 Issue
-
ready
难度 2/5 1-3 小时 新手友好度 63/100
wheresrhys/totf#1214 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
CodeChefVIT/ffcs#281 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
endora-commerce/endora-commerce#451 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
vetro-protocol/vetro-monorepo#1007 ·
维护者通常 1 天内回复