feat(providers): add Devin CLI through ACP #11276
ClosedDerpedyea(GitHub profile, opens in a new tab)wants to merge 20 commits into
main fromrefs/pull/11276/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/server/src/provider/Layers/DevinAdapter.ts line 465Resolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +429,21 @@429+ ...(yield* stamp),430+ provider: PROVIDER,431+ threadId: input.threadId,432+ payload: { resume: result.initializeResult },433+ });434+ yield* emit({435+ type: "session.state.changed",436+ ...(yield* stamp),437+ provider: PROVIDER,438+ threadId: input.threadId,439+ payload: { state: "ready", reason: "Devin ACP session ready" },440+ });441+ yield* emit({442+ type: "thread.started",443+ ...(yield* stamp),444+ provider: PROVIDER,445+ threadId: input.threadId,446+ payload: { providerThreadId: result.sessionId },447+ });448+ yield* runtime.drainEvents;449+ return context.session;apps/server/src/provider/Drivers/DevinDriver.ts line 95OutdatedResolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +75,21 @@75+ const path = yield* Path.Path;76+ const serverSettings = yield* ServerSettingsService;77+ const eventLoggers = yield* ProviderEventLoggers;78+ const processEnv = mergeProviderInstanceEnvironment(environment);79+ const settings = { ...config, enabled };80+ const continuationIdentity = defaultProviderContinuationIdentity({81+ driverKind: DRIVER,82+ instanceId,83+ });84+ const stamp = withInstanceIdentity({85+ instanceId,86+ driverKind: DRIVER,87+ displayName,88+ accentColor,89+ continuationGroupKey: continuationIdentity.continuationKey,90+ });91+ const metadataChanges = yield* Effect.acquireRelease(92+ PubSub.unbounded<void>(),93+ PubSub.shutdown,94+ );95+ const commandsByCwd = new Map<string, ReadonlyArray<ServerProviderSlashCommand>>();apps/mobile/src/lib/modelOptions.ts line 78OutdatedResolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -75,4 +75,4 @@7575 const driver =7676 provider?.driver ?? config.settings?.providerInstances[selection.instanceId]?.driver;7777 return (78- driver === "antigravity" &&78+ (driver === "antigravity" || driver === "devin") &&
- apps/server/src/provider/Layers/DevinAdapter.ts line 347OutdatedResolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +327,21 @@327+ : undefined;328+ const previous = sessions.get(input.threadId);329+ if (previous) yield* stopContext(previous);330+ yield* checkDevinExecutable(settings, options.environment).pipe(331+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),332+ Effect.timeout("10 seconds"),333+ Effect.mapError((cause) => requestError("session/start", cause)),334+ );335+ const scope = yield* Scope.make();336+ const cwd = input.cwd ?? config.cwd;337+ const started = yield* Effect.gen(function* () {338+ const mcp = McpProviderSession.readMcpProviderSession(input.threadId);339+ const environment = McpProviderSession.withAgentDeviceEnvironment(340+ options.environment,341+ mcp,342+ );343+ const mcpConfig = mcp ? yield* prepareDevinMcp(mcp) : undefined;344+ const runtime = yield* makeDevinAcpRuntime(settings, environment, {345+ cwd,346+ resumeSessionId,347+ ...(mcpConfig ? { additionalDirectories: [mcpConfig.directory] } : {}),apps/server/src/provider/Drivers/DevinDriver.ts line 69Resolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +48,21 @@48+ }),49+ );50+const decodeSettings = Schema.decodeSync(DevinSettings);51+const maintenance = makeManualOnlyProviderMaintenanceCapabilities({52+ provider: DRIVER,53+ packageName: null,54+});55+56+export type DevinDriverEnv =57+ | BackgroundPolicy.BackgroundPolicy58+ | ChildProcessSpawner.ChildProcessSpawner59+ | Crypto.Crypto60+ | FileSystem.FileSystem61+ | Path.Path62+ | ProviderEventLoggers63+ | ServerConfig64+ | ServerSettingsService;65+66+export const DevinDriver: ProviderDriver<DevinSettings, DevinDriverEnv> = {67+ driverKind: DRIVER,68+ metadata: { displayName: "Devin", supportsMultipleInstances: true },
- apps/server/src/provider/Layers/DevinAdapter.ts lines 354 to 357Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +332,21 @@332+ yield* checkDevinExecutable(settings, options.environment).pipe(333+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),334+ Effect.timeout("10 seconds"),335+ Effect.mapError((cause) => requestError("session/start", cause)),336+ );337+ const scope = yield* Scope.make();338+ const cwd = input.cwd ?? config.cwd;339+ const started = yield* Effect.gen(function* () {340+ const mcp = McpProviderSession.readMcpProviderSession(input.threadId);341+ const environment = McpProviderSession.withAgentDeviceEnvironment(342+ options.environment,343+ mcp,344+ );345+ const mcpConfig = mcp ? yield* prepareDevinMcp(mcp) : undefined;346+ const runtime = yield* makeDevinAcpRuntime(settings, environment, {347+ cwd,348+ resumeSessionId,349+ additionalDirectories: [350+ config.attachmentsDir,351+ ...(mcpConfig ? [mcpConfig.directory] : []),352+ ],apps/server/src/provider/Layers/DevinAdapter.ts lines 459 to 463Resolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +438,21 @@438+ });439+ yield* emit({440+ type: "session.state.changed",441+ ...(yield* stamp),442+ provider: PROVIDER,443+ threadId: input.threadId,444+ payload: { state: "ready", reason: "Devin ACP session ready" },445+ });446+ yield* emit({447+ type: "thread.started",448+ ...(yield* stamp),449+ provider: PROVIDER,450+ threadId: input.threadId,451+ payload: { providerThreadId: result.sessionId },452+ });453+ yield* runtime.drainEvents;454+ if (context.stopped) {455+ return yield* new ProviderAdapterSessionClosedError({456+ provider: PROVIDER,457+ threadId: input.threadId,458+ });
- @@ -65,14 +68,14 @@65-export function isModelSelectionUnavailable(68+/** Explain how to recover a known account-model selection that is unavailable. */69+export function getModelSelectionUnavailableReason(6670 config: T3ServerConfig | null | undefined,6771 selection: ModelSelection | null | undefined,68-): boolean {72+): string | null {6973 if (!config || !selection) {70- return false;74+ return null;7175 }7276 const provider = config.providers.find(7377 (candidate) => candidate.instanceId === selection.instanceId,7478 );75- const driver =76- provider?.driver ?? config.settings?.providerInstances[selection.instanceId]?.driver;77- return (78- driver === "antigravity" &&79+ const instanceConfig = config.settings?.providerInstances[selection.instanceId];80+ if (81+ resolveProviderModelPolicy(provider ?? instanceConfig).catalogScope === "instance" &&apps/web/src/components/chat/FusionWave.css line 2OutdatedResolvedby Derpedyea(GitHub profile, opens in a new tab)@@ -0,0 +1,2 @@1+.fusion-wave-packets {2+ animation: fusion-wave-flow 5s linear infinite;
- apps/mobile/src/lib/modelOptions.ts lines 236 to 238OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -204,4 +233,6 @@204233 );205234 const instanceConfig = config?.settings?.providerInstances[fallbackModelSelection.instanceId];206235 const model = provider?.models.find(207- (candidate) => candidate.slug === fallbackModelSelection.model,236+ (candidate) =>237+ candidate.slug === fallbackModelSelection.model ||238+ candidate.aliases?.includes(fallbackModelSelection.model),apps/server/src/provider/Layers/DevinProvider.ts line 86OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +66,21 @@66+ if (environment.WINDSURF_API_KEY?.trim()) {67+ return {68+ installed: true,69+ version,70+ status: "ready",71+ auth: { status: "authenticated", type: "apiKey" },72+ } satisfies ProviderProbeResult;73+ }74+ const auth = yield* runDevinCommand(settings, environment, ["auth", "status"]);75+ const output = `${auth.stdout}\n${auth.stderr}`;76+ if (/not logged in|not authenticated/i.test(output)) {77+ return {78+ installed: true,79+ version,80+ status: "warning",81+ auth: { status: "unauthenticated" },82+ message:83+ "Run devin auth login with the configured CLI on this environment, then refresh provider status.",84+ } satisfies ProviderProbeResult;85+ }86+ if (auth.code === 0 && /logged in|authenticated/i.test(output)) {
Derpedyea(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.

















Codex Review Summary#
This comment shows the latest Codex review activity on this pull request.
91c662aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.