Repository navigation
feat(ai): upgrade Claude, GPT, and Gemini models #850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ import { | |
| // has no framework dependencies; the comments carry over because the tuning | ||
| // rationale is unchanged. | ||
|
|
||
| export const AI_THREAD_TITLE_GATEWAY_MODEL = "google/gemini-2.5-flash-lite"; | ||
| export const AI_THREAD_TITLE_GATEWAY_MODEL = "google/gemini-3.5-flash-lite"; | ||
|
|
||
| type WorkspaceAiProviderOptions = NonNullable< | ||
| Parameters<typeof generateText>[0]["providerOptions"] | ||
|
|
@@ -52,7 +52,7 @@ export function getWorkspaceAiGatewayTransportOptions() { | |
| // Buy the fast lane where it exists. The gateway only forwards a tier to | ||
| // OpenAI, Google AI Studio, and Vertex, so this is a no-op on the Claude | ||
| // primaries and moves the models we actually default to (`auto`/luna, the | ||
| // Gemini pair, the nano/flash-lite title legs). It is a hint, never a | ||
| // Gemini pair, the luna/flash-lite title legs). It is a hint, never a | ||
| // promise: an unsupported model ignores it, and a provider that is out of | ||
| // priority capacity silently downgrades to standard and bills standard. | ||
| serviceTier: "priority" as const, | ||
|
|
@@ -109,9 +109,9 @@ export function getAIThreadTitleGatewayProviderOptions(): WorkspaceAiProviderOpt | |
| `model:${AI_THREAD_TITLE_GATEWAY_MODEL}`, | ||
| ], | ||
| }, | ||
| // The 2.5-series title model rejects `thinkingLevel`; budget is its knob. | ||
| google: { thinkingConfig: { thinkingBudget: 0 } }, | ||
| vertex: { thinkingConfig: { thinkingBudget: 0 } }, | ||
| // Keep title generation at the lowest supported thinking level. | ||
| google: { thinkingConfig: { thinkingLevel: "minimal" } }, | ||
| vertex: { thinkingConfig: { thinkingLevel: "minimal" } }, | ||
| openai: { reasoningEffort: "none" }, | ||
| }; | ||
| } | ||
|
|
@@ -129,10 +129,11 @@ function getWorkspaceAiReasoningOptions( | |
| thinkingConfig: { thinkingLevel: "low" }, | ||
| }, | ||
| }; | ||
| case "gpt-terra": | ||
| case "gpt-sol": | ||
| return { | ||
| openai: { | ||
| reasoningEffort: "none", | ||
| // Sol 6.1 requires reasoning; low is its minimum supported effort. | ||
| reasoningEffort: "low", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Custom agent: Flag AI Slop and Fabricated Changes This model/provider behavior change has no regression assertions. Add tests that verify the Prompt for AI agents |
||
| }, | ||
| }; | ||
| default: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,8 @@ export type WorkspaceAiChatModelBillingTier = "standard" | "premium"; | |
| // across input, cached input, and output rather than output alone — output | ||
| // price by itself understates the models we send the most tokens to. | ||
| // | ||
| // Measured 1.0x / 2.5x / 4.7x / 9.5x / 10x, rounded to a clean ladder so these | ||
| // Standard-rate estimates: Luna 1x, Flash 7.5x, Haiku 10x, Sol 18.9x, | ||
| // Sonnet 20x, and Pro 21.2x, rounded to whole multipliers so these | ||
| // double as credit weights if usage is ever metered. Re-derive from the gateway | ||
| // catalog when the lineup changes; a stale multiplier misprices the plan. | ||
| // | ||
|
|
@@ -38,7 +39,7 @@ export const WORKSPACE_AI_CHAT_MODELS = [ | |
| name: "Auto", | ||
| // Keep this a stable product choice while the server owns its availability | ||
| // policy and fallback chain. | ||
| gatewayModel: "openai/gpt-5.6-luna", | ||
| gatewayModel: "openai/gpt-6-luna", | ||
| provider: "auto", | ||
| tagline: "Fast and capable by default", | ||
| description: | ||
|
|
@@ -48,20 +49,20 @@ export const WORKSPACE_AI_CHAT_MODELS = [ | |
| speed: 3, | ||
| cost: 1, | ||
| billingTier: "standard", | ||
| contextWindow: 1_000_000, | ||
| contextWindow: 1_050_000, | ||
| }, | ||
| { | ||
| id: "claude-sonnet", | ||
| name: "Claude Sonnet 5", | ||
| gatewayModel: "anthropic/claude-sonnet-5", | ||
| name: "Claude Sonnet 5.5", | ||
| gatewayModel: "anthropic/claude-sonnet-5.5", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Custom agent: Flag AI Slop and Fabricated Changes Add a regression test for the changed Prompt for AI agents |
||
| provider: "anthropic", | ||
| tagline: "Thoughtful and polished", | ||
| description: | ||
| "A strong all-around model that is especially good at writing, careful thinking, and polished answers.", | ||
| bestFor: "Writing, analysis & coding", | ||
| intelligence: 4, | ||
| speed: 3, | ||
| cost: 10, | ||
| cost: 20, | ||
| billingTier: "premium", | ||
| contextWindow: 1_000_000, | ||
| }, | ||
|
|
@@ -75,29 +76,29 @@ export const WORKSPACE_AI_CHAT_MODELS = [ | |
| bestFor: "Quick help & short drafts", | ||
| intelligence: 2, | ||
| speed: 4, | ||
| cost: 5, | ||
| cost: 10, | ||
| billingTier: "standard", | ||
| contextWindow: 200_000, | ||
| }, | ||
| { | ||
| id: "gpt-terra", | ||
| name: "GPT-5.6 Terra", | ||
| gatewayModel: "openai/gpt-5.6-terra", | ||
| id: "gpt-sol", | ||
| name: "GPT-6.1 Sol", | ||
| gatewayModel: "openai/gpt-6.1-sol", | ||
| provider: "openai", | ||
| tagline: "Strong on harder tasks", | ||
| description: | ||
| "A capable model for more involved tasks like planning, research, problem-solving, and detailed help.", | ||
| bestFor: "Planning, research & knowledge work", | ||
| intelligence: 4, | ||
| speed: 3, | ||
| cost: 10, | ||
| cost: 19, | ||
| billingTier: "premium", | ||
| contextWindow: 1_000_000, | ||
| contextWindow: 1_050_000, | ||
| }, | ||
| { | ||
| id: "gpt-luna", | ||
| name: "GPT-5.6 Luna", | ||
| gatewayModel: "openai/gpt-5.6-luna", | ||
| name: "GPT-6 Luna", | ||
| gatewayModel: "openai/gpt-6-luna", | ||
| provider: "openai", | ||
| tagline: "Quick and capable", | ||
| description: "A faster GPT for quick help, everyday questions, and practical tasks.", | ||
|
|
@@ -106,7 +107,7 @@ export const WORKSPACE_AI_CHAT_MODELS = [ | |
| speed: 4, | ||
| cost: 1, | ||
| billingTier: "standard", | ||
| contextWindow: 1_000_000, | ||
| contextWindow: 1_050_000, | ||
| }, | ||
| { | ||
| id: "gemini-pro", | ||
|
|
@@ -119,22 +120,22 @@ export const WORKSPACE_AI_CHAT_MODELS = [ | |
| bestFor: "Long docs, research & hard problems", | ||
| intelligence: 4, | ||
| speed: 2, | ||
| cost: 10, | ||
| cost: 21, | ||
| billingTier: "premium", | ||
| contextWindow: 1_000_000, | ||
| }, | ||
| { | ||
| id: "gemini", | ||
| name: "Gemini 3 Flash", | ||
| gatewayModel: "google/gemini-3-flash", | ||
| name: "Gemini 3.8 Flash", | ||
| gatewayModel: "google/gemini-3.8-flash", | ||
| provider: "google", | ||
| tagline: "Fast and wide-ranging", | ||
| description: | ||
| "A fast Gemini that works well for quick answers, everyday use, and reading lots of context.", | ||
| bestFor: "Fast answers & big context", | ||
| intelligence: 3, | ||
| speed: 4, | ||
| cost: 3, | ||
| cost: 8, | ||
| billingTier: "standard", | ||
| contextWindow: 1_000_000, | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ import type { | |
| MarkdownExtractionResult, | ||
| } from "#/features/workspaces/extraction/types"; | ||
|
|
||
| const IMAGE_EXTRACTION_GATEWAY_MODEL = "google/gemini-2.5-flash"; | ||
| const IMAGE_EXTRACTION_GATEWAY_MODEL = "google/gemini-3.8-flash"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Custom agent: Flag AI Slop and Fabricated Changes This model and thinking-config change alters the image-extraction request, but no test exercises Prompt for AI agents |
||
| const jpegMediaType = "image/jpeg"; | ||
|
|
||
| // Transcription, not interpretation: the markdown feeds search and chat context, | ||
|
|
@@ -50,14 +50,12 @@ export function createGeminiImageMarkdownProvider(env: Env): MarkdownExtractionP | |
| `model:${IMAGE_EXTRACTION_GATEWAY_MODEL}`, | ||
| ], | ||
| }, | ||
| // The 2.5-series rejects `thinkingLevel` outright, which 400s every | ||
| // Google leg; budget is its knob. Reading what is on the page needs | ||
| // no reasoning, and the fallbacks bill for it if it is left on. | ||
| // Minimize reasoning for transcription and its fallback models. | ||
| google: { | ||
| thinkingConfig: { thinkingBudget: 0 }, | ||
| thinkingConfig: { thinkingLevel: "low" }, | ||
| }, | ||
| vertex: { | ||
| thinkingConfig: { thinkingBudget: 0 }, | ||
| thinkingConfig: { thinkingLevel: "low" }, | ||
| }, | ||
| openai: { | ||
| reasoningEffort: "none", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Custom agent: Flag AI Slop and Fabricated Changes
This routing change is not covered by a test: the updated observability fixture uses hand-built metadata and never calls
getWorkspaceAiGatewayRoutingOptions. Add a regression assertion for thegpt-terraandgemini-profallback model lists.Prompt for AI agents