From fa0a9ce2af9d8ec656aae323ffb28ef27b8d055d Mon Sep 17 00:00:00 2001 From: XING Date: Sun, 22 Mar 2026 13:34:54 +0800 Subject: [PATCH] fix(control-ui): add missing operator.read and operator.write scopes to connect params The Control UI websocket connect params declared only admin, approvals, and pairing scopes, omitting operator.read and operator.write. This caused the gateway to reject all agent/send RPC calls from the dashboard webchat with "missing scope: operator.write". Add the two missing scopes to the connect params array so dashboard webchat can send messages and read session state. Fixes #52087 Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/ui/gateway.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/ui/gateway.ts b/ui/src/ui/gateway.ts index 6f628b619ab..62f164fb149 100644 --- a/ui/src/ui/gateway.ts +++ b/ui/src/ui/gateway.ts @@ -242,7 +242,13 @@ export class GatewayBrowserClient { // Gateways may reject this unless gateway.controlUi.allowInsecureAuth is enabled. const isSecureContext = typeof crypto !== "undefined" && !!crypto.subtle; - const scopes = ["operator.admin", "operator.approvals", "operator.pairing"]; + const scopes = [ + "operator.admin", + "operator.read", + "operator.write", + "operator.approvals", + "operator.pairing", + ]; const role = "operator"; const explicitGatewayToken = this.opts.token?.trim() || undefined; const explicitPassword = this.opts.password?.trim() || undefined;