Skip to content

Commit 1de94f7

Browse files
committed
fix(codex): keep gpt-5.5 out of free tier
1 parent 5ec0d62 commit 1de94f7

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

internal/registry/model_definitions.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func GetAIStudioModels() []*ModelInfo {
5151

5252
// GetCodexFreeModels returns model definitions for the Codex free plan tier.
5353
func GetCodexFreeModels() []*ModelInfo {
54-
return WithCodexBuiltins(cloneModelInfos(getModels().CodexFree))
54+
return upsertModelInfos(cloneModelInfos(getModels().CodexFree), codexBuiltinImageModelInfo())
5555
}
5656

5757
// GetCodexTeamModels returns model definitions for the Codex team plan tier.
@@ -79,9 +79,9 @@ func GetAntigravityModels() []*ModelInfo {
7979
return cloneModelInfos(getModels().Antigravity)
8080
}
8181

82-
// WithCodexBuiltins injects hard-coded Codex-only model definitions that should
83-
// not depend on remote models.json updates. Built-ins replace any matching IDs
84-
// already present in the provided slice.
82+
// WithCodexBuiltins injects hard-coded Codex-only model definitions for paid
83+
// plan tiers that should not depend on remote models.json updates. Built-ins
84+
// replace any matching IDs already present in the provided slice.
8585
func WithCodexBuiltins(models []*ModelInfo) []*ModelInfo {
8686
return upsertModelInfos(models, codexBuiltinImageModelInfo(), codexBuiltinGPT55ModelInfo())
8787
}

internal/registry/model_definitions_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ package registry
22

33
import "testing"
44

5-
func TestCodexStaticModelsIncludeGPT55(t *testing.T) {
5+
func TestCodexFreeStaticModelsExcludeGPT55(t *testing.T) {
6+
model := findModelInfo(GetCodexFreeModels(), "gpt-5.5")
7+
if model != nil {
8+
t.Fatalf("expected codex free tier to exclude gpt-5.5, got %q", model.ID)
9+
}
10+
}
11+
12+
func TestCodexPaidStaticModelsIncludeGPT55(t *testing.T) {
613
tierModels := map[string][]*ModelInfo{
7-
"free": GetCodexFreeModels(),
814
"team": GetCodexTeamModels(),
915
"plus": GetCodexPlusModels(),
1016
"pro": GetCodexProModels(),

0 commit comments

Comments
 (0)