Add Devin CLI provider - #6235
Conversation
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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
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.tsnow 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 MCPAuthorizationheader this PR sends insession/new).- Leftover debug output (
Console.log,Effect.logInfoof the rawsession/newresponse) in production Devin paths. - Devin's model-discovery probe fails with
ProviderAdapterProcessErrorand a fabricatedthreadId: "probe"instead of a probe-specific error. DevinProvider.test.tsreadsdevin-models-list.txtfromprocess.cwd(), and that fixture is not in the repository.
Posted via Macroscope — Effect Service Conventions
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
- 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>
There was a problem hiding this comment.
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
- 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>
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.
There was a problem hiding this comment.
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
- 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.
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>
There was a problem hiding this comment.
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
The empty state appeared when no search was active, so it now renders only while filtering.
…ings Always override inherited Devin permission mode with the configured setting.\nInclude deduplicated provider-instance Devin homes in usage transcript scans.
Normalize Devin reasoning option ids before matching underscored configuration identifiers.
There was a problem hiding this comment.
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
…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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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.
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.
There was a problem hiding this comment.
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
Use Effect tag handling for auth retries and ignore non-select options when identifying Devin reasoning controls.
There was a problem hiding this comment.
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
Keep the new provider settings select menu positioned consistently with other settings controls.
|
closing as superseded by #7567. That PR preserves this work and attribution while adding real-install and stateful-session hardening. |

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:
DevinDriver,DevinAdapter,DevinProvider, andDevinTextGenerationmodules following the existing per-instance driver pattern.DevinAcpSupport) with model/reasoning variant mapping, permission handling, and real-time token usage collection.t3code-usage.jsonltranscripts.DevinDriverregistered inBUILT_IN_DRIVERS.Contracts:
DevinSettingsschema (binary path, home path, launch args, permission mode, custom models).UsageProviderKindnow includes"devin".DEFAULT_MODEL_BY_PROVIDER, display names, model aliases, and editor registry wired for Devin.Web:
OpenInPickerandEDITORSregistry).description.Mobile:
Marketing:
Docs:
docs/user/providers-devin.mdwith install, binary path, multi-account setup, and usage notes.docs/internals/providers.mdand related docs updated to list the new driver.How to verify
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.tsvp test run apps/web/src/components/settings/ProviderSettingsForm.test.tsNotes / risks
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
Note
Add Devin CLI provider with ACP integration, usage tracking, and settings UI
devinprovider driver (DevinDriver.ts) registered inBUILT_IN_DRIVERS, with binary resolution (devin/devin-desktop),DEVIN_HOMEenvironment handling, and continuation group keys derived from home path.DevinAcpSupportandDevinAdaptermodules that spawn Devin over ACP with on-demand authentication (devin-browsermethod) and transparent retry on auth-required errors.AcpSessionRuntimewith anauthPolicyoption (eagervsonDemand); underonDemand, auth is deferred and retried after a-32000error during session setup.usage_updatehandling toparseSessionUpdateEvent, newparseDevinLinetranscript parser, and wires Devin transcript directory discovery intoUsageService;usageScanCacheandUsageProviderKindnow acceptdevin.DevinSettingsschema (binaryPath, homePath, launchArgs, permissionMode select, customModels),DEVIN_DRIVER_KIND, default modeladaptive, optionaldescriptiononServerProviderModel, andProviderSettingsFormSelectOption/ select control support in provider settings.ProviderModelsSectionsearch/filter with disabled reordering during search, select-field rendering inProviderSettingsForm, usage provider presentation (web + mobile), Open-in picker entry, and marketing homepage tile.DevinTextGenerationfactory for commit messages, PR content, branch names, and thread titles via Devin ACP with a 180s timeout and JSON schema decoding.nextProviderConfigWithFieldValuenow omits a field when its value equals the schema default andclearWhenEmpty='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
devindriver wires binary resolution (devin/devin-desktop),DEVIN_HOMEand continuation grouping, health checks viadevin --version, and model discovery fromdevin 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-onlyt3code-usage.jsonldeltas. Shared ACP runtime gainsauthPolicy(eagervsonDemand): authenticate only when the agent advertises methods, validate the requested method, and retrysession/newafter auth-required errors; the mock agent supports advertised auth methods for tests.ProviderProbeErroris 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.