mirror of https://github.com/openclaw/openclaw.git
Fix internal gateway attestation for inter-session sends
This commit is contained in:
parent
dc61211802
commit
ba5fe7130d
|
|
@ -61,6 +61,7 @@ function createSyntheticOperatorClient(): GatewayRequestOptions["client"] {
|
|||
role: "operator",
|
||||
scopes: ["operator.admin", "operator.approvals", "operator.pairing"],
|
||||
},
|
||||
isInternalBackendClient: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,9 +140,18 @@ describe("sessions_send gateway loopback", () => {
|
|||
expect(details.sessionKey).toBe("main");
|
||||
|
||||
const firstCall = spy.mock.calls[0]?.[0] as
|
||||
| { lane?: string; inputProvenance?: { kind?: string; sourceTool?: string } }
|
||||
| {
|
||||
lane?: string;
|
||||
channel?: string;
|
||||
messageChannel?: string;
|
||||
runContext?: { messageChannel?: string };
|
||||
inputProvenance?: { kind?: string; sourceTool?: string };
|
||||
}
|
||||
| undefined;
|
||||
expect(firstCall?.lane).toBe("nested");
|
||||
expect(firstCall?.channel).toBe("inter_session");
|
||||
expect(firstCall?.messageChannel).toBe("inter_session");
|
||||
expect(firstCall?.runContext?.messageChannel).toBe("inter_session");
|
||||
expect(firstCall?.inputProvenance).toMatchObject({
|
||||
kind: "inter_session",
|
||||
sourceTool: "sessions_send",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ function createPluginRouteRuntimeClient(params: {
|
|||
role: "operator",
|
||||
scopes,
|
||||
},
|
||||
isInternalBackendClient: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -990,6 +990,9 @@ export function attachGatewayWsMessageHandler(params: {
|
|||
canvasHostUrl,
|
||||
canvasCapability,
|
||||
canvasCapabilityExpiresAtMs,
|
||||
isInternalBackendClient:
|
||||
connectParams.client.id === GATEWAY_CLIENT_IDS.GATEWAY_CLIENT &&
|
||||
connectParams.client.mode === GATEWAY_CLIENT_MODES.BACKEND,
|
||||
};
|
||||
setSocketMaxPayload(socket, MAX_PAYLOAD_BYTES);
|
||||
setClient(nextClient);
|
||||
|
|
|
|||
Loading…
Reference in New Issue