mirror of https://github.com/openclaw/openclaw.git
test: align chat abort helpers with gateway handler types
This commit is contained in:
parent
644fb76960
commit
ee1d4eb29d
|
|
@ -197,7 +197,7 @@ describe("chat abort transcript persistence", () => {
|
|||
const { transcriptPath, sessionId } = await createTranscriptFixture("openclaw-chat-stop-");
|
||||
const respond = vi.fn();
|
||||
const context = createChatAbortContext({
|
||||
chatAbortControllers: new Map([["run-stop-1", createActiveRun("main", sessionId)]]),
|
||||
chatAbortControllers: new Map([["run-stop-1", createActiveRun("main", { sessionId })]]),
|
||||
chatRunBuffers: new Map([["run-stop-1", "Partial from /stop"]]),
|
||||
chatDeltaSentAt: new Map([["run-stop-1", Date.now()]]),
|
||||
removeChatRun: vi.fn().mockReturnValue({ sessionKey: "main", clientRunId: "client-stop-1" }),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { vi } from "vitest";
|
||||
import type { GatewayRequestHandler } from "./types.js";
|
||||
|
||||
export function createActiveRun(
|
||||
sessionKey: string,
|
||||
|
|
@ -37,14 +38,7 @@ export function createChatAbortContext(overrides: Record<string, unknown> = {})
|
|||
}
|
||||
|
||||
export async function invokeChatAbortHandler(params: {
|
||||
handler: (args: {
|
||||
params: { sessionKey: string; runId?: string };
|
||||
respond: never;
|
||||
context: never;
|
||||
req: never;
|
||||
client: never;
|
||||
isWebchatConnect: () => boolean;
|
||||
}) => Promise<void>;
|
||||
handler: GatewayRequestHandler;
|
||||
context: ReturnType<typeof createChatAbortContext>;
|
||||
request: { sessionKey: string; runId?: string };
|
||||
client?: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue