Skip to content

Commit 1449bf2

Browse files
committed
test(gateway): type system-agent response helper
1 parent 42f77a3 commit 1449bf2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/gateway/server-methods/system-agent-session-ownership.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expectDefined } from "@openclaw/normalization-core";
44
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
55
import { resetCommandQueueStateForTest } from "../../process/command-queue.test-support.js";
66
import { systemAgentHandlers, type SystemAgentChatSession } from "./system-agent.js";
7-
import type { GatewayClient, GatewayRequestContext } from "./types.js";
7+
import type { GatewayClient, GatewayRequestContext, RespondFn } from "./types.js";
88

99
const setupInferenceMocks = vi.hoisted(() => ({ verifySetupInference: vi.fn() }));
1010
const delegatedInferenceMocks = vi.hoisted(() => ({
@@ -104,14 +104,15 @@ async function callChat(
104104
client: GatewayClient | null = defaultClient,
105105
): Promise<RespondCall> {
106106
const calls: RespondCall[] = [];
107+
const respond: RespondFn = (ok, payload, error) => calls.push({ ok, payload, error });
107108
await expectDefined(
108109
systemAgentHandlers["openclaw.chat"],
109110
'systemAgentHandlers["openclaw.chat"] test invariant',
110111
)({
111112
params,
112113
client,
113114
context,
114-
respond: (ok, payload, error) => calls.push({ ok, payload, error }),
115+
respond,
115116
} as never);
116117
return expectDefined(calls[0], "system-agent response");
117118
}

0 commit comments

Comments
 (0)