Skip to content

Commit feea5ab

Browse files
feat: add GPT-6.2 Astra and GPT-6.2 Sol to Agents and AI Gateway (#32370)
Closes CODAGT-1608 This adds `gpt-6.2-astra` and `gpt-6.2-sol` to the Agents known models catalog, so they're suggested when an admin adds a chat model, and regenerates the AI Gateway price book from models.dev so the gateway can price them. | Model | Input | Output | Cache read | Cache write | |---|---|---|---|---| | GPT-6.2 Astra | $8 | $40 | $0.40 | $10 | | GPT-6.2 Sol | $2 | $10 | $0.10 | $2.50 | Prices are per 1M tokens, and both models have a 1,050,000 token context window and 128,000 max output tokens. They're in the catalog for OpenAI (with a suggested effort of `medium`, same as `gpt-6-astra` and `gpt-6.1-sol`), OpenRouter and Vercel. models.dev doesn't list them on Azure or Bedrock yet, so I've left those out for now. Both models also reject the `none` and `minimal` reasoning efforts. A model config only sets a default and a maximum effort, so the picker always offers both, and picking either one fails the turn: ``` Unsupported value: 'none' is not supported with the 'gpt-6.2-astra' model. Supported values are: 'low', 'medium', 'high', 'xhigh', and 'max'. ``` We already send `low` instead for `gpt-6-astra` and `gpt-6.1-sol`, so to fix, we'll just do the same for the two new models. All four now live in one list of model ID prefixes, rather than a helper each. I checked this against the real models: all four return a 400 like the one above for `none` and `minimal`, and accept `low`. `gpt-6-sol` and `gpt-6.1-terra` still accept `none`, so they're left alone. Regenerating the price book also brings in everything else models.dev changed since the last weekly refresh, mostly on OpenRouter and Vercel: 22 other new entries (4 of them `-pro` and `-fast` variants of these two), 29 it dropped and 51 price changes. 6 existing catalog entries get new prices or limits the same way.
1 parent 7022f3f commit feea5ab

8 files changed

Lines changed: 455 additions & 385 deletions

File tree

‎coderd/aibridge/prices/data/prices.json‎

Lines changed: 325 additions & 333 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎coderd/x/chatd/ARCHITECTURE.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,6 @@ Subagent model and effort resolution follows this precedence:
12331233

12341234
During generation preparation, the effective effort is resolved as the chat's `last_reasoning_effort` if set, else the config's `default`; clamped to the config's `max` on the global scale `none < minimal < low < medium < high < xhigh < max`; and passed through to the provider. The provider verifies whether the configured value is valid for that model at runtime. If the model config has no `reasoning_effort`, any user-selected value is ignored. The resolved value is injected into the provider-native options by `chatprovider.ProviderOptionsForCall`, which converts the model config and applies the effort in one step. For Anthropic, the fantasy provider converts effort into enabled budget thinking on models older than Claude 4.6, which reject adaptive thinking.
12351235

1236-
`applyReasoningEffort` clamps `none` and `minimal` to `low` for GPT-6 Astra and its dated snapshots (`chatopenai.IsGPT6Astra`, a case-insensitive prefix match on `gpt-6-astra`), because that model rejects `none` with HTTP 400 and lists no `minimal` effort.
1237-
12381236
##### OpenAI transport selection
12391237

12401238
OpenAI models speak either the Responses API or Chat Completions. The provider SDK picks per model from a static known-model list, so a newly released model absent from that list falls back to Chat Completions. Model configs may override the choice with `openai_config.use_responses_api` inside `chat_model_configs.options`: unset keeps the known-model list, true forces Responses, false forces Chat Completions. It sits in `openai_config` rather than `provider_options.openai` because it is applied once when the client is built, while `provider_options` holds per-request parameters.

‎coderd/x/chatd/chatopenai/transport.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package chatopenai
22

33
import (
44
"fmt"
5-
"strings"
65

76
fantasyopenai "charm.land/fantasy/providers/openai"
87
fantasyopenaicompat "charm.land/fantasy/providers/openaicompat"
@@ -62,13 +61,3 @@ func UsesResponsesAPI(modelID string, override *bool) bool {
6261
}
6362
return fantasyopenai.IsResponsesModel(modelID)
6463
}
65-
66-
// IsGPT6Astra matches gpt-6-astra and its dated snapshots.
67-
func IsGPT6Astra(modelID string) bool {
68-
return strings.HasPrefix(strings.ToLower(modelID), "gpt-6-astra")
69-
}
70-
71-
// IsGPT61Sol matches gpt-6.1-sol and its dated snapshots.
72-
func IsGPT61Sol(modelID string) bool {
73-
return strings.HasPrefix(strings.ToLower(modelID), "gpt-6.1-sol")
74-
}

‎coderd/x/chatd/chatopenai/transport_test.go‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ func TestTransportFor(t *testing.T) {
4747
}
4848
}
4949

