feat(studio): default AI Assistant to GPT-6 Luna (AI-1245) (#50757)

<!-- ccr-slack-attribution -->
_Requested by **Saxon Fletcher** · [Slack
thread](https://supabase.slack.com/archives/C051L8U2EJF/p1790104861710199?thread_ts=1790104861.710199&cid=C051L8U2EJF)_

## Problem

**Before:** The Assistant's base model is `gpt-5.6-luna` at medium
reasoning effort.

**After:** The base model is `gpt-6-luna`, its direct successor, still
at medium effort. It costs half as much: $0.10/$0.50 per MTok against
$0.20/$1.20.

Resolves
[AI-1245](https://linear.app/supabase/issue/AI-1245/move-the-assistants-base-model-to-gpt-6-luna).

## Solution

This swaps `gpt-5.6-luna` for `gpt-6-luna` in
`apps/studio/lib/ai/model.utils.ts`: the model ID union, the
reasoning-support map, `ASSISTANT_MODELS`,
`DEFAULT_ASSISTANT_BASE_MODEL_ID`, and the OpenAI provider registry. The
old ID is removed, not kept next to the new one. A stored selection of
`gpt-5.6-luna` is no longer a known ID, so the client and `generate-v4`
both fall back to the new default. The eval cost table (AI-1242) and
eval experiments (AI-1243) are out of scope.

Source for the model ID and supported efforts (none/low/medium
default/high/xhigh/max): [OpenAI model docs: GPT-6
Luna](https://developers.openai.com/api/docs/models/gpt-6-luna).
`@ai-sdk/openai@4.0.41` types model IDs as a union plus `string & {}`,
so no SDK bump is needed.

## Review instructions

1. Check the diff in `model.utils.ts`. Say so if you'd rather keep
`gpt-5.6-luna` selectable as a fallback.
2. AI-1245 asks for the Assistant evals before shipping. Add the
`run-evals` label to run `braintrust-evals.yml` on this PR, or run `pnpm
--filter studio evals:run` locally. They have not been run yet because
they need OpenAI/Braintrust credentials.
3. Already run: studio `typecheck`, eslint + prettier on the changed
files, vitest for `lib/ai`, `pages/api/ai` and `state/ai-assistant` (264
passed), and `evals:preflight`.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] No docs topics changed

**AI disclosure:** Claude Code wrote this PR from start to finish. Saxon
Fletcher (@SaxonF) is the accountable human and must review it before
merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01W21zLTfzde6FFPyYGbGC6K


---
_Generated by [Claude
Code](https://claude.ai/code/session_01W21zLTfzde6FFPyYGbGC6K)_

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
claude[bot]andClaude authored and GitHub committed 2026-09-23 10:03:27 +10:00
1 parent 05a45dd1ed
commit ea3a7743b1
2 files changed
+17 -16

No files matched your search

+11 -10
View File
@@ -47,7 +47,7 @@ describe('model.utils', () => {
it('should have openai provider with models', () => {
expect(PROVIDERS.openai).toBeDefined()
expect(PROVIDERS.openai.models).toBeDefined()
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5.6-luna')
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-6-luna')
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5.4-nano')
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5.3-codex')
})
@@ -112,36 +112,37 @@ describe('model.utils', () => {
})
it('defaults should satisfy unions', () => {
expect(DEFAULT_ASSISTANT_BASE_MODEL_ID).toBe('gpt-5.6-luna')
expect(DEFAULT_ASSISTANT_BASE_MODEL_ID).toBe('gpt-6-luna')
expect(DEFAULT_ASSISTANT_ADVANCE_MODEL_ID).toBe('gpt-5.3-codex')
expect(defaultAssistantModelId(false)).toBe(DEFAULT_ASSISTANT_BASE_MODEL_ID)
expect(defaultAssistantModelId(true)).toBe(DEFAULT_ASSISTANT_BASE_MODEL_ID)
})
it('isAssistantBaseModelId / isAdvanceOnlyModelId', () => {
expect(isAssistantBaseModelId('gpt-5.6-luna')).toBe(true)
expect(isAssistantBaseModelId('gpt-6-luna')).toBe(true)
expect(isAssistantBaseModelId('gpt-5.4-nano')).toBe(true)
expect(isAssistantBaseModelId('gpt-5.3-codex')).toBe(false)
expect(isAdvanceOnlyModelId('gpt-5.3-codex')).toBe(true)
expect(isAdvanceOnlyModelId('gpt-5.4-nano')).toBe(false)
expect(isAdvanceOnlyModelId('gpt-5.6-luna')).toBe(false)
expect(isAdvanceOnlyModelId('gpt-6-luna')).toBe(false)
})
it('isKnownAssistantModelId', () => {
expect(isKnownAssistantModelId('gpt-5.6-luna')).toBe(true)
expect(isKnownAssistantModelId('gpt-6-luna')).toBe(true)
expect(isKnownAssistantModelId('gpt-5.4-nano')).toBe(true)
expect(isKnownAssistantModelId('gpt-5.3-codex')).toBe(true)
expect(isKnownAssistantModelId('gpt-5.6-luna')).toBe(false)
expect(isKnownAssistantModelId('gpt-5')).toBe(false)
expect(isKnownAssistantModelId('gpt-5-mini')).toBe(false)
expect(isKnownAssistantModelId('unknown')).toBe(false)
})
it('getAssistantModelEntry returns config for known ids', () => {
expect(getAssistantModelEntry('gpt-5.6-luna').reasoningEffort).toBe('medium')
expect(getAssistantModelEntry('gpt-6-luna').reasoningEffort).toBe('medium')
expect(getAssistantModelEntry('gpt-5.4-nano').reasoningEffort).toBe('low')
expect(getAssistantModelEntry('gpt-5.3-codex').reasoningEffort).toBe('low')
expect(getAssistantModelEntry('gpt-5.6-luna')).toEqual(
ASSISTANT_MODELS.find((m) => m.id === 'gpt-5.6-luna')
expect(getAssistantModelEntry('gpt-6-luna')).toEqual(
ASSISTANT_MODELS.find((m) => m.id === 'gpt-6-luna')
)
})
@@ -152,12 +153,12 @@ describe('model.utils', () => {
it('openaiModelEntry enforces valid reasoning effort at compile time', () => {
const withEffort = openaiModelEntry({
id: 'gpt-5.6-luna',
id: 'gpt-6-luna',
reasoningEffort: 'low',
})
expect(withEffort.reasoningEffort).toBe('low')
const withoutEffort = openaiModelEntry({ id: 'gpt-5.6-luna' })
const withoutEffort = openaiModelEntry({ id: 'gpt-6-luna' })
expect(withoutEffort.reasoningEffort).toBeUndefined()
})
})
+6 -6
View File
@@ -2,7 +2,7 @@ export type ProviderName = 'bedrock' | 'openai'
export type BedrockModel = 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'openai.gpt-oss-120b-1:0'
export type OpenAIModelId = 'gpt-5.4-nano' | 'gpt-5.3-codex' | 'gpt-5.6-luna'
export type OpenAIModelId = 'gpt-5.4-nano' | 'gpt-5.3-codex' | 'gpt-6-luna'
// Source: https://developers.openai.com/api/docs/guides/reasoning + per-model pages
export type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'
@@ -10,11 +10,11 @@ export type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | '
// Per-model reasoning effort compatibility.
// Sources: https://developers.openai.com/api/docs/models/gpt-5.4-nano
// https://developers.openai.com/api/docs/models/gpt-5.3-codex
// https://developers.openai.com/api/docs/models/gpt-5.6-luna
// https://developers.openai.com/api/docs/models/gpt-6-luna
type ModelReasoningSupport = {
'gpt-5.4-nano': 'none' | 'low' | 'medium' | 'high' | 'xhigh'
'gpt-5.3-codex': 'low' | 'medium' | 'high' | 'xhigh'
'gpt-5.6-luna': 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'
'gpt-6-luna': 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'
}
type ReasoningEffortFor<ModelId extends OpenAIModelId> = ModelId extends keyof ModelReasoningSupport
@@ -62,7 +62,7 @@ export const LOGS_REWRITE_MODEL = openaiModelEntry({
// Models with requiresAdvanceModelEntitlement false are available to all users; true requires the assistant.advance_model entitlement.
export const ASSISTANT_MODELS = [
openaiModelEntry({
id: 'gpt-5.6-luna',
id: 'gpt-6-luna',
requiresAdvanceModelEntitlement: false,
reasoningEffort: 'medium',
}),
@@ -89,7 +89,7 @@ const ASSISTANT_MODELS_MAP = Object.fromEntries(ASSISTANT_MODELS.map((m) => [m.i
(typeof ASSISTANT_MODELS)[number]
>
export const DEFAULT_ASSISTANT_BASE_MODEL_ID = 'gpt-5.6-luna' satisfies AssistantBaseModelId
export const DEFAULT_ASSISTANT_BASE_MODEL_ID = 'gpt-6-luna' satisfies AssistantBaseModelId
export const DEFAULT_ASSISTANT_ADVANCE_MODEL_ID = 'gpt-5.3-codex' satisfies AssistantModelId
@@ -158,7 +158,7 @@ export const PROVIDERS: ProviderRegistry = {
},
openai: {
models: {
'gpt-5.6-luna': { default: false },
'gpt-6-luna': { default: false },
'gpt-5.3-codex': { default: false },
'gpt-5.4-nano': { default: true },
},