Skip to content

[WRONG BRANCH] feat(standalone): compiled npm-free ocx binary (desktop stack 1/5) - #5256

Closed
devin-ai-integration[bot] wants to merge 6 commits into
feat/macos-appfrom
devin/1789877991-standalone-binary
Closed

devin-ai-integration[bot] wants to merge 6 commits into
feat/macos-appfrom
devin/1789877991-standalone-binary

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Stack 1/5 of the cross-platform desktop track (Tauri shell + sidecar). Base: #5196 (feat/macos-app).

Adds a compiled, npm-free ocx distribution via bun 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 for npm 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/dist copied beside it + SHA256SUMS.
  • src/lib/standalone.ts: isStandaloneBinary() (compiled binaries mount their bundle at /$bunfs/root, detected via import.meta.url), standaloneRoot() = directory of the executable.
  • src/lib/package-version.ts: single static import pkg from "../../package.json" so the version is bundled; replaces seven readFileSync(new URL("../../package.json", import.meta.url)) readers that resolved to /package.json inside the binary (ocx --version crashed with ENOENT before this).
  • findGuiDist() also looks at $OPENCODEX_GUI_DIST and <standaloneRoot>/gui/dist.
  • Service durability: new BunRuntimeSource = "standalone"; cliEntry() returns cli: null and launchd / systemd / Task Scheduler / WinSW compose <ocx> start … instead of <bun> <src/cli/index.ts> start ….
  • package-tree-integrity guard is a no-op for compiled binaries (there is no npm tree to verify).
  • release.yml: package-standalone matrix (ubuntu / macos / windows) builds, smoke-tests (--version, start + health), archives ocx-<version>-<target>.{tar.gz,zip} + .sha256, and the attach job uploads them.
  • Docs: "Standalone binary (no npm)" section in the install guide, en + ja/ko/ru/zh-cn; structure/ ownership updated.

Verification

  • Compiled smoke on macOS arm64: ocx --versionopencodex 2.61.0; ocx start --port 10177/health ok, / 200 (dashboard served from the copied gui/dist), /api/usage?range=today 200 (compiled bun:sqlite works).
  • 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 on origin/dev's management-api.ts import shape (this PR only swaps its version import).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (durable service commands now bake the executable path; provenance allowlist gained 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.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 164b22e4-f983-40a6-b62b-8c832dbefcce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added enhancement New feature or request intake: hygiene-blocked Deterministic PR hygiene checks failed labels Sep 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: .github/workflows/release.yml, package.json, src/server/management-api.ts.

@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • wrong target branch (feat/macos-app); retarget to dev. hygiene: unsponsored_surface.

What to do

  • Retarget this PR to dev — all contributions go to dev.
  • Fix unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: .github/workflows/release.yml, package.json, src/server/management-api.ts.
  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ 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.

0/4 boxes ticked.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.
@devin-ai-integration[bot] Tick the boxes once your local CI is green, your branch is on the latest dev commit, and every correct Codex and CodeRabbit finding is resolved.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 58 / 80

이 PR은 앞으로 올 Tauri 데스크톱 앱(스택 1/5)을 위해, npm 없이 바로 돌릴 수 있는 컴파일된 ocx 바이너리를 만드는 작업입니다. bun build --compile로 플랫폼별 실행 파일을 만들고, 옆에 gui/dist를 복사하며, 서비스(launchd/systemd/Windows)가 소스 TS가 아니라 그 실행 파일로 start 하게 바꿉니다. 버전 읽기도 package.json을 디스크에서 찾지 않고 번들에 넣는 쪽으로 고쳐, 예전에 바이너리에서 --version이 깨지던 문제도 같이 잡았습니다. 릴리스 워크플로에 package-standalone 잡이 추가되고, 설치 문서(en/ja/ko/ru/zh)에도 안내가 들어갑니다. npm 설치 경로 자체는 그대로 둡니다. base는 dev가 아니라 열린 #5196 (feat/macos-app) 위에 쌓인 스택 PR입니다.

