Skip to content

Commit fa29a36

Browse files
committed
fix: coerce pro minimal effort to medium
1 parent 178c84c commit fa29a36

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

lib/request/request-transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export function getReasoningConfig(
612612
// GPT-5.4 Pro only supports medium/high/xhigh reasoning.
613613
// originalRequestedEffort is a non-sensitive model setting string, not a token.
614614
// Logging this coercion does not introduce new redaction or filesystem-race risk.
615-
if (isGpt54Pro && effort === "low") {
615+
if (isGpt54Pro && (effort === "low" || effort === "minimal")) {
616616
logWarn(
617617
`GPT-5.4 Pro supports medium/high/xhigh only; coercing '${originalRequestedEffort}' to 'medium'`,
618618
);

test/property/transformer.property.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ describe("getReasoningConfig property tests", () => {
244244
);
245245
});
246246

247+
it("gpt-5.4-pro upgrades minimal to medium", () => {
248+
fc.assert(
249+
fc.property(fc.constant("gpt-5.4-pro"), (model) => {
250+
const result = getReasoningConfig(model, { reasoningEffort: "minimal" });
251+
expect(result.effort).toBe("medium");
252+
return true;
253+
})
254+
);
255+
});
256+
247257
it("gpt-5.1, gpt-5.2, and gpt-5.4 general support none effort", () => {
248258
fc.assert(
249259
fc.property(

test/request-transformer.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,19 @@ describe('Request Transformer Module', () => {
15181518
expect(result.reasoning?.effort).toBe('medium');
15191519
});
15201520

1521+
it('should coerce minimal to medium for gpt-5.4-pro', async () => {
1522+
const body: RequestBody = {
1523+
model: 'gpt-5.4-pro',
1524+
input: [],
1525+
};
1526+
const userConfig: UserConfig = {
1527+
global: { reasoningEffort: 'minimal' },
1528+
models: {},
1529+
};
1530+
const result = await transformRequestBody(body, codexInstructions, userConfig);
1531+
expect(result.reasoning?.effort).toBe('medium');
1532+
});
1533+
15211534
it('should default codex-max to high effort', async () => {
15221535
const body: RequestBody = {
15231536
model: 'gpt-5.1-codex-max',

0 commit comments

Comments
 (0)