fix: keep openai-codex on HTTP responses transport

This commit is contained in:
nanakotsai
2026-03-27 11:39:16 +08:00
committed by Ayaan Zaidi
parent e06069c8c2
commit 571da81a35
2 changed files with 10 additions and 13 deletions

View File

@@ -11,15 +11,6 @@ describe("openai websocket transport selection", () => {
).toBe(true);
});
it("accepts the Codex responses transport pair", () => {
expect(
shouldUseOpenAIWebSocketTransport({
provider: "openai-codex",
modelApi: "openai-codex-responses",
}),
).toBe(true);
});
it("rejects mismatched OpenAI websocket transport pairs", () => {
expect(
shouldUseOpenAIWebSocketTransport({
@@ -33,6 +24,12 @@ describe("openai websocket transport selection", () => {
modelApi: "openai-responses",
}),
).toBe(false);
expect(
shouldUseOpenAIWebSocketTransport({
provider: "openai-codex",
modelApi: "openai-codex-responses",
}),
).toBe(false);
expect(
shouldUseOpenAIWebSocketTransport({
provider: "anthropic",

View File

@@ -35,10 +35,10 @@ export function shouldUseOpenAIWebSocketTransport(params: {
provider: string;
modelApi?: string | null;
}): boolean {
return (
(params.modelApi === "openai-responses" && params.provider === "openai") ||
(params.modelApi === "openai-codex-responses" && params.provider === "openai-codex")
);
// openai-codex normalizes to the ChatGPT backend HTTP path, not the public
// OpenAI Responses websocket endpoint. Keep it on HTTP until a provider-
// specific websocket target exists and is verified end-to-end.
return params.modelApi === "openai-responses" && params.provider === "openai";
}
export function shouldAppendAttemptCacheTtl(params: {