diff --git a/src/agents/model-compat.test.ts b/src/agents/model-compat.test.ts index f6aece9d674..9959eeb4612 100644 --- a/src/agents/model-compat.test.ts +++ b/src/agents/model-compat.test.ts @@ -87,13 +87,6 @@ function expectSupportsDeveloperRoleForcedOff(overrides?: Partial>): expect(supportsDeveloperRole(normalized)).toBe(false); } -function expectSupportsUsageInStreamingForcedOff(overrides?: Partial>): void { - const model = { ...baseModel(), ...overrides }; - delete (model as { compat?: unknown }).compat; - const normalized = normalizeModelCompat(model as Model); - expect(supportsUsageInStreaming(normalized)).toBe(false); -} - function expectResolvedForwardCompat( model: Model | undefined, expected: { provider: string; id: string }, diff --git a/src/gateway/call.ts b/src/gateway/call.ts index 2c4184e3792..af7d3736e1d 100644 --- a/src/gateway/call.ts +++ b/src/gateway/call.ts @@ -81,11 +81,7 @@ export type GatewayConnectionDetails = { message: string; }; -function shouldAttachDeviceIdentityForGatewayCall(_params: { - url: string; - token?: string; - password?: string; -}): boolean { +function shouldAttachDeviceIdentityForGatewayCall(): boolean { // Even when local CLI calls authenticate with a shared gateway token/password, // we still want to attach device identity so paired operator scopes remain // available for detail RPCs such as status / system-presence / last-heartbeat. @@ -829,7 +825,7 @@ async function executeGatewayRequestWithScopes(params: { mode: opts.mode ?? GATEWAY_CLIENT_MODES.CLI, role: "operator", scopes, - deviceIdentity: shouldAttachDeviceIdentityForGatewayCall({ url, token, password }) + deviceIdentity: shouldAttachDeviceIdentityForGatewayCall() ? loadOrCreateDeviceIdentity() : undefined, minProtocol: opts.minProtocol ?? PROTOCOL_VERSION, diff --git a/src/gateway/probe.test.ts b/src/gateway/probe.test.ts index 1fd9a0d4bf2..4f3628149ba 100644 --- a/src/gateway/probe.test.ts +++ b/src/gateway/probe.test.ts @@ -79,6 +79,7 @@ describe("probeGateway", () => { }); expect(result.ok).toBe(true); + expect(gatewayClientState.options?.deviceIdentity).toBeNull(); expect(gatewayClientState.requests).toEqual([]); }); }); diff --git a/src/gateway/probe.ts b/src/gateway/probe.ts index ab9f88a213c..72d232ddaae 100644 --- a/src/gateway/probe.ts +++ b/src/gateway/probe.ts @@ -61,6 +61,7 @@ export async function probeGateway(opts: { clientVersion: "dev", mode: GATEWAY_CLIENT_MODES.PROBE, instanceId, + deviceIdentity: opts.includeDetails === false ? null : undefined, onConnectError: (err) => { connectError = formatErrorMessage(err); }, diff --git a/src/gateway/server/ws-connection/message-handler.ts b/src/gateway/server/ws-connection/message-handler.ts index 655558e12cb..49f70915992 100644 --- a/src/gateway/server/ws-connection/message-handler.ts +++ b/src/gateway/server/ws-connection/message-handler.ts @@ -684,7 +684,8 @@ export function attachGatewayWsMessageHandler(params: { hasBrowserOriginHeader, sharedAuthOk, authMethod, - }) || shouldSkipControlUiPairing(controlUiAuthPolicy, role, trustedProxyAuthOk); + }) || + shouldSkipControlUiPairing(controlUiAuthPolicy, role, trustedProxyAuthOk); if (device && devicePublicKey && !skipPairing) { const formatAuditList = (items: string[] | undefined): string => { if (!items || items.length === 0) {