Repository navigation
Mirror Codex's current model catalog in its defaults #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -285,14 +285,19 @@ func (CodexHarness) StateEnv(dir string) []string { | |
| } | ||
|
|
||
| func (CodexHarness) DefaultModels() []ModelDefault { | ||
| // IDs mirror Codex's built-in model catalog. The Codex-tuned model comes | ||
| // first because that is the CLI's default when --model is absent. | ||
| // IDs mirror the listed models in Codex 0.169.0's bundled catalog, in its | ||
| // priority order, except GPT-5.5, which Codex rejects for ChatGPT logins. | ||
| // GPT-6.1 Sol comes first because that is the CLI's default when --model is | ||
| // absent. | ||
| return []ModelDefault{ | ||
| {Name: "GPT-5.3 Codex", ID: modelGPT53CodexID, Tier: modelTierHigh}, | ||
| {Name: "GPT-5.4 mini", ID: modelGPT54MiniID, Tier: modelTierMid}, | ||
| {Name: "GPT-5.4", ID: modelGPT54ID}, | ||
| {Name: "GPT-5.5", ID: modelGPT55ID, Tier: modelTierMax}, | ||
| {Name: "GPT-5.2", ID: "gpt-5.2"}, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copilot's defaults have no |
||
| {Name: "GPT-6.1 Sol", ID: "gpt-6.1-sol", Tier: modelTierHigh}, | ||
| {Name: "GPT-6 Astra", ID: "gpt-6-astra", Tier: modelTierMax}, | ||
| {Name: "GPT-6 Sol", ID: "gpt-6-sol"}, | ||
| {Name: "GPT-6 Luna", ID: "gpt-6-luna"}, | ||
| {Name: "GPT-5.6 Sol", ID: modelGPT56SolID}, | ||
| {Name: "GPT-6.1 Terra", ID: "gpt-6.1-terra", Tier: modelTierMid}, | ||
| {Name: "GPT-5.6 Terra", ID: modelGPT56TerraID}, | ||
| {Name: "GPT-5.6 Luna", ID: modelGPT56LunaID}, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| package harness | ||
|
|
||
| import ( | ||
| "math" | ||
| "slices" | ||
| "strings" | ||
| "testing" | ||
|
|
@@ -43,6 +44,24 @@ func TestCodexArgsAndStream(t *testing.T) { | |
| } | ||
| } | ||
|
|
||
| func TestCodexDefaultModelResultCost(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| model := CodexHarness{}.DefaultModels()[0].ID | ||
| if model != "gpt-6.1-sol" { | ||
| t.Fatalf("default model = %q, want gpt-6.1-sol", model) | ||
| } | ||
| input := `{"type":"turn.completed","usage":{"input_tokens":100000,"cached_input_tokens":40000,"output_tokens":5000}}` | ||
| var result Event | ||
| CodexHarness{}.ParseStream(strings.NewReader(input), func(event Event) { | ||
| result = event | ||
| }) | ||
| want := (60000*2.00 + 40000*0.10 + 5000*10.00) / 1e6 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The expected cost repeats the |
||
| if got := CostFromUsage(model, result.Usage); math.Abs(got-want) > 1e-9 { | ||
| t.Errorf("CostFromUsage(%q, %+v) = %v, want %v", model, result.Usage, got, want) | ||
| } | ||
| } | ||
|
|
||
| func TestCodexArgsConfigOverrides(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,11 +74,21 @@ var modelPricing = map[string]modelPrice{ | |
| // OpenAI | ||
| // Sol's promotional standard rates apply through 2026-11-30. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OpenAI's pricing page ties the promotion ending |
||
| // https://developers.openai.com/api/docs/pricing | ||
| "gpt-6.1-sol": modelPrice{In: 2.00, Out: 10.00, CachedIn: 0.10, CacheWrite: 2.50}. | ||
| over(openAILongPrompt, modelPrice{In: 4.00, Out: 15.00, CachedIn: 0.20, CacheWrite: 5.00}), | ||
| "gpt-6.1-terra": modelPrice{In: 1.00, Out: 5.00, CachedIn: 0.05, CacheWrite: 1.25}. | ||
| over(openAILongPrompt, modelPrice{In: 2.00, Out: 7.50, CachedIn: 0.10, CacheWrite: 2.50}), | ||
| "gpt-6-astra": modelPrice{In: 10.00, Out: 50.00, CachedIn: 1.00, CacheWrite: 12.50}. | ||
| over(openAILongPrompt, modelPrice{In: 20.00, Out: 75.00, CachedIn: 2.00, CacheWrite: 25.00}), | ||
| "gpt-6-sol": modelPrice{In: 2.00, Out: 10.00, CachedIn: 0.20, CacheWrite: 2.50}. | ||
| over(openAILongPrompt, modelPrice{In: 4.00, Out: 15.00, CachedIn: 0.40, CacheWrite: 5.00}), | ||
| "gpt-6-luna": modelPrice{In: 0.10, Out: 0.50, CachedIn: 0.01, CacheWrite: 0.125}. | ||
| over(openAILongPrompt, modelPrice{In: 0.20, Out: 0.75, CachedIn: 0.02, CacheWrite: 0.25}), | ||
| modelGPT56SolID: modelPrice{In: 4.00, Out: 20.00, CachedIn: 0.40, CacheWrite: 5.00}. | ||
| over(openAILongPrompt, modelPrice{In: 8.00, Out: 30.00, CachedIn: 0.80, CacheWrite: 10.00}), | ||
| "gpt-5.6-terra": modelPrice{In: 2.00, Out: 12.00, CachedIn: 0.20, CacheWrite: 2.50}. | ||
| modelGPT56TerraID: modelPrice{In: 2.00, Out: 12.00, CachedIn: 0.20, CacheWrite: 2.50}. | ||
| over(openAILongPrompt, modelPrice{In: 4.00, Out: 18.00, CachedIn: 0.40, CacheWrite: 5.00}), | ||
| "gpt-5.6-luna": modelPrice{In: 0.20, Out: 1.20, CachedIn: 0.02, CacheWrite: 0.25}. | ||
| modelGPT56LunaID: modelPrice{In: 0.20, Out: 1.20, CachedIn: 0.02, CacheWrite: 0.25}. | ||
| over(openAILongPrompt, modelPrice{In: 0.40, Out: 1.80, CachedIn: 0.04, CacheWrite: 0.50}), | ||
| modelGPT55ID: modelPrice{In: 5.00, Out: 30.00, CachedIn: 0.50}. | ||
| over(openAILongPrompt, modelPrice{In: 10.00, Out: 45.00, CachedIn: 1.00}), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bundled catalog sets
minimal_client_versionto0.153.0for the three tiered models and0.155.0forgpt-6-solandgpt-6-luna, while thecodexLinecomment names Codex0.147.0as the verified version. I haven't checked how an older CLI handles--model gpt-6.1-sol, so you might note the0.153.0floor here for callers that pin Codex.