feat(plugin): add DigitalOcean OAuth + Inference Routers#26095
Open
Spherrrical wants to merge 4 commits intoanomalyco:devfrom
Open
feat(plugin): add DigitalOcean OAuth + Inference Routers#26095Spherrrical wants to merge 4 commits intoanomalyco:devfrom
Spherrrical wants to merge 4 commits intoanomalyco:devfrom
Conversation
Adds a built-in DigitalOcean plugin to the opencode package supporting both OAuth (implicit flow) and Model Access Key authentication. After OAuth, a Model Access Key is auto-created and the user's Inference Routers are surfaced as router:<name> entries on the digitalocean provider, refreshable on /connect. Threads optional metadata through AuthHook results so plugins can persist OAuth tokens and cached router lists alongside the API key. Surfaces routers under a "DigitalOcean | Inference Routers" group in both the TUI and web/desktop model pickers, sorted above base DO models. Adds the DigitalOcean provider icon to the icon sprite.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Documents OAuth and Model Access Key auth flows plus Inference Router discovery, slotted alphabetically between Deep Infra and FrogBot.
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
Adds a built-in DigitalOcean plugin to opencode supporting both OAuth (implicit flow) and Model Access Key auth. After OAuth, a Model Access Key is auto-created, and the user's Inference Routers are surfaced as
router:<name>entries on thedigitaloceanprovider — refreshable by re-running/connect.DigitalOcean is already in
models.dev, but native OAuth, MAK provisioning, and Inference Router discovery aren't expressible through the catalog alone — they need a plugin to wrap the existing provider. To support persisting OAuth tokens and cached router lists alongside the API key, this PR also threads optionalmetadatathroughAuthHook/AuthOAuthResultand the auth save path.In the model pickers (TUI + web/desktop), routers are grouped under
DigitalOcean | Inference Routersand sorted above base DO models so users can see them at a glance. The DigitalOcean logo is added to the provider icon sprite.Client ID is from an official DigitalOcean instance, please contact musamalik@digitalocean.com for questions
How did you verify your code works?
bun typecheckclean acrossopencode,plugin,app,ui,sdk/js.test/provider/digitalocean.test.ts(4 tests, all passing) covers env autoload, fresh-cache no-fetch, expired-bearer fallback, and pass-through when no metadata.bun dev:/connect→ DO OAuth → MAK created → routers listed in TUI under the new subgroup, and the icon renders correctly in the desktop app.Screenshots / recordings
Checklist