라인 - .github/workflows/release.yml package-standalone 매트릭스: 스크립트·문서는 darwin-x64 / linux-arm64까지 지원한다고 보이는데, CI 빌드는 linux-x64 · darwin-arm64 · windows-x64 세 개만 돕니다. Intel Mac·ARM Linux 사용자는 릴리스에 파일이 없을 수 있습니다.
라인 - .github/workflows/release.yml attach-macos 다운로드: 예전엔 macos-release만 받던 것이 pattern: "*" + merge-multiple: true로 바뀌어, 이름과 달리 스탠드얼론 아티팩트까지 한곳에 합칩니다. 의도가 “릴리스에 ocx 아카이브도 붙이기”라면 잡 이름·경로 검증을 더 분명히 하는 편이 안전합니다.
라인 - src/lib/standalone.ts isStandaloneBinary(): import.meta.url"/$bunfs/"가 있는지로만 판별합니다. Bun이 경로 형식을 바꾸거나 Windows에서 구분자가 달라지면 서비스가 다시 소스 CLI를 찾으려 할 수 있습니다. 판별이 틀리면 cliEntry·GUI 경로·패키지 트리 검사가 한꺼번에 어긋납니다.
라인 - src/service/windows-taskxml.ts 스탠드얼론 분기: cli === null이면 OCX_PKG_DIR·CLI 복구(restore_backup) 경로를 아예 빼 버립니다. Windows에서 스탠드얼론 서비스의 업데이트/복구가 “재설치” 말고는 약해질 수 있습니다.
라인 - 스모크·테스트 깊이: 릴리스 스모크는 --version/healthz 정도만 보고, PR 설명에 나온 대시보드(/)·API 검증은 CI에 없습니다. standalone-build-script.test.ts는 스크립트 문자열 포함 검사라 실제 컴파일 회귀를 거의 못 잡습니다.
라인 - 게이트: hygiene unsponsored_surface(release.yml / package.json / management-api.ts)로 draft·intake: hygiene-blocked 상태입니다. 체크리스트도 0/4입니다. 릴리스·인증 표면이라 메인테이너 스폰서 라벨이 필요합니다.

메인테이너의 판단이 필요한 지점

스택을 #5196 위에 두는 현재 구조를 그대로 갈지, 아니면 스탠드얼론만 먼저 dev로 올려 리뷰·릴리스 위험을 줄일지. 또 darwin-x64·linux-arm64를 이번 릴리스 매트릭스에 넣을지, 문서에서 “지원 대상”을 실제 빌드 목록으로 줄일지. attach-macos가 전 아티팩트를 합치는 변경을 이번 PR에 같이 둘지, 릴리스 첨부는 별 PR로 뺄지.

너의 추천

방향(컴파일 바이너리 + 서비스가 실행 파일로 start + 버전 번들)은 데스크톱 스택에 맞고, npm 경로는 건드리지 않아 범위도 대체로 좋습니다. 다만 지금은 draft·hygiene 차단이라 머지 준비가 아닙니다. 먼저 메인테이너가 maintainer-sponsored로 릴리스 표면을 보고, (1) 매트릭스↔문서 지원 대상을 맞추고, (2) attach 아티팩트 범위를 좁히거나 잡/검증을 명확히 하고, (3) Windows 스탠드얼론 복구·$bunfs 판별에 대한 짧은 회귀 테스트나 주석 계약을 보강한 뒤, #5196 랜딩 순서와 맞춰 ready로 올리는 쪽을 추천합니다. 미리보기 배포 이야기는 이 PR과 무관하니 생략합니다.

이 댓글은 grok-bot이 작성했습니다

…asset attach

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@lidge-jun

Copy link
Copy Markdown
Owner

추가 리뷰 · 우선순위 42 / 80

이전 리뷰 이후 커밋 22bcf1e(windows bunfs 표식, 릴리스 매트릭스 확대, 아티팩트 첨부 좁히기)가 올라왔습니다. 처음 지적했던 세 가지는 대체로 반영됐습니다. (1) package-standalonebun-darwin-x64·bun-linux-arm64가 들어가 문서/스크립트와 지원 대상이 맞습니다. (2) attach-macos는 다시 macos-release를 따로 받고, 스탠드얼론은 pattern: standalone-*만 합칩니다. (3) isStandaloneModuleUrl이 Windows의 file:///X:/~BUN/... 형태도 보고, 단위 테스트로 POSIX·Windows 표식을 고정했습니다. 스모크도 /healthz뿐 아니라 / 200을 확인합니다. 방향은 그대로 좋고, 이전보다 릴리스 쪽이 훨씬 덜 위험합니다. 다만 draft·hygiene 차단과 base(#5196) 문제는 그대로입니다.

