Repository navigation
fix(ui): login screen reports "Gateway unreachable" when the account has no Gateway access - #159948
Conversation
…way unreachable A signed-in person whose account has no active Gateway access (for example a profile without a role on a Gateway whose default role requires an access-policy grant) was refused with FORBIDDEN and close 1008, but the rejection carried no structured detail, so the login gate fell through to "Gateway unreachable" and told them to check whether the Gateway was running. The rejection now carries an OPERATOR_ACCESS_DENIED connect-error detail code, and the login gate shows "No access to this Gateway" with administrator guidance. The code stays retryable so the page reconnects on its own once access is granted. The shared denial message is now neutral for first-time and revoked access.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 7:09 PM ET / 23:09 UTC. ClawSweeper reviewWhat this changesThe branch adds a structured Gateway access-denial response and uses it to show account-specific recovery guidance on the Control UI login screen. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main and the latest release still classify an operator access denial as a network failure in the Control UI; the proposed fix addresses that distinct, observed problem. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway authenticates a browser connection and checks the person's current operator access before admitting it. The Control UI turns a rejected connection into login guidance and retries when access is later granted. flowchart LR
A[Signed-in browser] --> B[Gateway handshake]
B --> C{Operator access policy}
C -->|Denied| D[Structured denial]
D --> E[Control UI login gate]
E --> F[Administrator guidance]
C -->|Granted| G[Connected dashboard]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +34, Tests +25, Docs +7. Total +66 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the access decision in the Gateway and present its stable denial signal as administrator-guided login recovery while preserving automatic retry. Do we have a high-confidence way to reproduce the issue? Yes. A verified user denied by a role-bound access policy follows a source-proven current-main path from an unstructured FORBIDDEN response to the network message; this reviewer did not execute that path. Is this the best way to solve the issue? Yes. An additive detail on the existing rejection and a matching UI classification address the misleading message without adding another access-policy owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9133dc399322. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
CI note: the first run on head This PR only changes how a refused connect is classified on the login gate, so it cannot reach that path. The case is green on current main (the latest red main UI E2E shard, run 36371252696, failed a different test, |
…way unreachable (openclaw#159948) A signed-in person whose account has no active Gateway access (for example a profile without a role on a Gateway whose default role requires an access-policy grant) was refused with FORBIDDEN and close 1008, but the rejection carried no structured detail, so the login gate fell through to "Gateway unreachable" and told them to check whether the Gateway was running. The rejection now carries an OPERATOR_ACCESS_DENIED connect-error detail code, and the login gate shows "No access to this Gateway" with administrator guidance. The code stays retryable so the page reconnects on its own once access is granted. The shared denial message is now neutral for first-time and revoked access.
|
Follow-up on the history-recovery failure: it was a real product scroll-geometry race that #159924 ( |
What Problem This Solves
Fixes: the Control UI login screen says "Gateway unreachable" and tells people to check whether the Gateway is running when the Gateway is actually up and refusing them because their account has no active access (for example, a newly signed-in teammate whose profile has no role yet on a Gateway whose default role requires an access-policy grant).
User Impact
User impact: a signed-in person without Gateway access now sees "No access to this Gateway" with the next useful step: ask an administrator to assign a role or grant access, with the exact
openclaw users list --jsoncommand for the administrator. The page still reconnects on its own once access is granted. The server's denial text no longer says "no longer active" to people who never had access.Why This Change Was Made
The Gateway already rejected these connections deliberately (
FORBIDDEN, close 1008, causeoperator-access-denied), but sent no structured detail, so the login gate's classifier fell through to its network bucket. The rejection now carries a newOPERATOR_ACCESS_DENIEDconnect-error detail code, and the login gate keys a dedicatedaccess-deniedstate on that code rather than on message text. The shared denial message is neutral ("not active for this account … grant or restore access") because the same text serves first-time denial, later revocation (4001), and HTTP 403 paths.The new code is deliberately not a reconnect-pause code: clients keep their normal backoff, so access granted by an administrator applies without user action. Native clients ignore unknown detail codes and are unchanged.
Release-note context: Control UI now explains Gateway access-policy denials ("No access to this Gateway") instead of reporting the Gateway as unreachable.
Evidence
Observed in production on 2026-09-27: a newly signed-in teammate on a production trusted-proxy Gateway (default role bound to
accessPolicyPlugin: "visitor-access", profile had no role yet) had 62 connects refused withcode=1008 cause=operator-access-deniedwhile the browser showed "Gateway unreachable". After the administrator assigned the role, the same open tab reconnected by itself within seconds, which is the reconnect behavior this change keeps.Before/after, rendered by the Control UI E2E harness with a mocked Gateway replaying each era's real rejection (before: old message, no detail; after: new message plus
OPERATOR_ACCESS_DENIED). Fixture data only.After, dark theme:
Focused checks:
pnpm test ui/src/components/login-gate.test.ts --maxWorkers=1: 29 passed (4.5 s wall). The new case fails on the original classifier (expected access-denied, received network).pnpm test src/gateway/server.auth.identity-scopes.test.ts --maxWorkers=1: 23 passed. Two existing connect-denial assertions now also requiredetails.code === "OPERATOR_ACCESS_DENIED"; no new Gateway boots or test cases, so the suite's existing ~2.5 min wall is unchanged. Fails without the server detail.pnpm tsgo:core,pnpm tsgo:ui, changed test typecheck shards,pnpm ui:i18n:baseline(unchanged),pnpm ui:i18n:verify,oxfmt,git diff --check: pass.