|
4 | 4 | normalizeModel, |
5 | 5 | filterInput, |
6 | 6 | getReasoningConfig, |
| 7 | + transformRequestBody, |
7 | 8 | } from "../../lib/request/request-transformer.js"; |
8 | | -import type { InputItem } from "../../lib/types.js"; |
| 9 | +import type { InputItem, RequestBody } from "../../lib/types.js"; |
9 | 10 | import { arbModel, arbMessageRole } from "./helpers.js"; |
10 | 11 |
|
11 | 12 | describe("normalizeModel property tests", () => { |
@@ -216,14 +217,13 @@ describe("getReasoningConfig property tests", () => { |
216 | 217 | ); |
217 | 218 | }); |
218 | 219 |
|
219 | | - it("codex/pro models upgrade none to low", () => { |
220 | | - fc.assert( |
221 | | - fc.property( |
222 | | - fc.constantFrom( |
223 | | - "gpt-5.4-pro", |
224 | | - "gpt-5.1-codex", |
225 | | - "gpt-5.2-codex", |
226 | | - "gpt-5.3-codex", |
| 220 | + it("codex models upgrade none to low", () => { |
| 221 | + fc.assert( |
| 222 | + fc.property( |
| 223 | + fc.constantFrom( |
| 224 | + "gpt-5.1-codex", |
| 225 | + "gpt-5.2-codex", |
| 226 | + "gpt-5.3-codex", |
227 | 227 | "gpt-5.1-codex-max", |
228 | 228 | ), |
229 | 229 | (model) => { |
@@ -254,3 +254,22 @@ describe("getReasoningConfig property tests", () => { |
254 | 254 | expect(result.summary).toBeDefined(); |
255 | 255 | }); |
256 | 256 | }); |
| 257 | + |
| 258 | +describe("transformRequestBody property tests", () => { |
| 259 | + it("preserves max_output_tokens across arbitrary positive integers", async () => { |
| 260 | + await fc.assert( |
| 261 | + fc.asyncProperty(fc.integer({ min: 1, max: 1_000_000 }), async (maxOutputTokens) => { |
| 262 | + const body: RequestBody = { |
| 263 | + model: "gpt-5", |
| 264 | + input: [], |
| 265 | + max_output_tokens: maxOutputTokens, |
| 266 | + }; |
| 267 | + |
| 268 | + const result = await transformRequestBody(body, "Test Codex Instructions"); |
| 269 | + expect(result.max_output_tokens).toBe(maxOutputTokens); |
| 270 | + expect(result.max_completion_tokens).toBeUndefined(); |
| 271 | + return true; |
| 272 | + }) |
| 273 | + ); |
| 274 | + }); |
| 275 | +}); |
0 commit comments