Skip to content

Commit 8d1b6fe

Browse files
CopilotBunsDev
andauthored
Add nonce validation in test handshake for clearer error reporting
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/9615af9c-7cb2-409b-93c1-541b906a4a67 Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
1 parent 6de978d commit 8d1b6fe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/server/src/openclawGatewayTest.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,11 @@ export async function runOpenclawGatewayTest(
937937
const challenge = await waitForGatewayEvent(ws, "connect.challenge");
938938
captureEarlyGatewayEvents = false;
939939
earlyGatewayEvents.length = 0;
940+
if (typeof challenge?.nonce !== "string" || challenge.nonce.length === 0) {
941+
const detail = "Gateway challenge did not include a nonce.";
942+
pushStep("Gateway handshake", "fail", Date.now() - handshakeStart, detail);
943+
return finalize(false, detail, "Gateway handshake");
944+
}
940945
const connectResult = await sendGatewayRequest(
941946
ws,
942947
"connect",

0 commit comments

Comments
 (0)