Repository navigation
Description
Client or integration
Other: OpenCodex CLI
Area
CLI
Summary
ocx link status returns 403 on a hub whose public listener is bound to a non-loopback address and whose management API uses the dedicated loopback listener. The command should be able to read link status with the local admin credential.
Reproduction
- Run a hub with a non-loopback public listener and the dedicated loopback management listener enabled.
- Ensure the local admin token is configured and run
ocx link status. - The command returns
Link management request failed (403). A direct request to the loopback management listener with the admin token also returns 403 with theforbiddencode. The request without a token returns 401.
This was observed on 2.96.0 and again after upgrading and restarting on 2.97.0. The proxy itself was healthy.
The likely cause is that trustedLoopbackForIngress does not mark hub-management as trusted, while the link routes require both an admin-token principal and trusted loopback ingress. Those conditions appear incompatible for the local admin request. The same code is present on main at cab7eb7d0332ae0ebb4289d7c6bac1de666b6e40; the live reproduction was on the published package, not a clean source checkout. PR #6913 describes why a management-listener mark alone must not confer trusted-loopback authority, so a fix needs to preserve that boundary for forwarded requests.
Version
2.96.0 and 2.97.0
Operating system
Ubuntu 24.04.5 LTS, Linux arm64
Provider and model
Not applicable.
Logs or error output
Error: Link management request failed (403)
Direct authenticated management response: {"error":{"code":"forbidden","message":"The required link authorization was not present."}}
Screenshots and supporting files
None.
Redacted configuration
Hub role, public listener bound to a non-loopback address, dedicated loopback management listener.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
github-actions commentedon Nov 5, 2026
Automated translation bookkeeping — detected language: English.
Ingwannu commentedon Nov 7, 2026
Confirmed on
dev(aaa3c20f3f), and it is the documented boundary, not a regression:trustedLoopbackForIngressreturns true only for the unauthenticated loopback listener or a public listener bound to a loopback hostname (src/server/index/serve-options.ts:225-228). Hub-management, hub-link and claude-intercept ingresses are never trusted loopback (structure/remote-link.md:55). The listener mark alone must not grant loopback authority, because a local forwarder such as Tailscale Serve terminates on it.GET /api/link/statususesauth(ctx, "either")(src/server/management/link-routes.ts:269-271). That admits a dashboard session, or an admin token only withtrustedLoopbackIngress(src/server/management/link-route-state.ts:85-95). On a hub, the dashboard branch also needs a paired session.So
ocx link statuson a hub with a non-loopback public bind fails with 403 on either listener, even with the local admin token. That leaves the CLI unusable in that topology. Fixing it means deciding which authority should admit a local CLI read on such a hub without letting forwarded requests through: for example, a read-only status exception for the admin-token principal, or a dedicated CLI credential. That is an owner decision. Leaving this open for it. Until then, use a paired dashboard session on the hub to see link status.jayjay181818 commentedon Nov 7, 2026
Another data point, on Windows and 2.98.0, plus a knock-on effect in GOAT.
Setup: Windows 11 Pro 10.0.26300, OpenCodex 2.98.0 run by OpenCodex Desktop.
runtimeRole hub,hostname 0.0.0.0,unauthenticatedLoopbackListener {enabled:true, port:10102},hub.managementIngress {enabled:true, port:10101}, with Tailscale Serve in front of 10100 and 10101.Same result:
ocx link statuson the Hub returnsLink management request failed (403), with or without the admin token. A paired dashboard session works.Why
hostnamecan't be loopback here: withhostnameset to the PC's own Tailscale IP, Desktop never started the runtime (ocx resolve's 1500 ms probe times out; I'm filing that separately).0.0.0.0is the workaround, so a loopback public listener isn't available in this topology.Knock-on effect: GOAT's
hub.device_join(joining a machine to the Hub as a Hub client) runs a link-status preflight on the Hub. It fails with "This machine's OpenCodex link status is unavailable", so GOAT can't join devices to a Hub at all until this is decided. A read-only status exception for the local admin token, as suggested above, would unblock it. I'm filing the GOAT side in goat-si/goat.jayjay181818 commentedon Nov 7, 2026
GOAT side: goat-si/goat#2663
Ingwannu commentedon Nov 8, 2026
New information from this report, on top of the analysis above, checked against origin/dev f8dfc2f:
ocx link statusreturns 403 on the hub both with and without the admin token, and a paired dashboard session works. The code predicts exactly this: the admin token needs trusted loopback (src/server/management/link-route-state.ts:85-95), and the hub-management and public wildcard listeners do not get it (src/server/index/serve-options.ts:225-228).hostnamechoice here is constrained by [Bug][Windows] Desktop never starts the runtime when hostname is the machine's own Tailscale IP (ocx resolve 1500 ms probe times out) #8318 (a Tailscale IP ashostnamedoes not start Desktop on Windows), so the workaround is0.0.0.0, which means no loopback public listener. Any fix for this issue must work with a wildcard public bind as well as a loopback one.Still open and owner-owned, as noted above: which authority admits a local CLI read on a hub, without letting forwarded requests through.
Merge dev to resolve structure ownership conflict for #8184
fix(link): keep local control socket ownership across runtimes (#8184)
fix(link): serialize control socket ownership with the claim mutex (#…
fix(link): hand the control socket over before the stop suspends (#8184)
fix(link): release the control socket before the rest of the shutdown (…
fix(link): serve ocx link status over a private local control socket (#…