From 4099ac92ffa8da28f6516660b6c996be70d4ccaa Mon Sep 17 00:00:00 2001 From: sawka Date: Thu, 13 Nov 2025 18:14:16 -0800 Subject: [PATCH] update to gpt-5.1 --- cmd/testai/main-testai.go | 2 +- frontend/app/aipanel/aipanel-contextmenu.ts | 4 ++-- frontend/app/aipanel/thinkingmode.tsx | 4 ++-- frontend/app/aipanel/waveai-model.tsx | 2 +- pkg/aiusechat/openai/openai-convertmessage.go | 2 +- pkg/aiusechat/uctypes/usechat-types.go | 5 +++-- pkg/aiusechat/usechat.go | 2 +- pkg/waveai/openaibackend.go | 3 ++- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cmd/testai/main-testai.go b/cmd/testai/main-testai.go index 225ff33caf..eace7ca61a 100644 --- a/cmd/testai/main-testai.go +++ b/cmd/testai/main-testai.go @@ -25,7 +25,7 @@ var testSchemaJSON string const ( DefaultAnthropicModel = "claude-sonnet-4-5" - DefaultOpenAIModel = "gpt-5" + DefaultOpenAIModel = "gpt-5.1" ) // TestResponseWriter implements http.ResponseWriter and additional interfaces for testing diff --git a/frontend/app/aipanel/aipanel-contextmenu.ts b/frontend/app/aipanel/aipanel-contextmenu.ts index 1aa4890cf4..b7a7f718d4 100644 --- a/frontend/app/aipanel/aipanel-contextmenu.ts +++ b/frontend/app/aipanel/aipanel-contextmenu.ts @@ -58,7 +58,7 @@ export async function handleWaveAIContextMenu(e: React.MouseEvent, showCopy: boo }, }, { - label: hasPremium ? "Balanced (gpt-5, low thinking)" : "Balanced (premium)", + label: hasPremium ? "Balanced (gpt-5.1, low thinking)" : "Balanced (premium)", type: "checkbox", checked: currentThinkingMode === "balanced", enabled: hasPremium, @@ -71,7 +71,7 @@ export async function handleWaveAIContextMenu(e: React.MouseEvent, showCopy: boo }, }, { - label: hasPremium ? "Deep (gpt-5, full thinking)" : "Deep (premium)", + label: hasPremium ? "Deep (gpt-5.1, full thinking)" : "Deep (premium)", type: "checkbox", checked: currentThinkingMode === "deep", enabled: hasPremium, diff --git a/frontend/app/aipanel/thinkingmode.tsx b/frontend/app/aipanel/thinkingmode.tsx index 870634db7c..cb69a50939 100644 --- a/frontend/app/aipanel/thinkingmode.tsx +++ b/frontend/app/aipanel/thinkingmode.tsx @@ -25,13 +25,13 @@ const ThinkingModeData: Record = { balanced: { icon: "fa-sparkles", name: "Balanced", - desc: "Good mix of speed and accuracy\n(gpt-5 with minimal thinking)", + desc: "Good mix of speed and accuracy\n(gpt-5.1 with minimal thinking)", premium: true, }, deep: { icon: "fa-lightbulb", name: "Deep", - desc: "Slower but most capable\n(gpt-5 with full reasoning)", + desc: "Slower but most capable\n(gpt-5.1 with full reasoning)", premium: true, }, }; diff --git a/frontend/app/aipanel/waveai-model.tsx b/frontend/app/aipanel/waveai-model.tsx index 09e6291f03..258bdf9de0 100644 --- a/frontend/app/aipanel/waveai-model.tsx +++ b/frontend/app/aipanel/waveai-model.tsx @@ -80,7 +80,7 @@ export class WaveAIModel { this.modelAtom = jotai.atom((get) => { const modelMetaAtom = getOrefMetaKeyAtom(this.orefContext, "waveai:model"); - return get(modelMetaAtom) ?? "gpt-5"; + return get(modelMetaAtom) ?? "gpt-5.1"; }); this.widgetAccessAtom = jotai.atom((get) => { diff --git a/pkg/aiusechat/openai/openai-convertmessage.go b/pkg/aiusechat/openai/openai-convertmessage.go index 3712bc7188..c7c912c975 100644 --- a/pkg/aiusechat/openai/openai-convertmessage.go +++ b/pkg/aiusechat/openai/openai-convertmessage.go @@ -278,7 +278,7 @@ func buildOpenAIHTTPRequest(ctx context.Context, inputs []any, chatOpts uctypes. reqBody.Reasoning = &ReasoningType{ Effort: opts.ThinkingLevel, // low, medium, high map directly } - if opts.Model == "gpt-5" { + if opts.Model == "gpt-5" || opts.Model == "gpt-5.1" { reqBody.Reasoning.Summary = "auto" } } diff --git a/pkg/aiusechat/uctypes/usechat-types.go b/pkg/aiusechat/uctypes/usechat-types.go index 9e7fe4a9d1..b9fe0092ee 100644 --- a/pkg/aiusechat/uctypes/usechat-types.go +++ b/pkg/aiusechat/uctypes/usechat-types.go @@ -12,7 +12,7 @@ import ( const DefaultAIEndpoint = "https://cfapi.waveterm.dev/api/waveai" const DefaultAnthropicModel = "claude-sonnet-4-5" const DefaultOpenAIModel = "gpt-5-mini" -const PremiumOpenAIModel = "gpt-5" +const PremiumOpenAIModel = "gpt-5.1" type UseChatRequest struct { Messages []UIMessage `json:"messages"` @@ -234,7 +234,7 @@ func (opts AIOptsType) IsWaveProxy() bool { } func (opts AIOptsType) IsPremiumModel() bool { - return opts.Model == "gpt-5" || strings.Contains(opts.Model, "claude-sonnet") + return opts.Model == "gpt-5" || opts.Model == "gpt-5.1" || strings.Contains(opts.Model, "claude-sonnet") } type AIChat struct { @@ -552,6 +552,7 @@ func AreModelsCompatible(apiType, model1, model2 string) bool { if apiType == "openai" { gpt5Models := map[string]bool{ + "gpt-5.1": true, "gpt-5": true, "gpt-5-mini": true, "gpt-5-nano": true, diff --git a/pkg/aiusechat/usechat.go b/pkg/aiusechat/usechat.go index a87ebdad1e..3e7597f07c 100644 --- a/pkg/aiusechat/usechat.go +++ b/pkg/aiusechat/usechat.go @@ -475,7 +475,7 @@ func RunAIChat(ctx context.Context, sseHandler *sse.SSEHandlerCh, chatOpts uctyp } } if stopReason != nil && stopReason.Kind == uctypes.StopKindPremiumRateLimit && chatOpts.Config.APIType == APIType_OpenAI && chatOpts.Config.Model == uctypes.PremiumOpenAIModel { - log.Printf("Premium rate limit hit with gpt-5, switching to gpt-5-mini\n") + log.Printf("Premium rate limit hit with gpt-5.1, switching to gpt-5-mini\n") cont = &uctypes.WaveContinueResponse{ MessageID: "", Model: uctypes.DefaultOpenAIModel, diff --git a/pkg/waveai/openaibackend.go b/pkg/waveai/openaibackend.go index a698a9df27..4001a3a670 100644 --- a/pkg/waveai/openaibackend.go +++ b/pkg/waveai/openaibackend.go @@ -34,7 +34,8 @@ func isReasoningModel(model string) bool { return strings.HasPrefix(m, "o1") || strings.HasPrefix(m, "o3") || strings.HasPrefix(m, "o4") || - strings.HasPrefix(m, "gpt-5") + strings.HasPrefix(m, "gpt-5") || + strings.HasPrefix(m, "gpt-5.1") } func setApiType(opts *wshrpc.WaveAIOptsType, clientConfig *openaiapi.ClientConfig) error {