feat(providers): suggest the Claude 5 and GPT 6 models, show GPT 6 reasoning

The suggested models stopped at Claude Opus 4.8 and GPT 5.5. They now
start with Claude Opus 5.5, Sonnet 5.5 and Fable 5.1, and gpt-6.1-sol,
gpt-6-sol, gpt-6-luna and gpt-6-astra (ids checked against the provider
lists). The Bedrock list is unchanged until its ids are checked.

The reasoning summary was only turned on for model ids containing o1,
o3, o4 or gpt-5, so GPT 6 models showed no thinking. It now matches the
o-series and gpt-5 or later by version, like the OpenAI SDK.
This commit is contained in:
dayuan.jiang
2026-10-04 20:51:12 +09:00
parent 6a99915446
commit 89a712bca4
3 changed files with 53 additions and 12 deletions
+6 -11
View File
@@ -244,8 +244,8 @@ function googleSamplingSettings(): { topK?: number; topP?: number } {
* Supports various AI SDK providers with their unique configuration options
*
* Environment variables:
* - OPENAI_REASONING_EFFORT: OpenAI reasoning effort level (minimal/low/medium/high) - for o1/o3/o4/gpt-5
* - OPENAI_REASONING_SUMMARY: OpenAI reasoning summary (auto/detailed) - auto-enabled for o1/o3/o4/gpt-5
* - OPENAI_REASONING_EFFORT: OpenAI reasoning effort level (minimal/low/medium/high) - for the o-series and gpt-5 or later
* - OPENAI_REASONING_SUMMARY: OpenAI reasoning summary (auto/detailed) - auto-enabled for the o-series and gpt-5 or later
* - ANTHROPIC_THINKING_BUDGET_TOKENS: Anthropic thinking budget in tokens (1024-64000)
* - ANTHROPIC_THINKING_TYPE: Anthropic thinking type (enabled)
* - GOOGLE_THINKING_BUDGET: Google Gemini 2.5 thinking budget in tokens (1024-100000)
@@ -269,14 +269,9 @@ function buildProviderOptions(
const reasoningEffort = process.env.OPENAI_REASONING_EFFORT
const reasoningSummary = process.env.OPENAI_REASONING_SUMMARY
// OpenAI reasoning models (o1, o3, o4, gpt-5) need reasoningSummary to return thoughts
if (
modelId &&
(modelId.includes("o1") ||
modelId.includes("o3") ||
modelId.includes("o4") ||
modelId.includes("gpt-5"))
) {
// Reasoning models (the o-series, gpt-5 and later) need
// reasoningSummary to return thoughts
if (modelId && /^(o\d|gpt-([5-9]|[1-9]\d))/.test(modelId)) {
options.openai = {
// Auto-enable reasoning summary for reasoning models
// Use 'auto' as default since not all models support 'detailed'
@@ -686,7 +681,7 @@ function createModel(
const openaiProvider = createOpenAI(opts)
// A custom base URL is usually a proxy that only has Chat
// Completions; the official endpoint uses the Responses API,
// which returns reasoning for gpt-5 and the o-series
// which returns reasoning for the o-series and gpt-5 or later
return e.baseURL
? openaiProvider.chat(modelId)
: openaiProvider(modelId)
+20 -1
View File
@@ -275,6 +275,10 @@ export const PROVIDER_INFO: Record<
// Suggested models per provider for quick add
export const SUGGESTED_MODELS: Partial<Record<ProviderName, string[]>> = {
openai: [
"gpt-6.1-sol",
"gpt-6-sol",
"gpt-6-luna",
"gpt-6-astra",
"gpt-5.5-pro",
"gpt-5.5",
"gpt-5.4-pro",
@@ -288,7 +292,13 @@ export const SUGGESTED_MODELS: Partial<Record<ProviderName, string[]>> = {
"gpt-4o-mini",
],
anthropic: [
// Claude 4.8 / 4.7 / 4.6 series (latest, dateless pinned IDs)
// Claude 5 series (latest)
"claude-opus-5-5",
"claude-sonnet-5-5",
"claude-fable-5-1",
"claude-opus-5",
"claude-sonnet-5",
// Claude 4.8 / 4.7 / 4.6 series (dateless pinned IDs)
"claude-opus-4-8",
"claude-sonnet-4-6",
"claude-haiku-4-5",
@@ -366,10 +376,15 @@ export const SUGGESTED_MODELS: Partial<Record<ProviderName, string[]>> = {
],
openrouter: [
// Anthropic
"anthropic/claude-opus-5.5",
"anthropic/claude-sonnet-5.5",
"anthropic/claude-fable-5.1",
"anthropic/claude-opus-4.8",
"anthropic/claude-sonnet-4.6",
"anthropic/claude-haiku-4.5",
// OpenAI
"openai/gpt-6.1-sol",
"openai/gpt-6-luna",
"openai/gpt-5.5",
"openai/gpt-5.4",
"openai/gpt-5.4-mini",
@@ -458,6 +473,10 @@ export const SUGGESTED_MODELS: Partial<Record<ProviderName, string[]>> = {
"default",
],
gateway: [
"anthropic/claude-opus-5.5",
"anthropic/claude-sonnet-5.5",
"openai/gpt-6.1-sol",
"openai/gpt-6-luna",
"openai/gpt-5.5",
"anthropic/claude-opus-4.7",
"google/gemini-3.1-pro-preview",
+27
View File
@@ -0,0 +1,27 @@
// @vitest-environment node
import { describe, expect, it } from "vitest"
import { getAIModel } from "@/lib/ai-providers"
const summaryFor = (modelId: string) =>
getAIModel({ provider: "openai", apiKey: "test-key", modelId })
.providerOptions?.openai?.reasoningSummary
describe("OpenAI reasoning summary", () => {
it("is on for the o-series and gpt-5 or later", () => {
for (const id of [
"o3",
"o4-mini",
"gpt-5.5",
"gpt-6-luna",
"gpt-6.1-sol",
]) {
expect(summaryFor(id), id).toBe("auto")
}
})
it("is off for older chat models", () => {
for (const id of ["gpt-4.1", "gpt-4o", "gpt-4o-mini"]) {
expect(summaryFor(id), id).toBeUndefined()
}
})
})