docs: add a combined oauth2 + models-info example#23
Merged
Conversation
Show one provider authenticated by @vymalo/opencode-oauth2 and enriched by @vymalo/opencode-models-info, with the key gotcha called out: list the oauth2 plugin first so its config hook stamps the bearer onto the provider headers before models-info runs its fetch. Added to the top-level README companion section and the package README's Auth composition section. Uses the absolute modelsInfoUrl form for clarity; no models block / Authorization header needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in README.md and packages/opencode-models-info/README.md to include examples of configuring the @vymalo/opencode-oauth2 and @vymalo/opencode-models-info plugins together. The feedback suggests changing the example modelsInfoUrl from https://api.example.com/v1/models to https://api.example.com/v1/models/info in both files to prevent confusion with standard model discovery endpoints that do not return rich metadata.
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
Adds a concrete example of the two plugins working together — one provider authenticated by
@vymalo/opencode-oauth2and enriched by@vymalo/opencode-models-info. Docs-only.{ "plugin": ["@vymalo/opencode-oauth2", "@vymalo/opencode-models-info"], "provider": { "my-provider": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://api.example.com/v1", "oauth2": { "issuer": "https://auth.example.com", "clientId": "opencode-client", "scopes": ["openid", "profile", "offline_access"] }, "meta": { "modelsInfoUrl": "https://api.example.com/v1/models" } } } } }Key point called out
List
@vymalo/opencode-oauth2first in thepluginarray. Config hooks run in registration order, so oauth2 must run before models-info to stamp the bearer onto the provider headers before the metadata fetch happens. The example explains the boot sequence (oauth2 auth + discovery + bearer stamp → models-info fetch + enrich) and notes that nomodelsblock orAuthorizationheader is needed.Where
Markdown only → Biome unaffected (62 files clean).
🤖 Generated with Claude Code