50-
func TestIsGPT6Astra(t *testing.T) {
51-
t.Parallel()
52-
53-
require.True(t, chatopenai.IsGPT6Astra("gpt-6-astra"))
54-
require.True(t, chatopenai.IsGPT6Astra("GPT-6-Astra-2026-09-03"))
55-
require.False(t, chatopenai.IsGPT6Astra("gpt-5.6-sol"))
56-
require.False(t, chatopenai.IsGPT6Astra("gpt-6"))
57-
}
58-
59-
func TestIsGPT61Sol(t *testing.T) {
60-
t.Parallel()
61-
62-
require.True(t, chatopenai.IsGPT61Sol("gpt-6.1-sol"))
63-
require.True(t, chatopenai.IsGPT61Sol("GPT-6.1-Sol-2026-09-24"))
64-
require.False(t, chatopenai.IsGPT61Sol("gpt-6-sol"))
65-
require.False(t, chatopenai.IsGPT61Sol("gpt-6.1"))
66-
}
67-
6850
func TestTransportUsesResponses(t *testing.T) {
6951
t.Parallel()
7052

‎coderd/x/chatd/chatprovider/reasoningeffort.go‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
fantasyopenai "charm.land/fantasy/providers/openai"
1212
fantasyopenaicompat "charm.land/fantasy/providers/openaicompat"
1313

14-
"github.com/coder/coder/v2/coderd/x/chatd/chatopenai"
1514
"github.com/coder/coder/v2/codersdk"
1615
)
1716

@@ -133,11 +132,24 @@ func applyReasoningEffort(
133132
return options
134133
}
135134

135+
// openAILowFloorPrefixes lists the OpenAI models that reject none and minimal
136+
// with HTTP 400, so they start at low. Each entry is a lowercase model ID
137+
// prefix, which also matches the model's dated snapshots.
138+
var openAILowFloorPrefixes = []string{
139+
"gpt-6-astra",
140+
"gpt-6.1-sol",
141+
"gpt-6.2-astra",
142+
"gpt-6.2-sol",
143+
}
144+
136145
// openAIReasoningEffort maps the global reasoning effort scale onto what an
137-
// OpenAI model accepts. GPT-6 Astra and GPT-6.1 Sol reject none with HTTP 400
138-
// and do not list minimal, so both start at low, the lowest effort they accept.
146+
// OpenAI model accepts.
139147
func openAIReasoningEffort(modelID, effort string) string {
140-
if !chatopenai.IsGPT6Astra(modelID) && !chatopenai.IsGPT61Sol(modelID) {
148+
id := strings.ToLower(modelID)
149+
startsAtLow := slices.ContainsFunc(openAILowFloorPrefixes, func(prefix string) bool {
150+
return strings.HasPrefix(id, prefix)
151+
})
152+
if !startsAtLow {
141153
return effort
142154
}
143155
switch effort {

‎coderd/x/chatd/chatprovider/reasoningeffort_internal_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func TestApplyReasoningEffort(t *testing.T) {
7070
for _, model := range []Model{
7171
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6-astra"}, nil),
7272
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.1-sol"}, nil),
73+
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.2-astra"}, nil),
74+
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.2-sol"}, nil),
75+
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "GPT-6-Astra-2026-09-03"}, nil),
7376
} {
7477
for effort, want := range map[string]fantasyopenai.ReasoningEffort{
7578
codersdk.ChatModelReasoningEffortNone: fantasyopenai.ReasoningEffortLow,
@@ -85,7 +88,7 @@ func TestApplyReasoningEffort(t *testing.T) {
8588
}
8689

8790
// Other OpenAI models keep the caller's value.
88-
for _, modelID := range []string{"gpt-5.6-sol", "gpt-6-sol"} {
91+
for _, modelID := range []string{"gpt-5.6-sol", "gpt-6-sol", "gpt-6.1-terra"} {
8992
model := NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: modelID}, nil)
9093
got := applyReasoningEffort(model, nil, new(codersdk.ChatModelReasoningEffortNone))
9194
require.Equal(t, fantasyopenai.ReasoningEffortNone, *got[fantasyopenai.Name].(*fantasyopenai.ResponsesProviderOptions).ReasoningEffort, "model %q", modelID)

‎scripts/aibridgepricesgen/curation.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,18 @@
200200
}
201201
],
202202
"openai": [
203+
{
204+
"modelIdentifier": "gpt-6.2-astra",
205+
"reasoningEffort": "medium"
206+
},
203207
{
204208
"modelIdentifier": "gpt-6-astra",
205209
"reasoningEffort": "medium"
206210
},
211+
{
212+
"modelIdentifier": "gpt-6.2-sol",
213+
"reasoningEffort": "medium"
214+
},
207215
{
208216
"modelIdentifier": "gpt-6.1-sol",
209217
"reasoningEffort": "medium"
@@ -253,9 +261,15 @@
253261
}
254262
],
255263
"openrouter": [
264+
{
265+
"modelIdentifier": "openai/gpt-6.2-astra"
266+
},
256267
{
257268
"modelIdentifier": "openai/gpt-6-astra"
258269
},
270+
{
271+
"modelIdentifier": "openai/gpt-6.2-sol"
272+
},
259273
{
260274
"modelIdentifier": "openai/gpt-6.1-sol"
261275
},
@@ -370,9 +384,15 @@
370384
}
371385
],
372386
"vercel": [
387+
{
388+
"modelIdentifier": "openai/gpt-6.2-astra"
389+
},
373390
{
374391
"modelIdentifier": "openai/gpt-6-astra"
375392
},
393+
{
394+
"modelIdentifier": "openai/gpt-6.2-sol"
395+
},
376396
{
377397
"modelIdentifier": "openai/gpt-6.1-sol"
378398
},

‎site/src/modules/aiModels/knownModels/knownModelsGenerated.json‎

Lines changed: 90 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)