라인 - .github/workflows/release.yml 교차 빌드: darwin-x64·linux-arm64smoke: false라 아카이브만 만들고 실행 검증은 안 합니다. 러너 아키텍처 한계로는 이해되지만, 깨진 바이너리가 릴리스에 실릴 수 있습니다.
라인 - src/service/windows-taskxml.ts 스탠드얼론 분기: 여전히 cli === null이면 OCX_PKG_DIR·CLI restore_backup을 빼 둡니다. npm 트랜잭션 복구와 달리, Windows 스탠드얼론 서비스는 바이너리/자산이 깨지면 재설치에 가깝습니다. 의도라면 주석으로 “스탠드얼론은 복구 없음”을 밝히면 좋습니다.
라인 - CI: hygiene는 계속 unsponsored_surface(release.yml / package.json / management-api.ts)로 실패·intake: hygiene-blocked입니다. test 4/4tests/lab/core-lab-boundary.test.ts 경계 단언이 깨집니다. PR 본문이 “dev의 management-api import 모양과 동일 실패”라고 하니 이 PR만의 회귀인지는 확인이 필요합니다. 체크리스트는 여전히 0/4입니다.
라인 - base가 dev가 아니라 #5196(feat/macos-app) 스택입니다. opencodex는 base dev를 선호하고, enforce-target도 이 때문에 흔들릴 수 있습니다.

메인테이너의 판단이 필요한 지점

교차 타깃(darwin-x64·linux-arm64)을 스모크 없이 릴리스에 넣을지, 아니면 네이티브 러너/에뮬이 생길 때까지 문서에 “실험적·미검증”으로 둘지. Windows 스탠드얼론 서비스의 업데이트·복구를 이번 범위에서 의도적으로 비울지. Lab 경계 실패가 base 스택(#5196) 잔여인지 이 브랜치에서 새로 난 것인지. 스택을 #5196에 유지할지, 스탠드얼론만 dev로 먼저 올릴지. maintainer-sponsored로 hygiene을 열어줄지.

너의 추천

이전 리뷰의 매트릭스·첨부·Windows bunfs 지적은 잘 고쳤고, 추가 리뷰 우선순위는 그 때문에 낮춥니다. 남은 핵심은 스폰서 라벨·base/dev 정렬·교차 빌드 검증 공백·Windows 복구 계약 명시다. 메인테이너가 릴리스 표면을 한 번 보고 maintainer-sponsored를 붙인 뒤, Lab 경계 실패가 이 PR 소관인지부터 가리고, 교차 타깃은 “빌드만” 또는 “검증 후 공개” 중 하나를 문서/잡에 맞춰 ready로 올리는 쪽을 추천합니다.

이 댓글은 grok-bot이 작성했습니다

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Follow-up on the remaining points (22bcf1e covered the matrix, attach pattern, Windows ~BUN marker and / smoke):

  • Cross targets without smoke (darwin-x64, linux-arm64): intentional for this stack — runners for those arches aren't available. Docs will mark them "build-only, not runtime-verified" in stack 5 alongside signing; if a native/emulated runner shows up they move to smoke: true.
  • Windows standalone restore_backup: deliberate. Standalone has no npm package tree to snapshot/restore; the recovery story is "replace the executable". I'll add the one-line contract comment in windows-taskxml.ts with the next push.
  • Lab boundary test 4/4: being verified against the stack base right now; will report the import chain here if it turns out to be ours.
  • base / hygiene: stack lands via feat(macos): menu bar companion + widget, with CodexBar-style usage monitor integrated into Usage #5196feat/macos-appdev by maintainer decision; maintainer-sponsored is the maintainer's call.

lidge-jun and others added 2 commits September 19, 2026 22:12
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>
@lidge-jun

Copy link
Copy Markdown
Owner

추가 리뷰 · 우선순위 30 / 80

이전 추가 리뷰 이후 커밋이 두 개 더 올라왔습니다. dc351ea는 management API 버전 읽기에서 MANAGEMENT_VERSION_FALLBACK 이름을 다시 두고, packageVersion에 그 값을 넘기게 고쳤습니다. a88aa53은 Windows 서비스 스크립트에 “스탠드얼론은 npm 트리가 없어서 복구가 아니라 실행 파일 교체”라는 한 줄 계약을 적어 두었습니다. 방향은 그대로 좋고, 지난번에 남겼던 코드 쪽 두 가지는 대체로 닫혔습니다. 남은 건 게이트·베이스·교차 빌드 검증 공백입니다.

라인 - src/server/management-api.ts: MANAGEMENT_VERSION_FALLBACK 이름을 되살린 뒤, dc351ea 기준 test 4/4는 통과했습니다. 예전 Lab 경계 실패는 이 PR의 버전 import 모양 문제였을 가능성이 큽니다.
라인 - src/service/windows-taskxml.ts: 복구 없음 계약이 주석으로 명시됐습니다. 스탠드얼론에서 OCX_BUN이 없으면 여전히 :restore_backup을 한 번 부르지만, OCX_PKG_DIR이 없어 실질적으로는 no-op 뒤 “재설치” 메시지로 끝납니다. 주석과 동작은 맞습니다.
라인 - CI: 팁 a88aa53hygiene은 계속 unsponsored_surface(release.yml / package.json / management-api.ts)로 실패·intake: hygiene-blocked입니다. draft·체크리스트 0/4도 그대로입니다. dc351eamacos 1/2GET /api/system/memory provenance allowlist 테스트가 20초 타임아웃으로 한 번 실패했습니다. 이 PR이 standalone provenance를 allowlist에 넣은 것과 맞닿아 있어, 단순 플레이크인지 한 번 더 보면 좋습니다.
라인 - .github/workflows/release.yml: darwin-x64·linux-arm64는 여전히 smoke: false(작성자 의도·스택 5로 문서화 예정)입니다. 깨진 바이너리가 릴리스에 실릴 여지는 남아 있습니다.
라인 - base는 계속 #5196(feat/macos-app) 스택입니다. 스택 예외로 enforce가 통과할 수는 있어도, opencodex 기본 선호는 base dev입니다.

메인테이너의 판단이 필요한 지점

maintainer-sponsored로 hygiene을 열어줄지. 교차 타깃을 스모크 없이 릴리스에 둘지(스택 5 문서 “build-only”로 미룰지). 스택을 #5196에 유지할지. macos provenance 타임아웃을 재실행만 할지, allowlist/standalone 경로를 더 볼지.

너의 추천

Windows 복구 주석과 management fallback 이름 복원은 충분합니다. 코드 리뷰 우선순위는 더 낮춥니다. 머지 전에 메인테이너가 릴리스·management 표면을 보고 maintainer-sponsored를 붙이고, tip CI(특히 macos memory provenance)가 초록인지 확인한 뒤, #5196 랜딩 순서에 맞춰 ready로 올리는 쪽을 추천합니다.

이 댓글은 grok-bot이 작성했습니다

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Re the macOS provenance timeout (#848 on dc351ea): checked before rerunning. /api/system/memory reaches provenance only through reportedBunRuntimeSource(), which does BUN_RUNTIME_SOURCES.find(...) + a synchronous realpathSync compare — it never touches durableBunRuntime(), bundledBunPath(), package-tree validation, or the isStandaloneBinary() marker this PR added. The allowlist is an explicit array and already includes "standalone". tests/server/memory-watchdog.test.ts passes 13/13 on both this head and feat/macos-app (a4f084a, whose macos 1/2 job 106021164660 was green). a88aa53 retriggered the matrix; if macos 1/2 reds again on the same test it's ours to chase, otherwise treating it as runner contention.

…keep two route reads

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@lidge-jun

Copy link
Copy Markdown
Owner

추가 리뷰 · 우선순위 22 / 80

이전 추가 리뷰(팁 a88aa53) 이후 커밋이 하나 더 올라왔습니다. e596e246은 지난번에 남겼던 macos memory provenance 타임아웃(#848)을 테스트 쪽에서 풀었습니다. /api/system/memory를 여러 번 부르면 heapStats() 때문에 CI가 느려지니까, env 조합 검사는 가벼운 reportedBunRuntimeSource()로 옮기고, 라우트는 성공 한 번·미설정 한 번만 남겼습니다. 여기에 standalone 소스도 행렬에 넣었습니다. 방향이 맞고, 지난 CI 의심 지점은 이 커밋으로 거의 닫혔습니다. 남은 건 코드보다 게이트·스폰서·베이스입니다.

라인 - tests/server/memory-watchdog.test.ts (e596e246): provenance 행렬을 순수 함수로 옮기고 라우트 호출을 2회로 줄였습니다. standalone도 같은 계약(소스만으로는 안 되고, OCX_BUN_RUNTIME_PATH가 이 실행 파일이어야 함)으로 커버됩니다. Devin이 말한 대로 이 경로는 isStandaloneBinary()와 직접 맞닿지 않아서, 이번 수정은 “플레이크 재발 방지”에 가깝고 런타임 버그 픽스는 아닙니다.
라인 - CI(팁 e596e246): hygiene은 계속 unsponsored_surface(release.yml / package.json / management-api.ts)로 실패·라벨 intake: hygiene-blocked입니다. draft·체크리스트 0/4도 그대로입니다. 본 테스트 매트릭스(test 1–3, gates, docker smoke 등)는 초록이고, 작성 시점 기준 macos 1/2·2/2·test 4/4는 아직 도는 중이었습니다.
라인 - .github/workflows/release.yml: darwin-x64·linux-arm64는 여전히 smoke: false입니다. 깨진 바이너리가 릴리스에 실릴 여지는 이전과 같습니다.
라인 - base는 계속 #5196(feat/macos-app) 스택입니다. opencodex 기본 선호는 base dev입니다.

메인테이너의 판단이 필요한 지점

maintainer-sponsored로 hygiene을 열어줄지. 교차 타깃 스모크를 스택 5 문서로 미룰지. 스택을 #5196에 유지할지. tip의 macos 잡이 초록으로 끝나는지만 확인하고 ready로 올릴지.

너의 추천

이 커밋은 #848 대응으로 충분합니다. 코드 리뷰 우선순위는 더 낮춥니다. 머지 전에 macos CI가 초록인지 확인한 뒤, 메인테이너가 릴리스·management 표면을 보고 maintainer-sponsored를 붙이고, #5196 랜딩 순서에 맞춰 ready로 올리는 쪽을 추천합니다.

이 댓글은 grok-bot이 작성했습니다

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Agreed on all points. e596e246 is flake-prevention only (no runtime change). Cross-target smoke for darwin-x64/linux-arm64 stays deferred to stack 5 (packaging/signing) where the release matrix gets real hosts; maintainer-sponsored, base (feat/macos-app vs dev) and ready-for-review remain maintainer calls — I'll keep this PR draft and stacked on #5196 until then.

…shards

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@lidge-jun
lidge-jun marked this pull request as ready for review September 20, 2026 11:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T11:11:09.422062Z 20bb8cf Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions
github-actions Bot marked this pull request as draft September 20, 2026 11:03
An error occurred while trying to automatically change base from feat/macos-app to dev September 20, 2026 11:04
@lidge-jun
lidge-jun marked this pull request as ready for review September 20, 2026 11:05
@github-actions github-actions Bot changed the title feat(standalone): compiled npm-free ocx binary (desktop stack 1/5) [WRONG BRANCH] feat(standalone): compiled npm-free ocx binary (desktop stack 1/5) Sep 20, 2026
@github-actions
github-actions Bot marked this pull request as draft September 20, 2026 11:05
@lidge-jun
lidge-jun marked this pull request as ready for review September 20, 2026 11:05
@github-actions
github-actions Bot marked this pull request as draft September 20, 2026 11:07

@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: 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".

Comment on lines +200 to +201
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/service/state.ts
/** Baked at install; lets status flag paths gone stale after npm prefix/nvm moves. */
bunPath?: string;
cliPath?: string;
cliPath?: string | null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/lib/bun-runtime.ts
Comment on lines +169 to +170
if (isStandaloneBinary()) {
return { path: process.execPath, source: "standalone", overrideEnv: BUN_OVERRIDE_ENV };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 });

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 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 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner

Superseded by #5318, merged to dev as 2ff7f3385d83c05279093eb9c7bdd5d5963d9605, with attribution in the branch commit.

#5196 landed first as 38a5ab9fc4eaa223d3d58982b0bc097279138fca. Squashing the bottom of a native stack detaches every child from its base, so the rest of the chain could no longer be merged through the stack: the base branches stopped resolving and the recorded bases pointed at tips the chain had been rebased away from. Replaying the branches on top of dev reproduced the already-squashed commits and produced 48 conflicts, none of them real disagreements.

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 dev.

Closing as superseded rather than stale.

@lidge-jun lidge-jun closed this Sep 20, 2026
@lidge-jun
lidge-jun deleted the devin/1789877991-standalone-binary branch September 20, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request intake: hygiene-blocked Deterministic PR hygiene checks failed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant