Windows: generated omo.cmd uses invalid quote comparison and exits 255
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- bun, node.js, typescript
Hướng nghiên cứu
Bắt đầu trong plugins/omo/dist/cli-node/index.js tại windowsNodeDiscoveryLines(), sau đó tái hiện wrapper đã được tạo thông qua cmd.exe /d /c bằng các giá trị NODE_REPL_NODE_PATH có và không có dấu ngoặc kép. Bổ sung phạm vi kiểm thử hồi quy Windows cho cả component shim và wrapper omo.cmd ở root, đồng thời xác nhận --version và ulw-loop --help chạy thành công trong khi các bài kiểm thử installer và bootstrap hiện có vẫn ở trạng thái xanh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 3.7k
- Fork
- 233
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của code-yeongyu/lazycodex
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
code-yeongyu/lazycodex#170 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
code-yeongyu/lazycodex#164 · 1 bình luận ·
-
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 72/100
code-yeongyu/lazycodex#148 ·
-
Test audit: remove low-value tests, repair tests that cannot fail, adopt a test authoring gateĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
code-yeongyu/lazycodex#168 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
code-yeongyu/lazycodex#167 ·
Tất cả issue của code-yeongyu/lazycodex
Issue tương tự
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pingdotgg/t3code#14452 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
solana-foundation/program-examples#747 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
remotion-dev/remotion#11847 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openwatersio/slackwater#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
melgarafael/DeskcommCRM#1998 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày