Skip to content

Commit bac0cd5

Browse files
committed
fix(models): address PR review feedback for gpt-5.4-mini
1 parent 248f4a9 commit bac0cd5

3 files changed

Lines changed: 140 additions & 149 deletions

File tree

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ controls how much thinking the model does.
4848

4949
the shipped config templates include 21 presets and do not add optional IDs by default. add `gpt-5.4-pro` and/or `gpt-5.3-codex-spark` manually only for entitled workspaces.
5050
for context sizing, shipped templates use:
51-
- `gpt-5.4` and `gpt-5.4-pro`: `context=1000000`, `output=128000`
51+
- `gpt-5.4`, `gpt-5.4-mini`, and `gpt-5.4-pro`: `context=1000000`, `output=128000`
5252
- other shipped families: `context=272000`, `output=128000`
5353

5454
model normalization aliases:
5555
- legacy `gpt-5`, `gpt-5-mini`, `gpt-5-nano` map to `gpt-5.4` (not to `gpt-5.4-mini`)
56-
- snapshot ids `gpt-5.4-2026-03-05*` and `gpt-5.4-pro-2026-03-05*` map to stable `gpt-5.4` / `gpt-5.4-pro`
56+
- snapshot ids `gpt-5.4-2026-03-05*`, `gpt-5.4-mini-2026-03-05*`, and `gpt-5.4-pro-2026-03-05*` map to stable `gpt-5.4` / `gpt-5.4-mini` / `gpt-5.4-pro`
5757

5858
if your OpenCode runtime supports global compaction tuning, you can set:
5959
- `model_context_window = 1000000`

lib/request/request-transformer.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function normalizeModel(model: string | undefined): string {
8585
}
8686

8787
// 5. GPT-5.4 Mini (first-class model)
88-
if (/(?:\bgpt(?:-| )5\.4(?:-| )mini(?:\b|[- ]))/.test(normalized)) {
88+
if (/\bgpt(?:-| )5\.4(?:-| )mini(?:\b|[- ])/.test(normalized)) {
8989
return "gpt-5.4-mini";
9090
}
9191

@@ -477,11 +477,8 @@ export function getReasoningConfig(
477477
normalizedName.includes("gpt-5.4-pro") ||
478478
normalizedName.includes("gpt 5.4 pro");
479479

480-
// GPT-5.4 Mini should behave like the GPT-5.4 family, but as an explicit model.
481-
const isGpt54Mini =
482-
canonicalModelName === "gpt-5.4-mini" ||
483-
normalizedName.includes("gpt-5.4-mini") ||
484-
normalizedName.includes("gpt 5.4 mini");
480+
// GPT-5.4 Mini is a first-class explicit model.
481+
const isGpt54Mini = canonicalModelName === "gpt-5.4-mini";
485482

486483
// GPT-5.4 general purpose (latest default family)
487484
const isGpt54General =
@@ -501,17 +498,12 @@ export function getReasoningConfig(
501498
const isCodexMax =
502499
normalizedName.includes("codex-max") ||
503500
normalizedName.includes("codex max");
504-
const isCodexMini =
505-
normalizedName.includes("codex-mini") ||
506-
normalizedName.includes("codex mini") ||
507-
normalizedName.includes("codex_mini") ||
508-
normalizedName.includes("codex-mini-latest");
501+
const isCodexMini = canonicalModelName === "gpt-5.1-codex-mini";
509502
const isCodex = normalizedName.includes("codex") && !isCodexMini;
510503
const isLightweight =
511504
!isGpt54Mini &&
512505
!isCodexMini &&
513-
(normalizedName.includes("nano") ||
514-
normalizedName.includes("mini"));
506+
/\bgpt(?:-| )5(?:-| )(?:mini|nano)(?:\b|[- ])/.test(normalizedName);
515507

516508
// GPT-5.1 general purpose (not codex variants) - supports "none" per OpenAI API docs
517509
const isGpt51General =
@@ -542,7 +534,7 @@ export function getReasoningConfig(
542534
// GPT 5.1/5.2/5.4 general and GPT-5.4 Mini support "none" reasoning per:
543535
// - OpenAI API docs: "gpt-5.1 defaults to none, supports: none, low, medium, high"
544536
// - GPT-5.4 latest model docs list reasoning controls for the base model family
545-
// - GPT-5.4 Mini should stay aligned with GPT-5.4 reasoning support as an explicit model
537+
// - GPT-5.4 Mini should stay aligned with GPT-5.4 reasoning support as a first-class model
546538
// - Legacy lightweight aliases like gpt-5-mini/gpt-5-nano stay distinct and do not inherit
547539
// full "none" support from their gpt-5.4 normalization target
548540
// - Codex CLI: ReasoningEffort enum includes None variant (codex-rs/protocol/src/openai_models.rs)

0 commit comments

Comments
 (0)