t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[codex] add Devin CLI provider

Open Derpedyea opened this issue 5 months ago • 7 comments

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:

  • https://docs.devin.ai/cli#windows
  • https://docs.devin.ai/cli/reference/commands#devin-acp
  • #2809 for the merged Grok CLI ACP provider shape
  • #1355 for Cursor ACP support
  • #2932 for prior shared ACP adapter exploration

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
  • [x] I explained what changed and why
  • [ ] I included before/after screenshots for any UI changes
  • [x] 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 0dacca14ecef5327da464deb6d5d32107969253a. 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.

Derpedyea avatar Jul 01 '26 23:07 Derpedyea

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.

coderabbitai[bot] avatar Jul 01 '26 23:07 coderabbitai[bot]

@coderabbitai review

Derpedyea avatar Jul 04 '26 03:07 Derpedyea

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

coderabbitai[bot] avatar Jul 04 '26 03:07 coderabbitai[bot]

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

Derpedyea avatar Jul 04 '26 04:07 Derpedyea

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.

macroscopeapp[bot] avatar Jul 04 '26 04:07 macroscopeapp[bot]

Forgot a few things and will fix tmrw

Derpedyea avatar Jul 05 '26 16:07 Derpedyea

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.

Derpedyea avatar Jul 05 '26 23:07 Derpedyea