Repository navigation
fix: register V2 provider through provider.transform - #6
Merged
algonacci merged 1 commit intoOct 3, 2026
Merged
Conversation
@opencode/plugin 2.0.4 removed ctx.catalog, so the V2 entrypoint failed to load with "ctx.catalog.transform" undefined and every orvix/* model was unavailable. Register the provider and models through ctx.provider.transform instead, keeping user-configured provider fields and models untouched. Reasoning variants now put reasoning_effort in the variant body. As settings it configured the provider package and never reached the request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The OpenCode 2.x entrypoint no longer loads on current OpenCode.
@opencode/plugin2.0.4 (2026-09-16) removedctx.catalog, so setup throws:After that error every
orvix/*model reportsModel unavailable. The V2 support from #4 targeted 2.0.2, which still hadcatalog.This PR makes two changes:
ctx.provider.transform. If the provider does not exist yet, the plugin callsadd({ info, models }). If the user already configured it, the plugin fills in missing provider fields withupdateand appends its models withmodels.set. User-configured provider fields and models are still never overwritten. Each model record now carriesid(the OpenCode key),modelID(the exact upstream id, so managedorvix/*and BYOK ids still go upstream verbatim), andproviderID.body. Variants storedreasoning_effortundersettings, which configures the provider package and is never sent in the request. Selectingorvix/muse-spark-1.3#hightherefore sent noreasoning_effort. Variants now usebody.The test fakes now mirror the provider editor. AGENTS.md and the README no longer mention the catalog API. A patch changeset is included.
Verification
npm run check: typecheck clean, 58/58 tests pass.npm run package: passes.opencode run --standalone, isolated XDG dirs) against a local mock OpenAI-compatible server, withproviders.orvix.settings.baseURLpointing at the mock:orvix/glm-5.3-flashis unavailable./v1/chat/completionswithmodel: "orvix/muse-spark-1.3"/"orvix/glm-5.3-flash"and a bearer key. The user'sbaseURLoverride is respected.-m orvix/muse-spark-1.3#highnow sendsreasoning_effort: "high". Models without variants send none.Checklist
npm run check.npm run package.🤖 Generated with Claude Code