Skip to content

feat(opencode): add Devin provider support - #39301

Closed
VECTORG99 wants to merge 1 commit into
anomalyco:devfrom
VECTORG99:devin-provider
Closed

feat(opencode): add Devin provider support#39301
VECTORG99 wants to merge 1 commit into
anomalyco:devfrom
VECTORG99:devin-provider

Conversation

@VECTORG99

@VECTORG99 VECTORG99 commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #24072

Type of change

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

What does this PR do?

Adds Devin.ai as a provider in OpenCode via the ai-sdk-devin npm package (v0.3.6), which wraps Devin/Cognition LLM models through the AI SDK interface.

Changes:

  • packages/opencode/package.json — added ai-sdk-devin: "0.3.6" dependency
  • packages/opencode/src/provider/provider.ts:
    • Added ai-sdk-devin to BUNDLED_PROVIDERS for SDK creation via the bundled loader mechanism
    • Added Devin custom loader in custom(dep) that detects DEVIN_API_KEY env var and exposes a discoverModels() function for dynamic model discovery from the Devin API
    • Pre-populate Devin in the provider database when DEVIN_API_KEY is set, enabling auto-activation without config
    • Added Devin discovery handler (matching the existing GitLab pattern) that merges API-discovered models into the provider at startup

The custom loader follows the same pattern used by GitLab, Snowflake Cortex, Cloudflare Workers AI, and other bundled providers. The discoverModels() function lazily imports ai-sdk-devin, calls its models() API, and constructs Model objects with api.npm: "ai-sdk-devin" so model calls route through the bundled provider SDK loader.

How did you verify your code works?

  • Verified bun typecheck passes across all 30 packages in the monorepo (0 errors)
  • Verified bun install resolves and installs ai-sdk-devin@0.3.6 successfully
  • Verified the custom loader compiles with the existing CustomLoader, Info, Model types
  • Verified the database pre-population and discovery handler match the established GitLab pattern

Screenshots / recordings

N/A — provider configuration change, no UI.

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 28, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@VECTORG99 VECTORG99 closed this Jul 29, 2026
@VECTORG99
VECTORG99 deleted the devin-provider branch July 29, 2026 07:51
@VECTORG99

Copy link
Copy Markdown
Author

Resumen de lo intentado

Implementación

Se agregó Devin como bundled provider en OpenCode via ai-sdk-devin@0.3.6:

  • Custom loader en provider.ts que detecta DEVIN_API_KEY (env var, auth store, o opencode.json)
  • discoverModels() dinámico que llama a la API de Devin para obtener modelos
  • Pre-población en la base de datos para que aparezca en la UI como cualquier provider
  • Soporte completo: aparece en Ctrl+P → Models → Ctrl+A, acepta API key por UI, descubre modelos

Problema encontrado

El provider funciona correctamente, pero la API de Devin/Cognition (server.codeium.com) devuelve:

HTTP 403: {"code":"permission_denied","message":"Your account is on an individual plan. Please upgrade to a team plan to enable multi-user access."}

La API de ai-sdk-devin requiere un plan team de Devin/Cognition. Las API keys de cuentas individuales no tienen acceso a GetCascadeModelConfigs ni a GetUserJwt.

Alternativas evaluadas

Alternativa Resultado
Bundled provider con API key Funciona, pero requiere plan team
Fallback models hardcodeados Muestran modelos en la UI pero fallan al usarlos (misma API)
OAuth/login de OpenCode Requiere integración server-side en opencode.ai + acuerdo con Devin
Console-managed provider Idem anterior — fuera del alcance de un PR client-side

Conclusión

El provider está correctamente implementado del lado de OpenCode. No funciona con cuentas individuales de Devin porque la API de Devin/Cognition lo bloquea a nivel de plan. Para que sea usable se necesita:

  1. Una key de Devin con plan team, o
  2. Que Devin permita acceso a la API en planes individuales, o
  3. Integración server-side con opencode.ai (console-managed provider)

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.

[FEATURE]: Add the provider https://devin.ai/

1 participant