GeezerVison is showing github.com — fix(core): read effort and system update flags from models.dev by rekram1-node · Pull Request #66717 · anomalyco/opencode
Conversation
rekram1-node
commented
Nov 27, 2026
•
edited by opencodejr
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
No issue. Found while reworking #66648.
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
models.dev records per API whether a model takes effort changes (effort_updates) and system messages (system_updates) mid-conversation, but opencode never read either flag. #61492 gave the AI package matching capabilities (reasoning.updates, systemUpdates) and left filling them from the catalog for later; that step never landed. So every catalog model fell back to each route's model-ID guess (GPT-6+ on OpenAI Responses, Claude 5.x on Anthropic Messages), and routes without a guess, like the shared Open Responses route Copilot uses, never sent either.
This reads both flags from the model's API in models.dev:
models.dev api.<name>.capabilities
effort_updates = true → compatibility.supportsEffortUpdates → capabilities.reasoning.updates
system_updates = true → compatibility.supportsSystemUpdates → capabilities.systemUpdates
unset or false → nothing set, the route keeps its own detection
- Only a yes on the model's API counts. An unset or false flag changes nothing, so no model loses support it has today. The model-wide
system_updates isn't read: models.dev sets it for Chat Completions developer messages on many hosts that also list an Anthropic Messages API (Kimi, DeepSeek, Qwen, OpenRouter, Vercel), where it would turn on native system messages nobody tested.
- New
compatibility.supportsSystemUpdates, next to supportsEffortUpdates: models.dev fills it, and a config can override it per model. It is model-only, like supportsEffortUpdates. This is an additive public schema field (client, OpenAPI and cli-rs types regenerated or updated, docs updated).
tools.updates is left out on purpose. The routes act on it as soon as it's set: OpenAI Responses moves every tool into a leading additional_tools item and Anthropic sends tool changes in place. That changes the request shape for many models, so it should land on its own.
What changes with today's catalog (APIs where models.dev says yes and the route's guess says no):
| Flag |
Newly on |
effort_updates |
OpenAI GPT-5.6 on openai (Responses); GPT-5.6 and GPT-6 on GitHub Copilot once #66648 makes the Open Responses route honor it |
system_updates |
MiniMax M3 and M3.1 Flash on MiniMax's Anthropic Messages API (4 providers) |
Everything else marked yes is already on through the routes' guesses: GPT-6 on OpenAI, Azure, Cloudflare AI Gateway and Vercel; Claude on Anthropic, Bedrock and Copilot.
How did you verify your code works?
models.test.ts: effort_updates and system_updates set to true on the API set both compatibility flags; false leaves them unset.
model-resolver.test.ts: the compatibility flags reach the AI model as reasoning.updates and systemUpdates, and stay unset when the model has none.
bun run check passes. Full packages/ai suite passes. Full packages/core suite passes except two shell-scan tests that fail the same way on dev locally.
Screenshots / recordings
Not a UI change.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Added by the opencode bot (AI-generated).
Related: #59868
Public API: adds optional model compatibility.supportsSystemUpdates to the config schema, OpenAPI and client types (backwards compatible)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
No problems found. This reads the per-API effort_updates/system_updates from models.dev into the model's compatibility, then into reasoning.updates/systemUpdates. Only an explicit true is passed on, so routes without the flag keep guessing from the model ID. I checked it with the touched core tests (all pass with the PR; the new cases fail on the base) and tsc in packages/core (passes; bun check isn't available in this environment). I couldn't run it end to end, since the flags only change what's sent to real providers.
Public API: adds the optional compatibility.supportsSystemUpdates (boolean, model-only, so it's also left out of the provider-level compatibility settings) to the schema, the OpenAPI spec, the client types and the cli-rs/Luau types. It's additive and backwards compatible; no existing config changes meaning.
One thing to keep in mind, not a blocker: the Bedrock Mantle messages route lets any explicit reasoning.updates skip its Opus 5.0 limit. So models.dev needs to keep effort_updates off for Opus 5.0 on Mantle, or those requests will be rejected.
Related: #59868
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|