Repository navigation
Description
Client or integration
OpenCodex dashboard
Area
Installation or packaging
Summary
On the Linux desktop package (open-codex .deb), a proxy that the desktop shell did not start answers GET / with the JSON fallback "dashboard":{"available":false,"reason":"GUI build not found. ..."}. If the desktop app is opened while that proxy is running, it attaches to it as a guest and the window renders that JSON instead of the dashboard. The package installs the dashboard at /usr/lib/OpenCodex/gui/dist, so the expected behavior is that /usr/bin/ocx serves it no matter who started it.
Cause. findGuiDist() in src/server/gui-static.ts tries OPENCODEX_GUI_DIST, then <directory of ocx>/gui/dist for a standalone binary, then source-tree paths. The desktop shell sets OPENCODEX_GUI_DIST only on the sidecar it spawns itself (desktop/src-tauri/src/sidecar.rs). Tauri installs bundle resources in its resource_dir: ../lib/<productName> relative to /usr/bin on Linux, and ../Resources relative to Contents/MacOS on macOS. That means /usr/bin/gui/dist never exists. Two starters run the same binary without the variable:
ocx ensurefrom the Codex autostart shim (~/.opencodex/bin/codex), which spawns/usr/bin/ocx start --port 10100detached- the user service unit (
ExecStart=... exec '/usr/bin/ocx' start --port 10100)
This is not a 2.79.0 → 2.80.0 regression. src/server/gui-static.ts, src/cli/index.ts, src/codex/shim.ts and desktop/src-tauri/src have no commits between those tags.
The macOS app bundle has the same gap on paper (OpenCodex.app/Contents/MacOS/ocx vs Contents/Resources/gui/dist), but I have not reproduced it on a Mac. Windows is unaffected: Tauri keeps resources next to the executable there, and the existing beside-the-binary candidate already covers that.
Proposed fix. For a standalone binary, also try the desktop bundle's resource directory: ../Resources/gui/dist on macOS and ../lib/OpenCodex/gui/dist on Linux. This mirrors Tauri's resource_dir. The Linux rule also covers /usr/local/bin and an AppImage's usr/bin. A PR follows.
Reproduction
- Install
open-codex2.80.0 (.deb), with the desktop app owning the runtime and the Codex autostart shim installed. - Quit OpenCodex from the tray. This stops its sidecar proxy.
- Start Codex (the Codex App, or
codexin a shell). The shim runsocx ensure, which starts/usr/bin/ocx start --port 10100. curl -s http://127.0.0.1:10100/returns the JSON fallback with"dashboard":{"available":false,...}.- Open OpenCodex again. It finds the runtime listening and attaches as a guest ("a runtime was already listening and this installation already owns it"), and its window shows that JSON.
Recovery today: quit the app, run ocx stop, and reopen the app before anything else starts a proxy. A workaround is to set OPENCODEX_GUI_DIST=/usr/lib/OpenCodex/gui/dist in the session environment (for example in ~/.config/environment.d/), so every starter inherits it.
Version
2.80.0
Operating system
Ubuntu 26.04.1 LTS (x86_64, GNOME)
Provider and model
No response
Logs or error output
$ curl -s http://127.0.0.1:10100/
{"status":"ok","service":"opencodex","version":"2.80.0","dashboard":{"available":false,"reason":"GUI build not found. Run `bun run build:gui` from the opencodex repo, or use `ocx gui` from a packaged install."},"endpoints":{"health":"/healthz","models":"/v1/models","responses":"/v1/responses","chatCompletions":"/v1/chat/completions","management":"/api/*"}}
# The listening proxy was started from the Codex App's process scope, not by the desktop shell
$ ps -o cmd= -p <pid>
/usr/bin/ocx start --port 10100
$ cat /proc/<pid>/cgroup
0::/user.slice/user-1000.slice/[email protected]/app.slice/app-org.chromium.Chromium-<n>.scope
# The package does ship the dashboard, just not where findGuiDist() looks
$ dpkg -L open-codex | grep 'gui/dist/index.html'
/usr/lib/OpenCodex/gui/dist/index.htmlScreenshots and supporting files
No response
Redacted configuration
No response
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
Ingwannu commentedon Oct 8, 2026
Source triage at dev bbab02a confirms the discovery mismatch: findGuiDist checks OPENCODEX_GUI_DIST, beside-the-standalone-executable gui/dist and source-relative paths; the desktop sidecar separately supplies resource_dir()/gui/dist, and tauri.conf.json maps the bundled GUI there with productName OpenCodex. That supports your packaging-path diagnosis; I have not independently installed the .deb or reproduced macOS behavior.
A focused PR is welcome; since you are preparing one, I am not taking over the implementation. Please use synthetic package layouts to cover Linux usr/bin -> usr/lib/OpenCodex, AppImage/custom prefix, macOS Contents/MacOS -> Contents/Resources, the existing Windows adjacent layout, explicit env-override precedence, source-checkout fallback and absent resources. Preserve the served-index/session-bootstrap behavior; discovery should not copy/build files, change a user's environment or start/stop a service. Report which packaged artifacts/platforms were actually tested, separately from path-fixture tests. No installed runtime, GUI assets or service configuration were changed here.
sungyongcho commentedon Oct 8, 2026
Thanks for the triage. PR #6722 now covers each case you listed with synthetic layouts: Linux
usr/bin→usr/lib/OpenCodex, the AppImage$APPDIR/usr/bin,/usr/localand/optprefixes, macOSContents/MacOS→Contents/Resources, and the existing Windows layout besideocx.exe. A Windows binary ignores the other two layouts. The tests also coverOPENCODEX_GUI_DISTprecedence over every layout, the source-checkout fallback, and absent resources, which keep the JSON fallback. Discovery is existence checks only, and a test asserts it leaves the fixture tree andprocess.envunchanged. Another test servesindex.htmlfrom a discovered bundle and checks the session-bootstrap meta tags.Packaged artifacts I actually tested, reported separately from the fixtures:
In each, a probe compiled from the branch resolves the packaged
gui/dist, and the same probe built fromdevreturnsnull. On Linux the branch probe also servesindex.htmlwith the session bootstrap. Windows is fixture-only plus CI, because I have no Windows machine. Details, including which commit each run used, are in the PR's Verification section.lidge-jun commentedon Oct 8, 2026
Fixed by #6722 (merged to
dev). A standaloneocxstarted outside the desktop shell (for example byocx ensurefrom the Codex autostart shim or the login service) now also looks for the dashboard in the desktop bundle's resource directory:<exe>/../lib/OpenCodex/gui/diston Linux packages and<exe>/../Resources/gui/diston macOS.OPENCODEX_GUI_DISTand agui/distnext to the binary still take precedence, and source checkouts and Windows behave as before. It will ship in the next release. Thanks for the detailed report and the fix.