Repository navigation
test(core): check models.dev entrypoints against native providers - #60779
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Looks good. The new test is small and deterministic and checks the snapshot → exports → builtins contract as described. I ran test/provider.test.ts in packages/core (5/5 pass) and typecheck:tsc (passes). I also confirmed that the new test fails when a snapshot-referenced export (providers/zai/chat) is removed from packages/ai/package.json.
Public API is unchanged (test-only).
No concerns. As you noted, the next snapshot refresh will make this test fail on the new protocols/* speech and transcription paths, until each is either loaded by Core or added to the protocolOnly list.
rekram1-node
force-pushed
the
ai-dup-subpaths
branch
from
October 31, 2026 03:44
20f215e to
4bfe9b7
Compare
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 free
to 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.
Nothing in this PR deletes a subpath. Every duplicate
@opencode/ai/providers/*path is still referenced by models.dev, by Core, or by both, so removing any of them would break saved configs or catalog entries. The PR only adds a test that protects this contract.The contract
sdk.opencodeainames a package entry point.builtinsmap inpackages/core/src/provider.ts. Names missing from the map are skipped as unknown (loadable()inmodels-dev.ts).variant.ts,aisdk-native.tsandplugin/verbosity.tsalso key on these paths.package: "...") and other apps import these paths directly.An existing test already checks that the builtins map matches every package export that has a
model(). The new test closes the remaining gap. Every@opencode/ai/*value in the bundled snapshot (packages/core/src/models-dev/snapshot.txt) must be a real package export and a loadable builtin. The only exception is an explicit list of protocol-only entry points.Duplicate paths
providers/openai-compatible-responsesproviders/openai-compatible/responsesprovider.tsloader,variant.ts, and aprovider.test.tstest that pins it for existing configs. ai tests import the source file.providers/openai-compatible/responsesvariant.ts, README, www docsproviders/google-vertex-messagesproviders/google-vertex/messagesprovider.tsloader,variant.ts, and the same config test.auth-options.types.tsproviders/google-vertex/messagesvariant.ts,models-dev.ts,aisdk-native.ts(@ai-sdk/google-vertex/anthropicmaps here), README, docsproviders/amazon-bedrock/mantleproviders/amazon-bedrock/mantle/responsesaisdk-native.tsreturns it as a rewrite target. Also the loader,variant.ts, and testsproviders/amazon-bedrock/mantle/responsesvariant.ts,plugin/verbosity.ts, docsSeveral
<provider>/chat,/responsesand/messagessubpaths re-export the root'smodel:alibaba/chat,moonshot/chat,minimax/messages,zai/chat,zai-coding-plan/chat,meta/responses,openai/responsesandgoogle-vertex/gemini. These are not module duplicates, because each root is the provider's full module with more exports. models.dev uses every one of these subpaths, and Core loads every root. All are kept.Gap this surfaced
The snapshot points
openai/gpt-6-luna'sdecisionsAPI at@opencode/ai/protocols/openai-decisions. That entry point has nomodel(), so Core skips that API. The test lists it explicitly. Any new non-loadable value fails the test until someone decides how to handle it. Current models.dev data also namesprotocols/openai-speech,openai-transcription,google-speechand similar paths. These will hit the same check when the snapshot is next refreshed.Verification
providers/zai/chat.bun run checkpasses.bun typecheckandtypecheck:tscpass inpackages/aiandpackages/core.