Skip to content

Add Devin CLI provider - #6235

Closed
rafael-franca wants to merge 58 commits into
pingdotgg:mainfrom
rafael-franca:rafaelfranca/add-devin-provider
Closed

Add Devin CLI provider#6235
rafael-franca wants to merge 58 commits into
pingdotgg:mainfrom
rafael-franca:rafaelfranca/add-devin-provider

Conversation

@rafael-franca

@rafael-franca rafael-franca commented Aug 11, 2026

Copy link
Copy Markdown

Summary

Add Devin as a built-in T3 Code provider, so users with a Devin subscription can drive sessions through the same chat, settings, and usage surfaces as Codex, Claude, Cursor, Grok, and OpenCode.

Closes #3636

What Changed

Server:

  • New DevinDriver, DevinAdapter, DevinProvider, and DevinTextGeneration modules following the existing per-instance driver pattern.
  • ACP runtime integration (DevinAcpSupport) with model/reasoning variant mapping, permission handling, and real-time token usage collection.
  • Usage transcript integration for Devin's t3code-usage.jsonl transcripts.
  • DevinDriver registered in BUILT_IN_DRIVERS.

Contracts:

  • DevinSettings schema (binary path, home path, launch args, permission mode, custom models).
  • UsageProviderKind now includes "devin".
  • DEFAULT_MODEL_BY_PROVIDER, display names, model aliases, and editor registry wired for Devin.

Web:

  • Devin icon, provider card, settings form, model picker, and usage chart series.
  • "Open in Devin Desktop" added to the editor picker (OpenInPicker and EDITORS registry).
  • Fixed model description tooltip rendering when a model has only a description.

Mobile:

  • Usage attribution and model display name for Devin.

Marketing:

  • Added Devin to the hero and harness grid, updated orchestration copy to include Devin.

Docs:

  • docs/user/providers-devin.md with install, binary path, multi-account setup, and usage notes.
  • docs/internals/providers.md and related docs updated to list the new driver.
  • README updated to list Devin as a supported provider.

How to verify

  1. vp test run apps/server/src/provider/Layers/DevinAdapter.test.ts apps/server/src/provider/Layers/DevinProvider.test.ts apps/server/src/provider/acp/DevinAcpSupport.test.ts
  2. vp test run apps/web/src/components/settings/ProviderSettingsForm.test.ts
  3. Start the dev server, add a Devin provider in Settings, and confirm the provider picker, model dropdown, usage charts, and "Open in" menu all show Devin correctly.

Notes / risks

  • Devin CLI authentication is handled by Devin itself, not T3 Code. Users must run the Devin login flow before starting a session.
  • Devin ACP is still relatively new; some model/reasoning variants may need fallback mapping as Devin CLI evolves.
  • Existing providers are unaffected.

Why

Devin is a coding agent users want to run inside T3 Code alongside Codex, Claude, Cursor, Grok, and OpenCode. Because providers are a cross-surface feature (server runtime, contracts, web settings/chat/usage, docs), adding a new one touches the whole stack.

UI Changes

