Uh oh!
There was an error while loading. Please reload this page.
fix(provider): port upstream provider/model transform for Claude 5 - #73
Merged
Merged
Conversation
jack-champagneforce-pushed
the
jack/provider-model-port
branch
from
July 28, 2026 20:35
a6b6b5f to
3a801e4CompareOur base (sst/opencode v1.17.3, 2026-06-10) predates Sonnet 5 and Opus 5.
anthropicOpus47OrLater() required both a major and a minor version in the
model id, so claude-opus-5 and claude-sonnet-5 never matched and fell back
to legacy thinking:{type:"enabled",budgetTokens:16000} with only high/max
tiers instead of the 5-tier adaptive path.
Ports the end state of upstream's provider/model files rather than the 112
commits behind them, which would drag in the layer-node -> app-node refactor
and the @opencode-ai/schema extraction:
- provider/transform.ts + its test: replaced wholesale (fork never touched
either; 0 conflicts). Also brings prompt-cache keys by SDK and the
Grok/GLM/Bedrock-Mantle variant fixes.
- core/models-dev.ts: additive reasoning_options field the transform reads.
- session/llm/request.ts: 3-way merged, 0 conflicts; amicode patch #18
preserved. Brings strict:false on OpenAI Responses-family tools.
Measured over all 454 reasoning models in the live models.dev catalog:
418 identical, 36 changed, 0 errors. Claude 4.8/4.6/4.1 unchanged.
Verified: tsgo green on opencode + core; test/provider 503 pass / 0 fail;
test/session + test/server identical before and after (3 pre-existing
llm-native-recorded failures reproduce on the unported tree).jack-champagneforce-pushed
the
jack/provider-model-port
branch
from
July 28, 2026 22:07
3a801e4 to
80008a6CompareUh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Our base is
sst/opencode v1.17.3(2026-06-10). Sonnet 5 (2026-06-29) and Opus 5 (2026-07-24) both shipped after our fork point, and at our base their thinking plumbing is silently broken:claude-opus-5has no minor;claude-sonnet-5isn't "opus". Neither matches → both fall through to the legacythinking:{type:"enabled",budgetTokens:16000}path with onlyhigh/maxtiers instead of the 5-tiertype:"adaptive"path. Upstream fixed this in #38757.This is not a "new models" problem. The catalog is fetched live from models.dev at build time (
script/generate.ts;amicode-release.ymlpins no snapshot), so Opus 5 already shows up in the picker — just hobbled, with no effort selector. QA-ing "can I select Opus 5?" gives a false negative on the need to sync.What's ported
The end state of 4 files, not the 112 commits behind them. Cherry-picking that history would drag in the Effect
layer-node → app-noderefactor and the@opencode-ai/schemaextraction (upstream guttedcore/src/model.ts127→41 andcore/src/provider.ts85→25 into a new package).provider/transform.tstest/provider/transform.test.tscore/models-dev.tsreasoning_optionsfieldsession/llm/request.tsgit merge-file3-waytransform.tsalso carries #38424 (prompt cache keys by SDK) and the Grok/GLM/Bedrock-Mantle variant fixes.request.tsbrings #33392 (strict: falseon OpenAI Responses-family tools).Measured blast radius
Ran both transform versions over all 454 reasoning models in the live models.dev catalog: 418 identical, 36 changed, 0 errors.
anthropic, allamazon-bedrockregions, andopencodezen):high,max→low,medium,high,xhigh,maxwithtype:"adaptive".claude-opus-4-5: keeps itslow,medium,highkeys but now also sendsbudgetTokens:16000alongsideeffort.Verification
tsgo --noEmitgreen onpackages/opencodeandpackages/corebun test test/provider/→ 503 pass / 0 failbun test test/session/ test/server/→ identical before and after. The 3llm-native-recordedfailures and the Bun 1.3.14 teardown segfault both reproduce byte-for-byte on the unported tree.oxlint→ 0 errors;prettier --checkcleanNeeds a QA pass before the hackathon build
CI cannot exercise these — they need live creds:
claude-opus-4-5— a model in use today — with the newbudgetTokens+effortcombination.Known trade
Porting file end-states makes a future clean upstream merge harder on these 4 files. Accepted deliberately. Worth noting the bug class recurs every model generation — version-regex parsing of model IDs will break again at Opus 6 — which argues for a standing narrow sync lane on
transform.tsrather than one-off unfreezes.Unrelated risk spotted (not fixed here)
The release build does a bare
fetch(models.dev/api.json)with no fallback, so a models.dev outage hard-fails the build. Worth pinningMODELS_DEV_API_JSONfor the hackathon build.