From 6245b4f3d86f7fec3b70467eb95ed046a37be034 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Mar 2026 23:17:05 +0000 Subject: [PATCH] test: import vi in gateway chat server test --- src/gateway/server.chat.gateway-server-chat.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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?" },