[WRONG BRANCH] feat(standalone): compiled npm-free ocx binary (desktop stack 1/5) - #5256
devin-ai-integration[bot] wants to merge 6 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Its title has been prefixed with |
리뷰 · 우선순위 58 / 80이 PR은 앞으로 올 Tauri 데스크톱 앱(스택 1/5)을 위해, npm 없이 바로 돌릴 수 있는 컴파일된 라인 - 메인테이너의 판단이 필요한 지점 스택을 #5196 위에 두는 현재 구조를 그대로 갈지, 아니면 스탠드얼론만 먼저 너의 추천 방향(컴파일 바이너리 + 서비스가 실행 파일로 start + 버전 번들)은 데스크톱 스택에 맞고, npm 경로는 건드리지 않아 범위도 대체로 좋습니다. 다만 지금은 draft·hygiene 차단이라 머지 준비가 아닙니다. 먼저 메인테이너가 이 댓글은 grok-bot이 작성했습니다 |
…asset attach Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
추가 리뷰 · 우선순위 42 / 80이전 리뷰 이후 커밋 라인 - 메인테이너의 판단이 필요한 지점 교차 타깃(darwin-x64·linux-arm64)을 스모크 없이 릴리스에 넣을지, 아니면 네이티브 러너/에뮬이 생길 때까지 문서에 “실험적·미검증”으로 둘지. Windows 스탠드얼론 서비스의 업데이트·복구를 이번 범위에서 의도적으로 비울지. Lab 경계 실패가 base 스택(#5196) 잔여인지 이 브랜치에서 새로 난 것인지. 스택을 #5196에 유지할지, 스탠드얼론만 너의 추천 이전 리뷰의 매트릭스·첨부·Windows bunfs 지적은 잘 고쳤고, 추가 리뷰 우선순위는 그 때문에 낮춥니다. 남은 핵심은 스폰서 라벨·base/ 이 댓글은 grok-bot이 작성했습니다 |
|
Follow-up on the remaining points (22bcf1e covered the matrix, attach pattern, Windows
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
추가 리뷰 · 우선순위 30 / 80이전 추가 리뷰 이후 커밋이 두 개 더 올라왔습니다. 라인 - 메인테이너의 판단이 필요한 지점
너의 추천 Windows 복구 주석과 management fallback 이름 복원은 충분합니다. 코드 리뷰 우선순위는 더 낮춥니다. 머지 전에 메인테이너가 릴리스·management 표면을 보고 이 댓글은 grok-bot이 작성했습니다 |
|
Re the macOS provenance timeout (#848 on |
…keep two route reads Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
추가 리뷰 · 우선순위 22 / 80이전 추가 리뷰(팁 라인 - 메인테이너의 판단이 필요한 지점
너의 추천 이 커밋은 #848 대응으로 충분합니다. 코드 리뷰 우선순위는 더 낮춥니다. 머지 전에 macos CI가 초록인지 확인한 뒤, 메인테이너가 릴리스·management 표면을 보고 이 댓글은 grok-bot이 작성했습니다 |
|
Agreed on all points. |
…shards Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ocx binary (desktop stack 1/5)ocx binary (desktop stack 1/5)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20bb8cf890
ℹ️ 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".
| if [[ "$RUNNER_OS" == "Windows" ]]; then sha256sum "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.zip" > "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.sha256" | ||
| else sha256sum "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.tar.gz" > "dist/ocx-${RELEASE_VERSION}-${STANDALONE_TARGET}.sha256" |
There was a problem hiding this comment.
Generate checksum entries relative to the download directory
In the package-standalone archive step, passing dist/ocx-... to sha256sum records that full relative path inside every sidecar. The attach job later flattens the artifacts into dist/release, changes into that directory, and runs shasum -a 256 -c, so it looks for dist/release/dist/ocx-... and fails before uploading any release assets. This is consistent with shasum --help, which says -c reads sums from the supplied files and generated checksum lines contain the name of each input file; generate the sidecar while inside dist or otherwise record only the archive basename.
Useful? React with 👍 / 👎.
| /** Baked at install; lets status flag paths gone stale after npm prefix/nvm moves. */ | ||
| bunPath?: string; | ||
| cliPath?: string; | ||
| cliPath?: string | null; |
There was a problem hiding this comment.
Accept the standalone null CLI path in persisted service state
A standalone service entry now has cliPath: null, and writeServiceInstallState() serializes that property, but parseServiceInstallState() still rejects every defined cliPath that is not a non-empty string. Consequently every freshly written standalone service state is immediately unreadable; notably, a Windows native service loses its recorded backend: "native" and subsequent repair, update, or uninstall operations default to the scheduler backend. Either omit cliPath when it is null or update the parser and relevant consumers to accept the new representation.
Useful? React with 👍 / 👎.
| if (isStandaloneBinary()) { | ||
| return { path: process.execPath, source: "standalone", overrideEnv: BUN_OVERRIDE_ENV }; |
There was a problem hiding this comment.
Invoke the compiled executable without a virtual source path
For a standalone process this returns the compiled ocx executable as though it were a Bun interpreter, but existing durable-runtime consumers such as src/codex/shim.ts::cliEntry() still append join(import.meta.dir, "..", "cli", "index.ts"). The default shim installed by ocx init therefore runs <ocx> /$bunfs/root/src/cli/index.ts ensure; a compiled executable receives that virtual path as its first application argument, so the CLI treats it as an unknown command and the shim silently fails to autostart the proxy. Make persistent self-invocations standalone-aware, as the service path was made here, rather than exposing the executable through an interface whose callers assume a separate CLI script.
Useful? React with 👍 / 👎.
| ], { stdout: "inherit", stderr: "inherit" }); | ||
| if (result.exitCode !== 0) process.exit(result.exitCode); | ||
|
|
||
| cpSync(guiDist, join(output, "gui", "dist"), { recursive: true }); |
There was a problem hiding this comment.
Package the assets required by the Windows tray
The standalone output copies only gui/dist, while ocx tray install reads src/tray/windows-tray.ps1 and the three src/tray/assets/*.ico files from paths derived from import.meta.dir. bun build --compile does not embed files reached only through these dynamic filesystem reads, so those paths do not exist in the extracted Windows archive and the install command stops with “a required file is missing.” Copy or embed these assets and resolve them from the standalone distribution root.
Useful? React with 👍 / 👎.
|
Superseded by #5318, merged to #5196 landed first as The consolidation applies the tree difference of the stack tip against the point the chain branched from. One file genuinely conflicted and both intents were kept. Everything from the standalone binary through the signed packaging is on Closing as superseded rather than stale. |
Summary
Stack 1/5 of the cross-platform desktop track (Tauri shell + sidecar). Base: #5196 (
feat/macos-app).Adds a compiled, npm-free
ocxdistribution viabun build --compile, so the upcoming Tauri desktop app (and anyone who just wants a binary) can run the exact same proxy runtime that npm users get. Nothing changes fornpm i -g opencodex.scripts/build-standalone.ts/bun run build:standalone --target <bun-darwin-arm64|bun-darwin-x64|bun-linux-x64|bun-linux-arm64|bun-windows-x64>→dist/standalone/<target>/ocx[.exe]+gui/distcopied beside it +SHA256SUMS.src/lib/standalone.ts:isStandaloneBinary()(compiled binaries mount their bundle at/$bunfs/root, detected viaimport.meta.url),standaloneRoot()= directory of the executable.src/lib/package-version.ts: single staticimport pkg from "../../package.json"so the version is bundled; replaces sevenreadFileSync(new URL("../../package.json", import.meta.url))readers that resolved to/package.jsoninside the binary (ocx --versioncrashed with ENOENT before this).findGuiDist()also looks at$OPENCODEX_GUI_DISTand<standaloneRoot>/gui/dist.BunRuntimeSource = "standalone";cliEntry()returnscli: nulland launchd / systemd / Task Scheduler / WinSW compose<ocx> start …instead of<bun> <src/cli/index.ts> start ….package-tree-integrityguard is a no-op for compiled binaries (there is no npm tree to verify).release.yml:package-standalonematrix (ubuntu / macos / windows) builds, smoke-tests (--version,start+ health), archivesocx-<version>-<target>.{tar.gz,zip}+.sha256, and the attach job uploads them.structure/ownership updated.Verification
ocx --version→opencodex 2.61.0;ocx start --port 10177→/healthok,/200 (dashboard served from the copiedgui/dist),/api/usage?range=today200 (compiledbun:sqliteworks).bun run typecheck; focused lib/service/gui tests (244 pass);bun test tests/ci-workflows(894 pass); layout tests;bun run structure:check;cd docs-site && bun run build;git diff --check.bun run prepush: 5 failures that are environment/preexisting — bubblewrap remote-workspace tests (no private bwrap here), one Codex shim timeout, and two Lab boundary tests that fail identically onorigin/dev'smanagement-api.tsimport shape (this PR only swaps its version import).Checklist
standalone; no token handling changed).Link to Devin session: https://app.devin.ai/sessions/f2dce68b7ca349e3ba39dab55bc12300
Open in Devin Desktop: https://app.devin.ai/desktop/session/f2dce68b7ca349e3ba39dab55bc12300?variant=devin
Requested by: @lidge-jun
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.