diff --git a/packages/ai/src/providers/openai-codex/request-transformer.ts b/packages/ai/src/providers/openai-codex/request-transformer.ts index df0e8be0d..91abe9dc5 100644 --- a/packages/ai/src/providers/openai-codex/request-transformer.ts +++ b/packages/ai/src/providers/openai-codex/request-transformer.ts @@ -40,10 +40,6 @@ export interface RequestBody { presence_penalty?: number; repetition_penalty?: number; reasoning?: Partial; - stream_options?: { - include_obfuscation?: boolean; - [key: string]: unknown; - }; text?: { verbosity?: "low" | "medium" | "high"; }; @@ -165,8 +161,6 @@ export async function transformRequestBody( ): Promise { body.store = false; body.stream = true; - body.stream_options ??= {}; - body.stream_options.include_obfuscation = false; if (body.input && Array.isArray(body.input)) { body.input = filterInput(body.input); diff --git a/packages/ai/test/openai-codex-stream.test.ts b/packages/ai/test/openai-codex-stream.test.ts index 9de1fb94f..2904b6a10 100644 --- a/packages/ai/test/openai-codex-stream.test.ts +++ b/packages/ai/test/openai-codex-stream.test.ts @@ -435,11 +435,7 @@ describe("openai-codex streaming", () => { expect(outbound).toBeDefined(); expect(outbound.raw[0]).toMatch(/^: ws → /); expect(outbound.data.length).toBeGreaterThan(0); - const outboundRequest = JSON.parse(outbound.data) as Record; - expect(outboundRequest).toMatchObject({ - type: "response.create", - stream_options: { include_obfuscation: false }, - }); + expect(() => JSON.parse(outbound.data)).not.toThrow(); // Inbound frames mirror the Codex response sequence emitted by `emitCodexResponse`. expect(inbound.map(e => e.event)).toEqual([