This PR adds Devin to the provider picker, settings form, model selector, and usage charts. Before/after screenshots and a short settings walkthrough video should be attached below before the PR is opened.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add Devin CLI provider with ACP integration, usage tracking, and settings UI

  • Introduces a full devin provider driver (DevinDriver.ts) registered in BUILT_IN_DRIVERS, with binary resolution (devin/devin-desktop), DEVIN_HOME environment handling, and continuation group keys derived from home path.
  • Adds DevinAcpSupport and DevinAdapter modules that spawn Devin over ACP with on-demand authentication (devin-browser method) and transparent retry on auth-required errors.
  • Extends AcpSessionRuntime with an authPolicy option (eager vs onDemand); under onDemand, auth is deferred and retried after a -32000 error during session setup.
  • Adds usage_update handling to parseSessionUpdateEvent, new parseDevinLine transcript parser, and wires Devin transcript directory discovery into UsageService; usageScanCache and UsageProviderKind now accept devin.
  • Adds contracts: DevinSettings schema (binaryPath, homePath, launchArgs, permissionMode select, customModels), DEVIN_DRIVER_KIND, default model adaptive, optional description on ServerProviderModel, and ProviderSettingsFormSelectOption / select control support in provider settings.
  • Adds UI surface: Devin icon, provider picker entry, ProviderModelsSection search/filter with disabled reordering during search, select-field rendering in ProviderSettingsForm, usage provider presentation (web + mobile), Open-in picker entry, and marketing homepage tile.
  • Adds DevinTextGeneration factory for commit messages, PR content, branch names, and thread titles via Devin ACP with a 180s timeout and JSON schema decoding.
  • Risk: nextProviderConfigWithFieldValue now omits a field when its value equals the schema default and clearWhenEmpty='omit'; existing configs relying on explicit default values being persisted will no longer store them.

Macroscope summarized 79c8248.


Note

Medium Risk
New provider stack is large (ACP adapter + auth/session changes) but follows existing driver patterns; shared ACP auth and model config ID matching could affect other ACP agents if misconfigured.

Overview
Adds Devin as a built-in coding-agent provider so users can run Devin CLI sessions from T3 Code alongside existing harnesses.

On the server, a new devin driver wires binary resolution (devin / devin-desktop), DEVIN_HOME and continuation grouping, health checks via devin --version, and model discovery from devin models list (JSON/text parsing with family deduplication and reasoning option descriptors). A large ACP adapter handles sessions, steered prompts, permissions, usage_update → token snapshots, and append-only t3code-usage.jsonl deltas. Shared ACP runtime gains authPolicy (eager vs onDemand): authenticate only when the agent advertises methods, validate the requested method, and retry session/new after auth-required errors; the mock agent supports advertised auth methods for tests. ProviderProbeError is introduced for failed model-list probes.

Contracts, web, mobile, and marketing register Devin (settings schema, usage kind, model aliases, provider UI, usage charts, Devin Desktop in the editor picker). README and provider docs describe install and multi-account setup.

Reviewed by Cursor Bugbot for commit 79c8248. Bugbot is set up for automated code reviews on this repo. Configure here.

T3 Code now supports Devin as a first-class provider alongside Codex, Claude, Cursor, Grok, and OpenCode.

Server changes add the Devin driver, ACP adapter and runtime, provider snapshot, text generation, and usage transcript support. Web and contract changes add the Devin icon, settings, model selection, and usage attribution. Docs are updated with a Devin provider guide and related internals references.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b8466fc-f3af-466c-9ca3-1a312d5eef89

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 11, 2026
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/web/src/components/settings/ProviderModelsSection.tsx
Comment thread apps/server/src/provider/Drivers/DevinDriver.ts
Comment thread apps/server/src/provider/Layers/DevinProvider.ts Outdated
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts Outdated
Comment thread apps/server/src/provider/Drivers/DevinHome.ts Outdated
Comment thread apps/server/src/provider/acp/AcpNativeLogging.ts Outdated
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the new Devin service/provider modules against the Effect service conventions. The Devin driver, home/binary helpers, ACP support module, text generation and adapter shape all follow the existing per-provider patterns (namespace subpath imports, make* factories, Foo["Service"] references, tagged errors with structural attributes).

Findings are concentrated in logging safety and probe error modelling:

  • AcpNativeLogging.ts now writes raw ACP wire frames (and a new debug log of every payload) instead of the sanitized summaries, which re-exposes secrets carried in ACP params (e.g. the MCP Authorization header this PR sends in session/new).
  • Leftover debug output (Console.log, Effect.logInfo of the raw session/new response) in production Devin paths.
  • Devin's model-discovery probe fails with ProviderAdapterProcessError and a fabricated threadId: "probe" instead of a probe-specific error.
  • DevinProvider.test.ts reads devin-models-list.txt from process.cwd(), and that fixture is not in the repository.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinProvider.test.ts Outdated
