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.
This commit is contained in:
1 parent
7022f3f3b4
commit
feea5ab959
8 files changed
+462
-392
No files matched your search
Generated
+332
-340
File diff suppressed because it is too large.
Load diff
@@ -1233,8 +1233,6 @@ Subagent model and effort resolution follows this precedence:
|
||||
|
||||
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.
|
||||
|
||||
`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.
|
||||
|
||||
##### OpenAI transport selection
|
||||
|
||||
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.
|
||||
|
||||
@@ -2,7 +2,6 @@ package chatopenai
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
fantasyopenai "charm.land/fantasy/providers/openai"
|
||||
fantasyopenaicompat "charm.land/fantasy/providers/openaicompat"
|
||||
@@ -62,13 +61,3 @@ func UsesResponsesAPI(modelID string, override *bool) bool {
|
||||
}
|
||||
return fantasyopenai.IsResponsesModel(modelID)
|
||||
}
|
||||
|
||||
// IsGPT6Astra matches gpt-6-astra and its dated snapshots.
|
||||
func IsGPT6Astra(modelID string) bool {
|
||||
return strings.HasPrefix(strings.ToLower(modelID), "gpt-6-astra")
|
||||
}
|
||||
|
||||
// IsGPT61Sol matches gpt-6.1-sol and its dated snapshots.
|
||||
func IsGPT61Sol(modelID string) bool {
|
||||
return strings.HasPrefix(strings.ToLower(modelID), "gpt-6.1-sol")
|
||||
}
|
||||
@@ -47,24 +47,6 @@ func TestTransportFor(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsGPT6Astra(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
require.True(t, chatopenai.IsGPT6Astra("gpt-6-astra"))
|
||||
require.True(t, chatopenai.IsGPT6Astra("GPT-6-Astra-2026-09-03"))
|
||||
require.False(t, chatopenai.IsGPT6Astra("gpt-5.6-sol"))
|
||||
require.False(t, chatopenai.IsGPT6Astra("gpt-6"))
|
||||
}
|
||||
|
||||
func TestIsGPT61Sol(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
require.True(t, chatopenai.IsGPT61Sol("gpt-6.1-sol"))
|
||||
require.True(t, chatopenai.IsGPT61Sol("GPT-6.1-Sol-2026-09-24"))
|
||||
require.False(t, chatopenai.IsGPT61Sol("gpt-6-sol"))
|
||||
require.False(t, chatopenai.IsGPT61Sol("gpt-6.1"))
|
||||
}
|
||||
|
||||
func TestTransportUsesResponses(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
fantasyopenai "charm.land/fantasy/providers/openai"
|
||||
fantasyopenaicompat "charm.land/fantasy/providers/openaicompat"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/x/chatd/chatopenai"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
|
||||
@@ -133,11 +132,24 @@ func applyReasoningEffort(
|
||||
return options
|
||||
}
|
||||
|
||||
// openAILowFloorPrefixes lists the OpenAI models that reject none and minimal
|
||||
// with HTTP 400, so they start at low. Each entry is a lowercase model ID
|
||||
// prefix, which also matches the model's dated snapshots.
|
||||
var openAILowFloorPrefixes = []string{
|
||||
"gpt-6-astra",
|
||||
"gpt-6.1-sol",
|
||||
"gpt-6.2-astra",
|
||||
"gpt-6.2-sol",
|
||||
}
|
||||
|
||||
// openAIReasoningEffort maps the global reasoning effort scale onto what an
|
||||
// OpenAI model accepts. GPT-6 Astra and GPT-6.1 Sol reject none with HTTP 400
|
||||
// and do not list minimal, so both start at low, the lowest effort they accept.
|
||||
// OpenAI model accepts.
|
||||
func openAIReasoningEffort(modelID, effort string) string {
|
||||
if !chatopenai.IsGPT6Astra(modelID) && !chatopenai.IsGPT61Sol(modelID) {
|
||||
id := strings.ToLower(modelID)
|
||||
startsAtLow := slices.ContainsFunc(openAILowFloorPrefixes, func(prefix string) bool {
|
||||
return strings.HasPrefix(id, prefix)
|
||||
})
|
||||
if !startsAtLow {
|
||||
return effort
|
||||
}
|
||||
switch effort {
|
||||
|
||||
@@ -70,6 +70,9 @@ func TestApplyReasoningEffort(t *testing.T) {
|
||||
for _, model := range []Model{
|
||||
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6-astra"}, nil),
|
||||
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.1-sol"}, nil),
|
||||
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.2-astra"}, nil),
|
||||
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "gpt-6.2-sol"}, nil),
|
||||
NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: "GPT-6-Astra-2026-09-03"}, nil),
|
||||
} {
|
||||
for effort, want := range map[string]fantasyopenai.ReasoningEffort{
|
||||
codersdk.ChatModelReasoningEffortNone: fantasyopenai.ReasoningEffortLow,
|
||||
@@ -85,7 +88,7 @@ func TestApplyReasoningEffort(t *testing.T) {
|
||||
}
|
||||
|
||||
// Other OpenAI models keep the caller's value.
|
||||
for _, modelID := range []string{"gpt-5.6-sol", "gpt-6-sol"} {
|
||||
for _, modelID := range []string{"gpt-5.6-sol", "gpt-6-sol", "gpt-6.1-terra"} {
|
||||
model := NewModel(&chattest.FakeModel{ProviderName: fantasyopenai.Name, ModelName: modelID}, nil)
|
||||
got := applyReasoningEffort(model, nil, new(codersdk.ChatModelReasoningEffortNone))
|
||||
require.Equal(t, fantasyopenai.ReasoningEffortNone, *got[fantasyopenai.Name].(*fantasyopenai.ResponsesProviderOptions).ReasoningEffort, "model %q", modelID)
|
||||
|
||||
@@ -200,10 +200,18 @@
|
||||
}
|
||||
],
|
||||
"openai": [
|
||||
{
|
||||
"modelIdentifier": "gpt-6.2-astra",
|
||||
"reasoningEffort": "medium"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "gpt-6-astra",
|
||||
"reasoningEffort": "medium"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "gpt-6.2-sol",
|
||||
"reasoningEffort": "medium"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "gpt-6.1-sol",
|
||||
"reasoningEffort": "medium"
|
||||
@@ -253,9 +261,15 @@
|
||||
}
|
||||
],
|
||||
"openrouter": [
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.2-astra"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6-astra"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.2-sol"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.1-sol"
|
||||
},
|
||||
@@ -370,9 +384,15 @@
|
||||
}
|
||||
],
|
||||
"vercel": [
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.2-astra"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6-astra"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.2-sol"
|
||||
},
|
||||
{
|
||||
"modelIdentifier": "openai/gpt-6.1-sol"
|
||||
},
|
||||
|
||||
+90
-16
@@ -668,6 +668,19 @@
|
||||
}
|
||||
],
|
||||
"openai": [
|
||||
{
|
||||
"provider": "openai",
|
||||
"modelIdentifier": "gpt-6.2-astra",
|
||||
"displayName": "GPT-6.2 Astra",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"reasoningEffort": "medium",
|
||||
"inputCost": 8,
|
||||
"outputCost": 40,
|
||||
"cacheReadCost": 0.4,
|
||||
"cacheWriteCost": 10
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"modelIdentifier": "gpt-6-astra",
|
||||
@@ -681,6 +694,19 @@
|
||||
"cacheReadCost": 1,
|
||||
"cacheWriteCost": 12.5
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"modelIdentifier": "gpt-6.2-sol",
|
||||
"displayName": "GPT-6.2 Sol",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"reasoningEffort": "medium",
|
||||
"inputCost": 2,
|
||||
"outputCost": 10,
|
||||
"cacheReadCost": 0.1,
|
||||
"cacheWriteCost": 2.5
|
||||
},
|
||||
{
|
||||
"provider": "openai",
|
||||
"modelIdentifier": "gpt-6.1-sol",
|
||||
@@ -830,6 +856,18 @@
|
||||
}
|
||||
],
|
||||
"openrouter": [
|
||||
{
|
||||
"provider": "openrouter",
|
||||
"modelIdentifier": "openai/gpt-6.2-astra",
|
||||
"displayName": "GPT-6.2 Astra",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"inputCost": 8,
|
||||
"outputCost": 40,
|
||||
"cacheReadCost": 0.4,
|
||||
"cacheWriteCost": 10
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
"modelIdentifier": "openai/gpt-6-astra",
|
||||
@@ -842,6 +880,18 @@
|
||||
"cacheReadCost": 1,
|
||||
"cacheWriteCost": 12.5
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
"modelIdentifier": "openai/gpt-6.2-sol",
|
||||
"displayName": "GPT-6.2 Sol",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"inputCost": 2,
|
||||
"outputCost": 10,
|
||||
"cacheReadCost": 0.1,
|
||||
"cacheWriteCost": 2.5
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
"modelIdentifier": "openai/gpt-6.1-sol",
|
||||
@@ -954,9 +1004,9 @@
|
||||
"aliases": [],
|
||||
"contextLimit": 1048576,
|
||||
"maxOutputTokens": 943718,
|
||||
"inputCost": 0.192,
|
||||
"inputCost": 0.2,
|
||||
"outputCost": 16,
|
||||
"cacheReadCost": 0.182
|
||||
"cacheReadCost": 0.19
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
@@ -965,9 +1015,9 @@
|
||||
"aliases": [],
|
||||
"contextLimit": 262144,
|
||||
"maxOutputTokens": 235929,
|
||||
"inputCost": 0.6,
|
||||
"outputCost": 3.5,
|
||||
"cacheReadCost": 0.16
|
||||
"inputCost": 0.7,
|
||||
"outputCost": 3.75,
|
||||
"cacheReadCost": 0.17
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
@@ -1177,9 +1227,9 @@
|
||||
"aliases": [],
|
||||
"contextLimit": 1048576,
|
||||
"maxOutputTokens": 943718,
|
||||
"inputCost": 0.022,
|
||||
"outputCost": 0.4,
|
||||
"cacheReadCost": 0.004
|
||||
"inputCost": 0.051,
|
||||
"outputCost": 0.567,
|
||||
"cacheReadCost": 0.018
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
@@ -1198,10 +1248,10 @@
|
||||
"displayName": "DeepSeek V4 Pro",
|
||||
"aliases": [],
|
||||
"contextLimit": 1048576,
|
||||
"maxOutputTokens": 384000,
|
||||
"inputCost": 0.95526,
|
||||
"outputCost": 1.91052,
|
||||
"cacheReadCost": 0.079605
|
||||
"maxOutputTokens": 393216,
|
||||
"inputCost": 0.9,
|
||||
"outputCost": 1.5,
|
||||
"cacheReadCost": 0.25
|
||||
},
|
||||
{
|
||||
"provider": "openrouter",
|
||||
@@ -1271,6 +1321,18 @@
|
||||
}
|
||||
],
|
||||
"vercel": [
|
||||
{
|
||||
"provider": "vercel",
|
||||
"modelIdentifier": "openai/gpt-6.2-astra",
|
||||
"displayName": "GPT-6.2 Astra",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"inputCost": 8,
|
||||
"outputCost": 40,
|
||||
"cacheReadCost": 0.4,
|
||||
"cacheWriteCost": 10
|
||||
},
|
||||
{
|
||||
"provider": "vercel",
|
||||
"modelIdentifier": "openai/gpt-6-astra",
|
||||
@@ -1283,6 +1345,18 @@
|
||||
"cacheReadCost": 1,
|
||||
"cacheWriteCost": 12.5
|
||||
},
|
||||
{
|
||||
"provider": "vercel",
|
||||
"modelIdentifier": "openai/gpt-6.2-sol",
|
||||
"displayName": "GPT-6.2 Sol",
|
||||
"aliases": [],
|
||||
"contextLimit": 1050000,
|
||||
"maxOutputTokens": 128000,
|
||||
"inputCost": 2,
|
||||
"outputCost": 10,
|
||||
"cacheReadCost": 0.1,
|
||||
"cacheWriteCost": 2.5
|
||||
},
|
||||
{
|
||||
"provider": "vercel",
|
||||
"modelIdentifier": "openai/gpt-6.1-sol",
|
||||
@@ -1613,10 +1687,10 @@
|
||||
"displayName": "DeepSeek V4.1 Flash",
|
||||
"aliases": [],
|
||||
"contextLimit": 1048576,
|
||||
"maxOutputTokens": 32768,
|
||||
"maxOutputTokens": 1048576,
|
||||
"inputCost": 0.3,
|
||||
"outputCost": 1.2,
|
||||
"cacheReadCost": 0.007
|
||||
"cacheReadCost": 0.006
|
||||
},
|
||||
{
|
||||
"provider": "vercel",
|
||||
@@ -1691,8 +1765,8 @@
|
||||
"modelIdentifier": "minimax/minimax-m3",
|
||||
"displayName": "MiniMax M3",
|
||||
"aliases": [],
|
||||
"contextLimit": 512000,
|
||||
"maxOutputTokens": 512000,
|
||||
"contextLimit": 1000000,
|
||||
"maxOutputTokens": 1000000,
|
||||
"inputCost": 0.3,
|
||||
"outputCost": 1.2,
|
||||
"cacheReadCost": 0.06
|
||||
|
||||
Reference in new issue
Block a user