diff --git a/src/gateway/server.chat.gateway-server-chat.test.ts b/src/gateway/server.chat.gateway-server-chat.test.ts index 2873d4be533..5759fae87bc 100644 --- a/src/gateway/server.chat.gateway-server-chat.test.ts +++ b/src/gateway/server.chat.gateway-server-chat.test.ts @@ -1,8 +1,9 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import { describe, expect, test } from "vitest"; +import { describe, expect, test, vi } from "vitest"; import { WebSocket } from "ws"; +import type { GetReplyOptions } from "../auto-reply/types.js"; import { emitAgentEvent, registerAgentRunContext } from "../infra/agent-events.js"; import { extractFirstTextBlock } from "../shared/chat-message-content.js"; import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js"; @@ -166,7 +167,7 @@ describe("gateway server chat", () => { releaseBlockedReply = resolve; }); const replySpy = vi.mocked(getReplyFromConfig); - replySpy.mockImplementationOnce(async (_ctx, opts) => { + replySpy.mockImplementationOnce(async (_ctx: unknown, opts?: GetReplyOptions) => { await new Promise((resolve) => { let settled = false; const finish = () => { @@ -620,7 +621,7 @@ describe("gateway server chat", () => { test("routes block-streamed /btw replies through side-result events", async () => { await withMainSessionStore(async () => { const replyMock = vi.mocked(getReplyFromConfig); - replyMock.mockImplementationOnce(async (_ctx, opts) => { + replyMock.mockImplementationOnce(async (_ctx: unknown, opts?: GetReplyOptions) => { await opts?.onBlockReply?.({ text: "first chunk", btw: { question: "what changed?" },