Comment thread apps/server/src/provider/acp/AcpNativeLogging.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinProvider.ts Outdated
Comment thread apps/server/src/provider/acp/AcpNativeLogging.ts Outdated
rafael-franca and others added 3 commits August 11, 2026 19:46
Track both last received ACP usage and last written usage separately to prevent duplicate transcript entries. Add `lastWrittenAcpUsage` to session context and only write deltas when usage increases. Capture usage from `UsageUpdated` events and merge with `PromptResponse` usage.

Normalize reasoning variant matching to handle synonyms like "no-thinking"/"none" and "lightning-medium". Add variant expansion logic and tests for
Comment thread apps/server/src/usage/UsageService.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
- AcpNativeLogging: never emit raw ACP frames or payload debug logs; always summarize payloads before logging.
- DevinAcpSupport: remove leftover Console.log in model selection.
- DevinAdapter: remove Effect.logInfo of the raw session/new response.
- DevinProvider: introduce ProviderProbeError and use it for devin models list failures instead of ProviderAdapterProcessError with a fabricated 'probe' threadId.
- DevinProvider.test: add missing devin-models-list.txt fixture.
- mobile: include 'devin' in usage provider labels/colors and model display labels.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the Devin provider addition against the Effect service conventions. Five concrete items, mostly in the new Devin modules plus one shared-ACP behavior change that reaches the other ACP providers.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts Outdated
Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinProvider.test.ts Outdated
rafael-franca and others added 2 commits August 12, 2026 07:36
- DevinProvider: parse stdout alone, fallback to stderr for text output.
- DevinDriver: derive continuation group key from resolved home path.
- DevinHome: clear inherited DEVIN_HOME and always set resolved home path.
- DevinAdapter: remove Console import/dead locals, fix usage input derivation and
  equal-total breakdown, validate prompt before model switch, fork ACP drain
  into sessionScope.
- DevinAcpSupport: reuse AcpRuntimeModel config helpers, fail on missing model
  option, handle default reasoning and reason synonyms.
- AcpSessionRuntime: keep auth method authoritative; fail when not advertised.
- usageScanCache: accept 'devin' scan-cache entries.
- ProviderModelsSection: use orderedModels index for move buttons.
- DevinProvider.test: resolve fixture from import.meta.dirname.
- Add focused tests for DevinAdapter, DevinHome, usage scan cache, and ACP auth.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/web/src/components/settings/ProviderModelsSection.tsx
rafael-franca and others added 12 commits August 12, 2026 10:59
The Devin adapter's getThreadSemaphore inserted one Semaphore per threadId into threadLocksRef, but stopSessionInternal and stopAll never removed the entries. This caused unbounded memory growth for long-lived adapters. Remove the threadId from the map when the session stops so the lock table does not accumulate stale entries.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The hasDetails guard in ProviderModelsSection only checked capability labels and whether the model name differs from its slug, so models with only a description never triggered the info tooltip. Include a non-empty model.description in the guard so the tooltip renders.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
deriveProviderSettingsFields now exposes binaryPath, homePath, launchArgs and permissionMode for the Devin provider, matching the schema order. Update the test expectation to match the visible fields.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add Devin Desktop as an available editor option in the OpenInPicker menu and EDITORS registry. Include DevinIcon import, register "devin-desktop" command with "goto" launch style, and reformat EDITORS array for consistency.
Add Devin logo SVG, display Devin alongside other AI tools in hero section and harness grid, update copy to include Devin in orchestration list. Adjust mobile layout to accommodate six harnesses.

Refactor DevinAdapter to use Effect.fn wrapper, replace manual record guard with Schema-based DevinResume decoder, and improve type safety for resume parsing.
Remove unused EffectAcpErrors import, add DEVIN_AUTH_METHOD_ID to imports, and apply consistent formatting across test cases. Wrap long test descriptions and mock function chains to improve readability.
… logic

