diff --git a/src/commands/agent-via-gateway.e2e.test.ts b/src/commands/agent-via-gateway.e2e.test.ts index f506329380f..d5489e53d8b 100644 --- a/src/commands/agent-via-gateway.e2e.test.ts +++ b/src/commands/agent-via-gateway.e2e.test.ts @@ -34,7 +34,7 @@ vi.mock("../gateway/client.js", () => { async request(method: string, params?: Record) { if (method === "agent.subscribe") { - const sessionKey = String(params?.sessionKey ?? ""); + const sessionKey = typeof params?.sessionKey === "string" ? params.sessionKey : ""; const onEvent = this.opts.onEvent as ((evt: Record) => void) | undefined; onEvent?.({ event: "agent",