Skip to content

[codex] add Devin CLI provider#3639

Closed
Derpedyea wants to merge 24 commits into
pingdotgg:mainfrom
Derpedyea:codex/add-devin-cli-provider
Closed

[codex] add Devin CLI provider#3639
Derpedyea wants to merge 24 commits into
pingdotgg:mainfrom
Derpedyea:codex/add-devin-cli-provider

Conversation

@Derpedyea

@Derpedyea Derpedyea commented Jul 1, 2026

Copy link
Copy Markdown

What Changed

Adds a Devin CLI provider backed by Devin's ACP server.

  • Adds the Devin driver, provider layer, adapter service, ACP support, text-generation integration, and built-in provider/catalog registration.
  • Adds Devin settings/model defaults, provider picker/settings metadata, and brand icons.
  • Adds shared provider model discovery caching used by the Devin provider path.
  • Wires ACP session/elicitation into T3 structured user-input.requested / user-input.resolved events so Devin can request form or URL-based user input without hanging.
  • Adds server, contract, and web metadata tests for Devin provider behavior.

Why

Closes #3636.

Devin CLI exposes ACP via devin acp, which makes it possible to integrate as a local CLI-backed provider in the same general family as existing ACP provider integrations.

References:

UI Changes

Adds Devin as an early-access provider option with Devin icons and configurable binary/config paths in provider settings.

Screenshots are not included yet; this is a draft PR and the UI change is limited to provider picker/settings metadata.

Validation

  • pnpm exec vp check passed. It still reports existing unrelated lint warnings in web/mobile files.
  • pnpm exec vp run typecheck passed.
  • pnpm exec vp run --filter t3 test -- src/provider/Layers/DevinAdapter.test.ts src/provider/Layers/DevinProvider.test.ts src/provider/acp/DevinAcpSupport.test.ts passed: 31 tests.
  • pnpm exec vp run --filter @t3tools/contracts test -- src/settings.test.ts passed: 13 tests.
  • pnpm exec vp run --filter @t3tools/web test -- src/components/settings/ProviderSettingsForm.test.ts passed: 11 tests.

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 (not applicable: no animation/interaction changes)

Note

Medium Risk
Large new session/turn/approval path with intricate prompt-settlement and cancel races, but it mirrors existing ACP providers and is heavily covered by integration tests.

Overview
Adds Devin as a multi-instance CLI provider (devin acp), including driver, snapshot/health probing, adapter, and catalog/settings/UI wiring alongside other shipped drivers.

The Devin ACP adapter runs sessions over the shared ACP runtime: permissions, mid-turn steering (reuse turn id while promptsInFlight > 0), cancel/stop with strict prompt settlement, resume cursors, model discovery from session setup, and in-session model/mode switches via Devin-specific grouping of thinking/speed/context variants into base models plus option descriptors.

session/elicitation is mapped to structured user-input.requested / user-input.resolved (form schemas and URL prompts) with mock-agent coverage via T3_ACP_EMIT_ELICITATION.

Shared provider/ACP pieces: optional skipAuthentication on ACP startup, shared flatten/find model select helpers (Cursor now imports these), ProviderModelDiscoveryCache to refresh snapshots after real-session model discovery, and per-instance ProviderModelMergePolicy so Devin drops stale raw variant slugs when grouped models update.

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

Note

Add Devin CLI as a built-in provider with ACP adapter, text generation, and settings UI

  • Adds a full Devin provider driver (DevinDriver.ts) including ACP adapter, model discovery, snapshot building, and text generation via the new shared makeAcpJsonTextGeneration factory.
  • Introduces Devin-specific ACP extension parsing (DevinAcpExtension.ts) and elicitation normalization (DevinElicitation.ts) to handle ask-question, create-plan, update-todos, and private elicitation flows.
  • Adds DEVIN_MODEL_MERGE_POLICY to retain custom models across discovery refreshes while dropping raw ACP model variants covered by base model IDs.
  • Exposes Devin in the web settings UI with schema, icon, and an "Early Access" badge; registers it in PROVIDER_OPTIONS with a 'new' sidebar badge.
  • Refactors GrokAdapter and CursorTextGeneration to use the new shared AcpAdapterLive and makeAcpJsonTextGeneration abstractions, reducing per-provider boilerplate.
  • Adds multi-select support for pending user input (toggle semantics, selectedOptionLabels array, optional questions) across web and mobile.
  • Fixes buildWindowsEnvironmentCaptureCommand to capture PATH as a normalized semicolon-joined string, and fixes JSON-RPC string id preservation in makeAcpPatchedProtocol.

Macroscope summarized 558b9a9.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

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

Run ID: 5a5b36ca-7804-4264-aa90-e67b7801a2a3

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 Jul 1, 2026

@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 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

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

