Skip to content

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

Merged
rekram1-node merged 10 commits into
anomalyco:devfrom
Spherrrical:feat/digitalocean-oauth-plugin
May 12, 2026
Merged

feat(plugin): add DigitalOcean OAuth + Inference Routers#26095
rekram1-node merged 10 commits into
anomalyco:devfrom
Spherrrical:feat/digitalocean-oauth-plugin

Conversation

@Spherrrical
Copy link
Copy Markdown
Contributor

@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.
Comment thread packages/app/src/components/dialog-select-model.tsx Outdated
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx Outdated
Reverts the DigitalOcean-specific grouping/sorting in the TUI and web
model pickers to keep plugin logic out of the clients (per review on
PR anomalyco#26095). Router models still surface; they just render in the
default provider group like every other model.
@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/plugin/digitalocean.ts Outdated
Comment thread packages/opencode/src/plugin/digitalocean.ts Outdated
Comment thread packages/opencode/test/provider/digitalocean.test.ts Outdated
@rekram1-node rekram1-node merged commit 159964b into anomalyco:dev May 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants