From 708f04b02f2ed20a99b7bdf7f392171385476c45 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 10 Jan 2026 22:55:31 +0100 Subject: [PATCH] fix: keep mock openai responses requests --- src/auto-reply/reply.ts | 1 + src/gateway/gateway.tool-calling.mock-openai.test.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auto-reply/reply.ts b/src/auto-reply/reply.ts index 6f9be3111..1021ca0e9 100644 --- a/src/auto-reply/reply.ts +++ b/src/auto-reply/reply.ts @@ -589,6 +589,7 @@ export async function getReplyFromConfig( (agentCfg?.elevatedDefault as ElevatedLevel | undefined) ?? "on") : "off"; + const _providerKey = sessionCtx.Provider?.trim().toLowerCase(); const resolvedBlockStreaming = opts?.disableBlockStreaming === true ? "off" diff --git a/src/gateway/gateway.tool-calling.mock-openai.test.ts b/src/gateway/gateway.tool-calling.mock-openai.test.ts index 28ca42f3a..92b409f8c 100644 --- a/src/gateway/gateway.tool-calling.mock-openai.test.ts +++ b/src/gateway/gateway.tool-calling.mock-openai.test.ts @@ -278,6 +278,10 @@ describe("gateway (mock openai): tool calling", () => { const originalFetch = globalThis.fetch; const openaiResponsesUrl = "https://api.openai.com/v1/responses"; + const isOpenAIResponsesRequest = (url: string) => + url === openaiResponsesUrl || + url.startsWith(`${openaiResponsesUrl}/`) || + url.startsWith(`${openaiResponsesUrl}?`); const fetchImpl = async ( input: RequestInfo | URL, init?: RequestInit, @@ -289,7 +293,7 @@ describe("gateway (mock openai): tool calling", () => { ? input.toString() : input.url; - if (url === openaiResponsesUrl) { + if (isOpenAIResponsesRequest(url)) { const bodyText = typeof (init as { body?: unknown } | undefined)?.body !== "undefined" ? decodeBodyText((init as { body?: unknown }).body)