Skip to content

fix(ai): assume newer models keep family features - #51864

Draft
nexxeln wants to merge 3 commits into
devfrom
forward-model-capabilities
Draft

nexxeln wants to merge 3 commits into
devfrom
forward-model-capabilities

Conversation

@nexxeln

@nexxeln nexxeln commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #51339 | #48513

Why the change

Features like mid-conversation effort switching were turned on by exact model id, so every new launch (gpt-6.1-astra, claude-sonnet-5-1, …) lost them until we shipped a code change; now newer versions keep what their family already supports, with a config override for the exceptions.

Special things to note

  • A wrong guess now fails louder. Sending configuration_update or the Anthropic effort beta to a model that doesn't support it returns a 400 instead of just missing the prompt cache. Newly on but unverified: gpt-6-*-fast, dated GPT-6 snapshots, Sonnet/Haiku 5.1+, and new Claude families. The fix for any of them is compatibility.supportsEffortUpdates: false.
  • GPT-6+ models from OpenAI.configure().responses() now get the same default reasoning: { effort: "medium", summary: "auto" } as GPT-5. Before this they got no reasoning defaults at all.
  • models.dev can't set the new overrides yet because its schema has no field for them; only user config and plugins can. plugin/verbosity.ts still skips gpt-7 on purpose, so it's unchanged.

Change outline

The rules, before and after:

 OpenAI effort updates                       ai/src/protocols/openai-responses.ts
-  id is exactly gpt-6-astra | gpt-6-sol | gpt-6-luna
+  gpt-N with N >= 6, except -pro slugs
   still off: reasoning.mode "pro", context_management, Bedrock Mantle `openai.` ids

 OpenAI facade reasoning defaults            ai/src/providers/openai-options.ts
-  id includes "gpt-5"
+  gpt-N with N >= 5
   still off: gpt-5-chat, gpt-5-pro

 Anthropic effort updates                    ai/src/protocols/anthropic-messages.ts
-  Opus >= 5, Fable/Mythos >= 5.1, never Sonnet, Haiku, or other families
+  any Claude family >= 5.1, plus Opus 5

 Anthropic mid-conversation system messages  ai/src/protocols/anthropic-messages.ts
-  opus | sonnet | haiku | fable | mythos >= 5, plus Opus 4.8
+  any Claude family >= 5, plus Opus 4.8

 Copilot Responses reasoning detection       core/src/github-copilot/responses/openai-responses-language-model.ts
-  id starts with "gpt-5"
+  gpt-N with N >= 5

The Copilot one was the same AI SDK problem: on Copilot, gpt-6-* silently dropped reasoning.effort, kept temperature, and sent the system prompt as system instead of developer.

The override already existed in @opencode/ai, but config silently stripped these keys when decoding. They're now part of the shared contract:

 // packages/schema/src/model.ts
 Model.Compatibility {
   ...
   supportsPromptCacheKey?: boolean
+  supportsEffortUpdates?: boolean
+  supportsThinkingBlockBinding?: boolean
 }

How a config override reaches the request:

provider.<id>.models.<id>.compatibility   (user config or plugin transform)
  → Model.Info.compatibility
  → ModelResolver.fromCatalogModel        merges it onto LanguageModel.compatibility
  → supportsEffortUpdates(request)        the override wins over the id guess
"provider": { "openai": { "models": { "gpt-6-sol-fast": { "compatibility": { "supportsEffortUpdates": false } } } } }

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant