Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ job := harness.Job{
Workspace: "/work",
SrcDir: ".",
SkillName: skill.Name,
Model: "gpt-5.3-codex",
Model: "gpt-6.1-sol",
OutputFile: "report.json",
}
if _, err := harness.StageSkill(h, job, nil, skill); err != nil {
Expand Down
19 changes: 12 additions & 7 deletions codex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Collaborator

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_version to 0.153.0 for the three tiered models and 0.155.0 for gpt-6-sol and gpt-6-luna, while the codexLine comment names Codex 0.147.0 as the verified version. I haven't checked how an older CLI handles --model gpt-6.1-sol, so you might note the 0.153.0 floor here for callers that pin Codex.

// 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"},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's defaults have no gpt-5.2, so dropping it here leaves its modelPricing row outside both TestDefaultModelsArePriced and the models.dev drift check. You may want to delete that row along with this entry.

{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},
}
}

Expand Down
19 changes: 19 additions & 0 deletions codex_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package harness

import (
"math"
"slices"
"strings"
"testing"
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected cost repeats the gpt-6.1-sol rates from pricing.go, so a price update that the models.dev check flags means editing this test too. It may be worth computing want from modelPricing[model], which leaves the test pinning the token mapping it adds over TestCodexArgsAndStream.

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()

Expand Down
4 changes: 2 additions & 2 deletions copilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ func (CopilotHarness) DefaultModels() []ModelDefault {
{Name: "Claude Sonnet 4.6", ID: "claude-sonnet-4.6", Tier: modelTierMid},
{Name: "Claude Opus 4.6", ID: "claude-opus-4.6", Tier: modelTierHigh},
{Name: "Claude Haiku 4.5", ID: "claude-haiku-4.5"},
{Name: "GPT-5.6 Terra", ID: "gpt-5.6-terra"},
{Name: "GPT-5.6 Luna", ID: "gpt-5.6-luna"},
{Name: "GPT-5.6 Terra", ID: modelGPT56TerraID},
{Name: "GPT-5.6 Luna", ID: modelGPT56LunaID},
{Name: "GPT-5.5", ID: modelGPT55ID},
{Name: "GPT-5.4", ID: modelGPT54ID},
{Name: "GPT-5.4 mini", ID: modelGPT54MiniID},
Expand Down
2 changes: 2 additions & 0 deletions harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const (
modelGPT54ID = "gpt-5.4"
modelGPT55ID = "gpt-5.5"
modelGPT56SolID = "gpt-5.6-sol"
modelGPT56TerraID = "gpt-5.6-terra"
modelGPT56LunaID = "gpt-5.6-luna"
modelDaybreakBlueID = "gpt-daybreak-blue-latest"

modelTierMid = "mid"
Expand Down
14 changes: 12 additions & 2 deletions pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,21 @@ var modelPricing = map[string]modelPrice{
// OpenAI
// Sol's promotional standard rates apply through 2026-11-30.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenAI's pricing page ties the promotion ending 2026-11-30 to gpt-5.6-sol, but the new rows put this comment above gpt-6.1-sol, the new Codex default, and two other Sol models. You could move the GPT-6 rows below the GPT-5.6 block or name gpt-5.6-sol in the comment.

// 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}),
Expand Down
4 changes: 2 additions & 2 deletions pricing_feed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func TestPricingDrift_reportsDifferences(t *testing.T) {
delete(anthropic["claude-haiku-5-5"], "tiers")
delete(anthropic, "claude-fable-5-2")
anthropic["claude-opus-4-8"]["tiers"] = []map[string]any{fixtureTier(200_000, 10, 37.5, 1, 12.5)}
feed["openai"]["gpt-5.5"]["tiers"] = []map[string]any{fixtureTier(272_000, 10, 50, 1, 0)}
feed["openai"]["gpt-6.1-sol"]["tiers"] = []map[string]any{fixtureTier(272_000, 4, 20, 0.2, 5)}
feed["github-copilot"]["gpt-5-mini"] = nil

want := []string{
Expand All @@ -298,7 +298,7 @@ func TestPricingDrift_reportsDifferences(t *testing.T) {
"anthropic/claude-opus-5-5 input: table 4, feed 3.5",
"anthropic/claude-sonnet-5-5 cache_write: table 2.5, feed 9",
"github-copilot/gpt-5-mini missing: feed has no price",
"openai/gpt-5.5 long_prompt: table over 272000 tokens in=10 out=45 cache_read=1 cache_write=0, feed over 272000 tokens in=10 out=50 cache_read=1 cache_write=0",
"openai/gpt-6.1-sol long_prompt: table over 272000 tokens in=4 out=15 cache_read=0.2 cache_write=5, feed over 272000 tokens in=4 out=20 cache_read=0.2 cache_write=5",
}
if got := pricingDrift(feed.decode(t), nil); !slices.Equal(got, want) {
t.Errorf("pricingDrift() =\n%s\nwant\n%s", strings.Join(got, "\n"), strings.Join(want, "\n"))
Expand Down
Loading