Add comprehensive test coverage for makeDevinTokenUsageSnapshot and makeDevinTokenUsageSnapshotFromUsageUpdate functions. Tests verify token accumulation, context compaction handling, and edge cases like zero-size contexts.

Refactor buildThreadTokenUsageSnapshot to simplify token delta calculations, use turn-based token counting when available, and properly track totalProcessedTokens across usage updates. Export snapshot functions for testability.
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding on the new provider probe error: its failure modes are distinguished only by prose in detail, so the stage and exit code are not structurally recoverable.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Errors.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
- devinUsageDeltaTotals now computes per-field deltas and returns undefined
  only when all deltas are zero, fixing token-lag drops in totalTokens.
- sendTurn no longer updates lastWrittenAcpUsage when the delta is zero;
  it only advances the baseline after a successful transcript write.
- UsageUpdated no longer rebases lastWrittenAcpUsage to the context used
  value, preventing re-counting after context compaction.
- Wrap the ACP notification event handler body in withThreadLock to remove
  the race with sendTurn when mutating lastWrittenAcpUsage.
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Wrapping the ACP notification stream in withThreadLock caused a deadlock:
prepared.acp.drainEvents emits an EventStreamBarrier and waits for its
acknowledgement while holding the per-thread permit, but the consumer
acknowledges the barrier only after acquiring the same permit. Grok and
Cursor already ack barriers outside the lock.

Keep the baseline/delta fixes from the previous commit (no lastWrittenAcpUsage
rebase on UsageUpdated, per-field deltas, no baseline advance when no delta is
written) and restore the notification handler to run without the lock.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One follow-up on the new model search empty state in ProviderModelsSection. Everything else in the web scope (Devin icon, provider icon/badge/usage entries, and the new select control in ProviderSettingsForm) matches the existing primitive contracts and call-site conventions.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ProviderModelsSection.tsx Outdated
rafael-franca and others added 2 commits August 18, 2026 08:41
The empty state appeared when no search was active, so it now renders only while filtering.
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts Outdated
Comment thread apps/server/src/usage/UsageService.ts Outdated
rafael-franca and others added 2 commits August 18, 2026 09:07
…ings

Always override inherited Devin permission mode with the configured setting.\nInclude deduplicated provider-instance Devin homes in usage transcript scans.
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
rafael-franca and others added 2 commits August 19, 2026 08:29
Normalize Devin reasoning option ids before matching underscored configuration identifiers.

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: an unbounded error message is copied into a log annotation in the new Devin usage-transcript writer. Everything else in the Devin driver/adapter/provider follows the existing Effect service conventions (namespace imports, environment-acquired dependencies, structured Schema.TaggedErrorClass failures with static detail and preserved cause).

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
…nd usage log annotation

Bound Devin usage log annotations to the error tag instead of the raw message. Route reasoning-only changes through Devin model variants when no reasoning config option exists.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0a515ca. Configure here.

Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
rafael-franca and others added 3 commits August 20, 2026 05:21
Treat an already-unset default reasoning selection as unchanged to avoid repeated model or config updates.
Defer Devin authentication until an ACP session setup request reports that authentication is required.
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One convention finding on the ACP auth retry path; everything else in the new Devin service/driver/adapter modules follows the repo's Effect service conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts Outdated
Use Effect tag handling for auth retries and ignore non-select options when identifying Devin reasoning controls.

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One consistency note on the new provider settings select. Everything else in the changed web files (Devin icon, provider metadata, usage presentation, model search/empty state) matches existing patterns.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ProviderSettingsForm.tsx Outdated
Keep the new provider settings select menu positioned consistently with other settings controls.
@t3-code

t3-code Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

closing as superseded by #7567. That PR preserves this work and attribution while adding real-install and stateful-session hardening.

@t3-code t3-code Bot closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Devin CLI support

1 participant