Skip to content

feat(plugin): add DigitalOcean OAuth + Inference Routers#26095

Open
Spherrrical wants to merge 4 commits intoanomalyco:devfrom
Spherrrical:feat/digitalocean-oauth-plugin
Open

feat(plugin): add DigitalOcean OAuth + Inference Routers#26095
Spherrrical wants to merge 4 commits intoanomalyco:devfrom
Spherrrical:feat/digitalocean-oauth-plugin

Conversation

@Spherrrical
Copy link
Copy Markdown

@Spherrrical Spherrrical commented May 7, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 the digitalocean provider — 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 optional metadata through AuthHook / AuthOAuthResult and the auth save path.

In the model pickers (TUI + web/desktop), routers are grouped under DigitalOcean | Inference Routers and 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 typecheck clean across opencode, plugin, app, ui, sdk/js.
  • New 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.
  • Manually verified end-to-end via 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

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@Spherrrical Spherrrical requested a review from adamdotdevin as a code owner May 7, 2026 00:04
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant