Client or integration
OpenCodex dashboard
Area
Dashboard
Summary
Right after opening the dashboard it shows "online", but within seconds
it flips back to "offline". Reproduction is not fully stable — sometimes it stays online
for a long time with no issue.
I check it with AI (for your reference, may not be correct):
Proxy is healthy (measured)
GET /healthz -> 200 {"status":"ok","service":"opencodex","version":"2.40.0","uptime":3063,"pid":44740,"port":10100}
GET / -> 200 (GUI served, session meta injected)
What we found
- GET / injects a fresh loopback GUI session token into the HTML meta
(opencodex-session-token, -csrf, -origin, -server-origin). Server-side this is
issueGuiSession() with LOOPBACK_GUI_SESSION_TTL_MS = 5 * 60_000 (gui-session.ts).
- The freshly minted token works:
curl -H "Authorization: Bearer $TOKEN"
-H "x-opencodex-gui-origin: http://localhost:10100"
http://localhost:10100/api/system/health
-> 200 {"status":"ok",...}
But the same token without x-opencodex-gui-origin returns:
401 {"error":"opencodex admin token required"} (management-auth.ts).
-
The GUI frontend only installs its window.fetch wrapper (which attaches the session
token) when Ib() validates that the meta browser origin === window.location.origin
AND meta server origin === target.serverOrigin; otherwise it clears the session
(a.session = Ab()), and every subsequent /api/* request goes out without a token
-> 401 -> dashboard shows offline.
-
Reproduction of the host mismatch:
-
After a 401 the frontend tries to re-mint via GET /opencodex-session (Xb/Qb),
and on failure sets promptCancelled permanently, so the dashboard stays offline until
the page is reloaded. This explains the flakiness: whether the retry wins or not depends
on timing/which host the request went out on.
Expected
- Loopback GUI auth should not depend on the browser host spelling being identical to the
one at mint time (localhost / 127.0.0.1 / ::1 are all loopback), or
- The 401 -> re-mint path should converge and never leave the dashboard stuck offline, and
- A single page load should never require a manual ocx start when the proxy is healthy.
Reproduction
- Start ocx and open the dashboard, wait for a few seconds.
- The dashboard turns from "online" to "offline"
(Reproduction is not fully stable. Sometimes it stays online for a long time with no issue.)
Version
2.40.0
Operating system
Windows 10
Provider and model
No response
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
Checks
Client or integration
OpenCodex dashboard
Area
Dashboard
Summary
Right after opening the dashboard it shows "online", but within seconds
it flips back to "offline". Reproduction is not fully stable — sometimes it stays online
for a long time with no issue.
I check it with AI (for your reference, may not be correct):
Proxy is healthy (measured)
What we found
(opencodex-session-token, -csrf, -origin, -server-origin). Server-side this is
issueGuiSession() with LOOPBACK_GUI_SESSION_TTL_MS = 5 * 60_000 (gui-session.ts).
curl -H "Authorization: Bearer $TOKEN"
-H "x-opencodex-gui-origin: http://localhost:10100"
http://localhost:10100/api/system/health
-> 200 {"status":"ok",...}
The GUI frontend only installs its window.fetch wrapper (which attaches the session
token) when Ib() validates that the meta browser origin === window.location.origin
AND meta server origin === target.serverOrigin; otherwise it clears the session
(a.session = Ab()), and every subsequent /api/* request goes out without a token
-> 401 -> dashboard shows offline.
Reproduction of the host mismatch:
host = "127.0.0.1"), so the common user path hits the failing host spelling.
After a 401 the frontend tries to re-mint via GET /opencodex-session (Xb/Qb),
and on failure sets promptCancelled permanently, so the dashboard stays offline until
the page is reloaded. This explains the flakiness: whether the retry wins or not depends
on timing/which host the request went out on.
Expected
one at mint time (localhost / 127.0.0.1 / ::1 are all loopback), or
Reproduction
(Reproduction is not fully stable. Sometimes it stays online for a long time with no issue.)
Version
2.40.0
Operating system
Windows 10
Provider and model
No response
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
Checks