Comment thread apps/server/src/textGeneration/DevinTextGeneration.ts Outdated
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/ProviderModelDiscoveryCache.ts Outdated
Comment thread apps/server/src/provider/Layers/ProviderRegistry.ts
Comment thread apps/web/src/session-logic.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/DevinProvider.ts Outdated
Comment thread apps/server/src/textGeneration/DevinTextGeneration.ts Outdated
Comment thread apps/server/src/provider/Layers/ProviderRegistry.ts
Comment thread apps/server/src/textGeneration/DevinTextGeneration.ts Outdated
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
@Derpedyea Derpedyea closed this Jul 2, 2026
@Derpedyea Derpedyea reopened this Jul 2, 2026
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
Comment thread apps/server/src/provider/acp/AcpAdapterRuntime.ts Outdated
@Derpedyea
Derpedyea force-pushed the codex/add-devin-cli-provider branch from 7a3595d to 6f81182 Compare July 2, 2026 13:14
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
Comment thread apps/server/src/provider/acp/AcpAdapterRuntime.ts
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
Comment thread apps/server/src/provider/acp/AcpAdapterRuntime.ts
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
@Derpedyea
Derpedyea force-pushed the codex/add-devin-cli-provider branch from cc55436 to ddffa1a Compare July 3, 2026 23:53
Comment thread apps/server/src/provider/acp/DevinElicitation.ts
Comment thread apps/web/src/session-logic.ts
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
Comment thread apps/server/src/provider/acp/DevinAcpSupport.ts
Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/acp/AcpAdapterRuntime.ts Outdated
@Derpedyea
Derpedyea force-pushed the codex/add-devin-cli-provider branch from 0d6f37d to d7b9c3f Compare July 4, 2026 00:19
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
Comment thread apps/server/src/provider/acp/DevinElicitation.ts Outdated
Comment thread apps/server/src/textGeneration/AcpJsonTextGeneration.ts
@Derpedyea

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread apps/server/src/textGeneration/AcpJsonTextGeneration.ts Outdated
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
Comment thread apps/server/src/provider/Drivers/DevinDriver.ts
Comment thread apps/server/src/provider/acp/AcpAdapterLive.ts
@Derpedyea
Derpedyea marked this pull request as ready for review July 4, 2026 04:53
@Derpedyea

Copy link
Copy Markdown
Author

Everything should be working. If you have issues Ill respond by Monday as its the 4th tmrw (today)

@macroscopeapp

macroscopeapp Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

@Derpedyea

Copy link
Copy Markdown
Author

Forgot a few things and will fix tmrw

@Derpedyea

Copy link
Copy Markdown
Author

Clarifying the Windows PATH capture change in apps/desktop/src/shell/DesktopShellEnvironment.ts:

captureWindowsEnvironmentCommand builds the PowerShell snippet used by the Electron parent process to hydrate process.env before the desktop backend is started. The special PATH branch is intentional. Calling [Environment]::GetEnvironmentVariable('PATH') without a scope only reads the current process environment, which can already be stale in a packaged Windows app if a CLI was installed after the launcher or Explorer environment was created.

For PATH, the code reads the three Windows scopes explicitly:

  • Process: entries inherited by the currently running app
  • Machine: system PATH from the registry
  • User: per-user PATH from the registry, where npm/pnpm/Volta-style CLI shims commonly live

It then joins the non-empty values so T3 Code sees the current user and machine PATH entries instead of relying only on the stale inherited process snapshot. This is why a restart may appear to fix the issue, but the app should not depend on a full Windows session refresh to find newly installed CLIs.

For Devin specifically, the server-side shared shell fix is the direct dependency for resolving devin. This desktop-side change is the same environment hydration applied earlier, in the Electron parent process, and benefits all desktop-launched CLI providers. If maintainers prefer stricter PR scope, I am fine splitting this desktop bootstrap fix into a separate follow-up PR.

@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.

Effect Service Conventions review. The new Devin provider code largely follows the conventions well (namespace subpath imports, Schema.TaggedErrorClass errors with structured fields, shared makeAcpAdapterLive extraction, removal of the standalone GrokAdapterShape). One error-convention issue was found: two newly-added error constructions derive the wrapper message from cause.message. The conventions require the message to come only from stable structural attributes, with the underlying failure preserved solely as cause (which is already passed here). These mirror the existing Grok/Cursor pattern, but per the instructions the conventions are authoritative for newly changed code.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Layers/DevinAdapter.ts Outdated
Comment thread apps/server/src/provider/Drivers/DevinDriver.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 retained error-convention violation in the new shared ACP runtime. The two previously flagged instances (DevinAdapter.ts and DevinDriver.ts) remain unaddressed as well.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/acp/AcpAdapterRuntime.ts Outdated
@Derpedyea
Derpedyea force-pushed the codex/add-devin-cli-provider branch from 41be1fb to 38e6c79 Compare July 8, 2026 20:49
@Derpedyea

Copy link
Copy Markdown
Author

Closing as PR is stale.

@Derpedyea Derpedyea closed this Jul 19, 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