Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6623 feat(agent): add host-local Devin CLI over ACP (#7485)
David Zhange8fdcfd226d2
diff --git a/CLI_AND_DAEMON.md b/CLI_AND_DAEMON.mdindex d1cc8c6757..5a9e48c4a7 100644--- a/CLI_AND_DAEMON.md+++ b/CLI_AND_DAEMON.md@@ -287,6 +287,7 @@ The daemon auto-detects these AI CLIs on your PATH:| Kimi | `kimi` | Moonshot coding agent || [Reasonix](https://github.com/esengine/DeepSeek-Reasonix) | `reasonix` | DeepSeek-focused ACP coding agent (run `reasonix setup` first) || Dim | `dim` | DimCode ACP coding agent (speaks the ACP protocol via `dim acp`) |+| [Devin CLI](https://docs.devin.ai/cli/quickstart) | `devin` | Version 3000.3.22+. Host-local ACP (`devin acp`), not cloud Devin VMs. Run `devin auth login` first. || Kiro CLI | `kiro-cli` | Kiro ACP coding agent || [Qoder CLI](https://docs.qoder.com/) | `qodercli` | Qoder ACP coding agent || [Qoder CN CLI](https://help.aliyun.com/en/lingma/qodercli-cn/product-overview/what-is-qoder-cli-cn) | `qoderclicn` | Qoder CN ACP coding agent |@@ -404,6 +405,8 @@ Agent-specific overrides:| `MULTICA_REASONIX_MODEL` | Override the Reasonix model used || `MULTICA_DIM_PATH` | Custom path to the `dim` binary || `MULTICA_DIM_MODEL` | Override the Dim model used |+| `MULTICA_DEVIN_PATH` | Custom path to the `devin` binary |+| `MULTICA_DEVIN_MODEL` | Override the Devin model used || `MULTICA_KIRO_PATH` | Custom path to the `kiro-cli` binary || `MULTICA_KIRO_MODEL` | Override the Kiro model used || `MULTICA_QODER_PATH` | Custom path to the `qodercli` binary |diff --git a/apps/docs/components/demos/provider-picker-demo.tsx b/apps/docs/components/demos/provider-picker-demo.tsxindex ac9b5a3fc4..379fa49fb2 100644--- a/apps/docs/components/demos/provider-picker-demo.tsx+++ b/apps/docs/components/demos/provider-picker-demo.tsx@@ -31,6 +31,7 @@ const TOOLS: { name: string; resume: boolean; mcp: boolean; model: boolean }[] ={ name: "Kiro CLI", resume: true, mcp: true, model: true },{ name: "MiniMax Code", resume: false, mcp: true, model: false },{ name: "Muse Code", resume: true, mcp: false, model: true },+ { name: "Devin CLI", resume: true, mcp: true, model: true },{ name: "OpenClaw", resume: true, mcp: true, model: true },{ name: "OpenCode", resume: true, mcp: true, model: true },{ name: "Pi", resume: true, mcp: true, model: true },diff --git a/apps/docs/content/docs/install-agent-runtime.fr.mdx b/apps/docs/content/docs/install-agent-runtime.fr.mdxindex 8fcbe785e9..89d87fff68 100644--- a/apps/docs/content/docs/install-agent-runtime.fr.mdx+++ b/apps/docs/content/docs/install-agent-runtime.fr.mdx@@ -36,6 +36,7 @@ Multica détecte actuellement ces commandes :| Kiro CLI | `kiro-cli` | [Installer Kiro CLI](https://kiro.dev/docs/cli/installation/) || MiniMax Code | `mcode` | [Installer MiniMax Code CLI](https://www.npmjs.com/package/@minimax-ai/code) || Muse Code | `muse` | [Installer Muse Code](https://dev.meta.ai/docs/muse-code) |+| Devin CLI | `devin` | [Installer Devin CLI](https://docs.devin.ai/cli/quickstart) (3000.3.22+). ACP local ; exécuter d'abord `devin auth login` || OpenClaw | `openclaw` | [Installer OpenClaw](https://docs.openclaw.ai/install) || OpenCode | `opencode` | [Démarrage rapide d'OpenCode](https://opencode.ai/en/docs) || Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |diff --git a/apps/docs/content/docs/install-agent-runtime.ja.mdx b/apps/docs/content/docs/install-agent-runtime.ja.mdxindex 29a8da6ca6..dba65ed254 100644--- a/apps/docs/content/docs/install-agent-runtime.ja.mdx+++ b/apps/docs/content/docs/install-agent-runtime.ja.mdx@@ -36,6 +36,7 @@ Multica は現在、次のコマンドを検出します。| Kiro CLI | `kiro-cli` | [Kiro CLI のインストール](https://kiro.dev/docs/cli/installation/) || MiniMax Code | `mcode` | [MiniMax Code CLI のインストール](https://www.npmjs.com/package/@minimax-ai/code) || Muse Code | `muse` | [Muse Code のインストール](https://dev.meta.ai/docs/muse-code) |+| Devin CLI | `devin` | [Devin CLI のインストール](https://docs.devin.ai/cli/quickstart)(3000.3.22+)。ローカル ACP。先に `devin auth login` を実行 || OpenClaw | `openclaw` | [OpenClaw のインストール](https://docs.openclaw.ai/install) || OpenCode | `opencode` | [OpenCode クイックスタート](https://opencode.ai/en/docs) || Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |diff --git a/apps/docs/content/docs/install-agent-runtime.ko.mdx b/apps/docs/content/docs/install-agent-runtime.ko.mdxindex 2debe43f64..4de41dddbf 100644--- a/apps/docs/content/docs/install-agent-runtime.ko.mdx+++ b/apps/docs/content/docs/install-agent-runtime.ko.mdx@@ -36,6 +36,7 @@ Multica는 현재 다음 명령을 감지합니다.| Kiro CLI | `kiro-cli` | [Kiro CLI 설치](https://kiro.dev/docs/cli/installation/) || MiniMax Code | `mcode` | [MiniMax Code CLI 설치](https://www.npmjs.com/package/@minimax-ai/code) || Muse Code | `muse` | [Muse Code 설치](https://dev.meta.ai/docs/muse-code) |+| Devin CLI | `devin` | [Devin CLI 설치](https://docs.devin.ai/cli/quickstart) (3000.3.22+). 로컬 ACP이며 먼저 `devin auth login` 실행 || OpenClaw | `openclaw` | [OpenClaw 설치](https://docs.openclaw.ai/install) || OpenCode | `opencode` | [OpenCode 빠른 시작](https://opencode.ai/en/docs) || Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |diff --git a/apps/docs/content/docs/install-agent-runtime.mdx b/apps/docs/content/docs/install-agent-runtime.mdxindex cff102f820..1215f16bf3 100644--- a/apps/docs/content/docs/install-agent-runtime.mdx+++ b/apps/docs/content/docs/install-agent-runtime.mdx@@ -47,6 +47,7 @@ Multica currently detects these commands:| Reasonix | `reasonix` | [Reasonix](https://github.com/esengine/DeepSeek-Reasonix) || TRAE CLI | `traecli` | [TRAE official site](https://www.trae.cn/) || Dim | `dim` | [DimCode](https://dimagent.cn/en/docs/cli) |+| Devin CLI | `devin` | [Install Devin CLI](https://docs.devin.ai/cli/quickstart) || ZeroClaw | `zeroclaw` | [ZeroClaw quickstart](https://github.com/zeroclaw-labs/zeroclaw/blob/master/docs/book/src/getting-started/quickstart.md#install) |"Supported" means Multica can invoke that CLI. It does not mean Multica provides the tool's account, subscription, or model quota for you.@@ -73,6 +74,7 @@ Below the minimum version, the daemon does not register the corresponding runtim| MiniMax Code | 0.1.2 || OpenCode | 1.1.54 || Dim | 0.3.10 |+| Devin CLI | 3000.3.22 || ZeroClaw | 0.8.0 |A few tools need extra setup beyond signing in:@@ -97,6 +99,11 @@ Prefer a bundle your own team publishes or builds: this value is installed intoThe daemon registers DeepSeek Harness only after `dsh --profile multica --probe` succeeds, and reports the missing profile on `/health` when it does not.+</Accordion>+<Accordion title="Devin CLI" id="devin-cli">++Devin runs locally through `devin acp`, not cloud Devin VMs. Run `devin auth login` first. Multica checks the binary's version, not ACP's `agentInfo.version` (which can be `0.0.0-dev`).+</Accordion><Accordion title="MiniMax Code" id="minimax-code">diff --git a/apps/docs/content/docs/install-agent-runtime.zh.mdx b/apps/docs/content/docs/install-agent-runtime.zh.mdxindex 9ce62dbc5a..273d9a042a 100644--- a/apps/docs/content/docs/install-agent-runtime.zh.mdx+++ b/apps/docs/content/docs/install-agent-runtime.zh.mdx@@ -36,6 +36,7 @@ Multica 当前会检测以下命令:| Kiro CLI | `kiro-cli` | [安装 Kiro CLI](https://kiro.dev/docs/cli/installation/) || MiniMax Code | `mcode` | [安装 MiniMax Code CLI](https://www.npmjs.com/package/@minimax-ai/code) || Muse Code | `muse` | [安装 Muse Code](https://dev.meta.ai/docs/muse-code) |+| Devin CLI | `devin` | [安装 Devin CLI](https://docs.devin.ai/cli/quickstart)(3000.3.22+);本机 ACP,先运行 `devin auth login` || OpenClaw | `openclaw` | [安装 OpenClaw](https://docs.openclaw.ai/install) || OpenCode | `opencode` | [OpenCode 快速开始](https://opencode.ai/en/docs) || Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |diff --git a/apps/docs/content/docs/providers.fr.mdx b/apps/docs/content/docs/providers.fr.mdxindex 970c964ea1..82d6813a6d 100644--- a/apps/docs/content/docs/providers.fr.mdx+++ b/apps/docs/content/docs/providers.fr.mdx@@ -36,6 +36,7 @@ Les étapes d'installation se trouvent dans [Installer les outils de codage IA](| Kiro CLI | `kiro-cli` | ✓ | ✓ | ✓ | `.kiro/skills/` || MiniMax Code | `mcode` | — | ✓ | — | `.minimax/skills/` || Muse Code | `muse` | ✓ | — | ✓ | `.agents/skills/` |+| Devin CLI | `devin` | ✓ | ✓ | ✓ | `.devin/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | ✓ | ✓ | `.pi/skills/` |@@ -55,6 +56,12 @@ Pour les outils marqués — dans « Modèle choisi dans Multica », le modèle## Sources des modèles+Devin utilise ACP en local et prend en charge les serveurs MCP stdio. HTTP/SSE ne sont transmis que si le CLI annonce leur prise en charge. L'import des skills inclut aussi `~/.codeium/<channel>/skills` (`windsurf`, `windsurf-next`, `windsurf-insiders`), après les répertoires Devin/Cognition et avant `~/.agents/skills`.++Le catalogue Devin peut inclure des modèles indisponibles pour votre compte. Choisissez un identifiant complet, un nom de modèle de session ou un slug/alias de famille non ambigu (par exemple `opus`), ou laissez le champ vide pour le modèle par défaut. Multica confirme le modèle de session avant d'envoyer le prompt et refuse un repli vers une autre famille. Pour les noms ambigus, les noms partiels ou les variantes indisponibles, utilisez un identifiant complet. L'usage est attribué au modèle retourné ; Adaptive reste associé à son identifiant de routage, sans déduire le modèle sous-jacent.++Devin utilise `WINDSURF_API_KEY` s'il est défini, sinon les identifiants enregistrés par `devin auth login`. Une méthode d'authentification ACP inconnue ne bloque pas cette connexion. Multica conserve le mode de session configuré sans augmenter les permissions : si le mode par défaut est `plan`, passez à un mode d'édition dans Devin avant d'envoyer une tâche qui modifie des fichiers.+Lorsque vous créez un agent, la liste des modèles provient du runtime correspondant. Certains outils exposent un ensemble fixe de noms de modèles ; d'autres renvoient les modèles disponibles selon la configuration locale, le compte connecté et les droits de l'abonnement.Si vous ne choisissez pas de modèle, Multica utilise le modèle par défaut de l'outil. Si la liste est vide, vérifiez que le runtime est en ligne et que l'outil est connecté, puis actualisez la liste des modèles.diff --git a/apps/docs/content/docs/providers.ja.mdx b/apps/docs/content/docs/providers.ja.mdxindex ca0cb0371d..ada8b8690e 100644--- a/apps/docs/content/docs/providers.ja.mdx+++ b/apps/docs/content/docs/providers.ja.mdx@@ -36,6 +36,7 @@ Multica は、普段使っている AI コーディングツールの代わり| Kiro CLI | `kiro-cli` | ✓ | ✓ | ✓ | `.kiro/skills/` || MiniMax Code | `mcode` | — | ✓ | — | `.minimax/skills/` || Muse Code | `muse` | ✓ | — | ✓ | `.agents/skills/` |+| Devin CLI | `devin` | ✓ | ✓ | ✓ | `.devin/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | ✓ | ✓ | `.pi/skills/` |@@ -55,6 +56,12 @@ Multica は、普段使っている AI コーディングツールの代わり## モデルの取得元+Devin はローカル ACP で動作し、stdio MCP に対応します。HTTP/SSE は CLI が対応を宣言した場合のみ渡されます。skill のインポートは Devin/Cognition のディレクトリに続き、`~/.codeium/<channel>/skills`(`windsurf`、`windsurf-next`、`windsurf-insiders` の順)、最後に `~/.agents/skills` も検索します。++Devin のモデル一覧にはアカウントで利用できないモデルも含まれます。完全なモデル ID、一意なセッションモデル名やカタログのファミリー slug/別名(例:`opus`)を選ぶか、空欄で CLI のデフォルトを使ってください。Multica は送信前に実際のモデルを確認し、別ファミリーへのフォールバックを拒否します。曖昧な名前、任意の部分名、利用できないバリアントには完全な ID を指定してください。使用量は返されたモデルに帰属し、Adaptive はルーティング ID のまま記録します。基盤モデルは推測しません。++Devin は `WINDSURF_API_KEY` があれば使用し、なければ `devin auth login` の保存済み認証情報を使います。未知の ACP 認証方式でも保存済みログインを妨げません。Multica は権限を引き上げず、設定されたセッションモードを維持します。デフォルトが `plan` の場合、ファイルを変更するタスクの前に Devin で編集可能なモードに切り替えてください。+エージェントを作成するとき、モデル一覧は対応するランタイムから取得されます。固定されたモデル名を提供するツールもあれば、ローカル設定、ログイン中のアカウント、サブスクリプションに応じて利用可能なモデルを返すツールもあります。モデルを選択しない場合、Multica はそのツールのデフォルト設定を使用します。一覧が空の場合は、ランタイムがオンラインでツールにログイン済みであることを確認してから、モデル一覧を更新してください。diff --git a/apps/docs/content/docs/providers.ko.mdx b/apps/docs/content/docs/providers.ko.mdxindex 81a0bec16d..e260e2166d 100644--- a/apps/docs/content/docs/providers.ko.mdx+++ b/apps/docs/content/docs/providers.ko.mdx@@ -36,6 +36,7 @@ Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타| Kiro CLI | `kiro-cli` | ✓ | ✓ | ✓ | `.kiro/skills/` || MiniMax Code | `mcode` | — | ✓ | — | `.minimax/skills/` || Muse Code | `muse` | ✓ | — | ✓ | `.agents/skills/` |+| Devin CLI | `devin` | ✓ | ✓ | ✓ | `.devin/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | ✓ | ✓ | `.pi/skills/` |@@ -55,6 +56,12 @@ Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타## 모델 출처+Devin은 로컬 ACP로 실행되며 stdio MCP를 지원합니다. HTTP/SSE는 CLI가 지원을 선언한 경우에만 전달됩니다. skill 가져오기는 Devin/Cognition 디렉터리 다음에 `~/.codeium/<channel>/skills`(`windsurf`, `windsurf-next`, `windsurf-insiders` 순), 마지막으로 `~/.agents/skills`를 검색합니다.++Devin 모델 목록에는 계정에서 사용할 수 없는 모델도 포함될 수 있습니다. 전체 모델 ID, 명확한 세션 모델 이름 또는 카탈로그의 계열 slug/별칭(예: `opus`)을 선택하거나 비워 두어 CLI 기본 모델을 사용하세요. Multica는 전송 전에 실제 모델을 확인하고 다른 계열로의 대체를 거부합니다. 모호한 이름, 임의의 부분 이름, 사용할 수 없는 변형은 전체 ID로 지정하세요. 사용량은 반환된 모델에 귀속되며 Adaptive는 라우팅 ID로 기록합니다. 하위 모델은 추측하지 않습니다.++Devin은 `WINDSURF_API_KEY`가 있으면 사용하고, 없으면 `devin auth login`으로 저장한 인증 정보를 사용합니다. 알 수 없는 ACP 인증 방식도 저장된 로그인을 막지 않습니다. Multica는 권한을 높이지 않고 설정된 세션 모드를 유지합니다. 기본값이 `plan`이면 파일을 수정하는 태스크를 보내기 전에 Devin에서 편집 가능한 모드로 바꾸세요.+에이전트를 만들 때 모델 목록은 해당 런타임에서 가져옵니다. 일부 도구는 고정된 모델 이름을 제공하고, 일부는 로컬 설정, 로그인 계정, 구독 권한에 따라 사용 가능한 모델을 반환합니다.모델을 선택하지 않으면 Multica가 해당 도구의 기본 설정을 사용합니다. 목록이 비어 있다면 런타임이 온라인이고 도구에 로그인되어 있는지 확인한 뒤 모델 목록을 새로 고치세요.diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdxindex 09b96efbbb..400edc27da 100644--- a/apps/docs/content/docs/providers.mdx+++ b/apps/docs/content/docs/providers.mdx@@ -36,6 +36,7 @@ Install steps are in [Install AI coding tools](/install-agent-runtime).| Kiro CLI | `kiro-cli` | ✓ | ✓ | ✓ | `.kiro/skills/` || MiniMax Code | `mcode` | — | ✓ | — | `.minimax/skills/` || Muse Code | `muse` | ✓ | — | ✓ | `.agents/skills/` |+| Devin CLI | `devin` | ✓ | ✓ | ✓ | `.devin/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | ✓ | ✓ | `.pi/skills/` |@@ -53,12 +54,18 @@ Install steps are in [Install AI coding tools](/install-agent-runtime).Tools with — under "Model picked in Multica" take their model from their own configuration; see [Model sources](#model-sources).+Devin supports stdio MCP servers; HTTP/SSE entries are passed only if the CLI advertises support. Devin skills are imported from `$XDG_CONFIG_HOME/devin/skills` (default `~/.config/devin/skills`) or `%APPDATA%\devin\skills` on Windows, then the legacy `cognition/skills` root, then `~/.codeium/<channel>/skills` (`windsurf`, `windsurf-next`, `windsurf-insiders`, in that order), and finally `~/.agents/skills`. On duplicate skill keys, the first root wins for both listing and import.+## Model sourcesWhen you create an agent, the model list comes from the corresponding runtime. Some tools expose a fixed set of model names; others return available models based on local configuration, the signed-in account, and subscription entitlements.If you do not pick a model, Multica uses the tool's own default. If the list is empty, confirm the runtime is online and the tool is signed in, then refresh the model list.+Devin's catalog can include models unavailable to your account. Choose a canonical model ID, an unambiguous session model name or catalog family slug/alias (such as `opus`), or leave the model empty for the CLI default. Multica confirms the actual session model before sending the prompt; a fallback to another family is rejected. Ambiguous names, arbitrary partial names, or unavailable variants require a canonical ID rather than a guessed match. Usage is attributed to the reported model, not the launch flag. Adaptive usage stays under the reported Adaptive routing ID, not an inferred underlying model.++Devin reads `WINDSURF_API_KEY` when set, otherwise the login saved by `devin auth login`; unknown ACP auth methods do not block that stored login. Multica preserves Devin's configured session mode rather than raising permissions. If it defaults to `plan`, switch to an editing mode in Devin before dispatching work that must change files.+QwenPaw, MiniMax Code, and ZeroClaw are exceptions: they do not accept a model chosen from Multica, so the picker is inert and shows "Managed by runtime". Choose the model in the tool's own configuration instead. An empty model list for these tools is expected and does not mean the runtime is offline.DeepSeek Harness advertises its model catalog from the runtime itself (`dsh --profile multica --list-models`). Its model ids use the `provider/model` form (for example `deepseek-official/deepseek-chat`), so select the full id from the list.diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdxindex b3aabbca19..38e6148321 100644--- a/apps/docs/content/docs/providers.zh.mdx+++ b/apps/docs/content/docs/providers.zh.mdx@@ -36,6 +36,7 @@ Multica 不替代你在用的 AI 编程工具:运行时调用电脑上已经| Kiro CLI | `kiro-cli` | ✓ | ✓ | ✓ | `.kiro/skills/` || MiniMax Code | `mcode` | — | ✓ | — | `.minimax/skills/` || Muse Code | `muse` | ✓ | — | ✓ | `.agents/skills/` |+| Devin CLI | `devin` | ✓ | ✓ | ✓ | `.devin/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | ✓ | ✓ | `.pi/skills/` |@@ -55,6 +56,12 @@ Multica 不替代你在用的 AI 编程工具:运行时调用电脑上已经## 模型来源+Devin 通过本机 ACP 运行,支持 stdio MCP;只有 CLI 声明支持时才会传入 HTTP/SSE 配置。全局 skill 依次从 `$XDG_CONFIG_HOME/devin/skills`(默认 `~/.config/devin/skills`,Windows 为 `%APPDATA%\devin\skills`)、旧版 `cognition/skills`、`~/.codeium/<channel>/skills`(依次为 `windsurf`、`windsurf-next`、`windsurf-insiders`)和 `~/.agents/skills` 导入。同名 skill 在列表和导入时都以前面的目录为准。++Devin 模型列表可能包含当前账号无权使用的模型。可以选择完整模型 ID、无歧义的会话模型名称或目录中的系列 slug/别名(如 `opus`),也可以留空使用 CLI 默认模型。Multica 会在发送任务前确认实际模型,拒绝回退到其他系列;有歧义的名称、任意截断名称或不可用的变体需要改选完整 ID,不会猜测匹配。用量按实际返回的模型归属;Adaptive 按返回的 Adaptive 路由 ID 记录,不推测底层模型。++Devin 优先读取 `WINDSURF_API_KEY`,否则使用 `devin auth login` 保存的凭据;未知的 ACP 认证方式不会阻断已保存的登录。Multica 保留 Devin 配置的会话模式,不自动提升权限。如果默认为 `plan`,请先在 Devin 中切换到可编辑模式,再派发需要修改文件的任务。+创建智能体时,模型列表来自对应的运行时。有的工具给出固定的模型名称,有的按本机配置、登录账号和订阅权益返回可用模型。不选择模型时,Multica 使用该工具的默认设置。列表为空时,先确认运行时在线并且工具已经登录,再刷新模型列表。diff --git a/apps/web/features/landing/i18n/en.ts b/apps/web/features/landing/i18n/en.tsindex 6ecdcd0106..e310333f75 100644--- a/apps/web/features/landing/i18n/en.ts+++ b/apps/web/features/landing/i18n/en.ts@@ -104,7 +104,7 @@ export function createEnDict(label: "RUNTIMES",title: "One dashboard for all your compute",description:- "Local daemons and cloud runtimes, managed from a single panel. Real-time monitoring of online/offline status, usage charts, and activity heatmaps. Auto-detects 27 supported coding tools on your machine.",+ "Local daemons and cloud runtimes, managed from a single panel. Real-time monitoring of online/offline status, usage charts, and activity heatmaps. Auto-detects 28 supported coding tools on your machine.",cards: [{title: "Unified runtime panel",@@ -119,7 +119,7 @@ export function createEnDict({title: "Auto-detection on first run",description:- "Multica scans for 27 supported coding tools \u2014 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, and ZeroClaw \u2014 and registers a runtime for each one it finds.",+ "Multica scans for 28 supported coding tools \u2014 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Devin CLI, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, and ZeroClaw \u2014 and registers a runtime for each one it finds.",},],},@@ -139,7 +139,7 @@ export function createEnDict({title: "Install the CLI & connect your machine",description:- "Run multica setup \u2014 it walks you through OAuth, starts the daemon, and scans for the 27 supported coding tools (Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw). Whichever ones you already have installed get registered as runtimes automatically.",+ "Run multica setup \u2014 it walks you through OAuth, starts the daemon, and scans for the 28 supported coding tools (Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Devin CLI, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw). Whichever ones you already have installed get registered as runtimes automatically.",},{title: "Create your first agent",@@ -196,7 +196,7 @@ export function createEnDict({question: "What coding agents does Multica support?",answer:- "Multica supports 27 coding tools out of the box: Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, and ZeroClaw. The daemon auto-detects whichever CLIs you already have installed and registers a runtime for each one. Since the source code is public, you can also add your own backends. Self-hosted deployments can also configure Qoder Cloud Agents as a managed remote runtime for issue runs, using a QCA PAT and an existing QCA agent.",+ "Multica supports 28 coding tools out of the box: Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Devin CLI, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, and ZeroClaw. The daemon auto-detects whichever CLIs you already have installed and registers a runtime for each one. Since the source code is public, you can also add your own backends. Self-hosted deployments can also configure Qoder Cloud Agents as a managed remote runtime for issue runs, using a QCA PAT and an existing QCA agent.",},{question: "Do I need to self-host, or is there a cloud version?",diff --git a/apps/web/features/landing/i18n/ja.ts b/apps/web/features/landing/i18n/ja.tsindex f913b3d208..05a34a1c47 100644--- a/apps/web/features/landing/i18n/ja.ts+++ b/apps/web/features/landing/i18n/ja.ts@@ -121,7 +121,7 @@ export function createJaDict({title: "初回起動時に自動検出",description:- "Multica は Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw という27種類の対応ツールをスキャンし、見つかったものをそれぞれランタイムとして登録します。",+ "Multica は Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Devin CLI、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw という28種類の対応ツールをスキャンし、見つかったものをそれぞれランタイムとして登録します。",},],},@@ -142,7 +142,7 @@ export function createJaDict({title: "CLI をインストールしてマシンを接続",description:- "multica setup を実行すると、OAuth の手順を案内し、デーモンを起動し、27種類の対応コーディングツール(Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw)をスキャンします。すでにインストール済みのものは、自動的にランタイムとして登録されます。",+ "multica setup を実行すると、OAuth の手順を案内し、デーモンを起動し、28種類の対応コーディングツール(Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Devin CLI、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw)をスキャンします。すでにインストール済みのものは、自動的にランタイムとして登録されます。",},{title: "最初のエージェントを作成",@@ -197,7 +197,7 @@ export function createJaDict({question: "Multica はどのコーディングエージェントに対応していますか?",answer:- "Multica は、Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw の27種類のコーディングツールに標準対応しています。デーモンが、すでにインストール済みの CLI を自動検出し、それぞれをランタイムとして登録します。ソースコードが公開されているので、独自のバックエンドを追加することもできます。 セルフホストでは、QCA PAT と既存の QCA エージェントを使い、タスク実行用のマネージドリモートランタイムとして Qoder Cloud Agents を設定できます。",+ "Multica は、Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Devin CLI、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw の28種類のコーディングツールに標準対応しています。デーモンが、すでにインストール済みの CLI を自動検出し、それぞれをランタイムとして登録します。ソースコードが公開されているので、独自のバックエンドを追加することもできます。 セルフホストでは、QCA PAT と既存の QCA エージェントを使い、タスク実行用のマネージドリモートランタイムとして Qoder Cloud Agents を設定できます。",},{question: "セルフホストが必須ですか、それともクラウド版もありますか?",diff --git a/apps/web/features/landing/i18n/ko.ts b/apps/web/features/landing/i18n/ko.tsindex b32f1844e5..618f664539 100644--- a/apps/web/features/landing/i18n/ko.ts+++ b/apps/web/features/landing/i18n/ko.ts@@ -121,7 +121,7 @@ export function createKoDict({title: "처음 실행할 때 자동 등록",description:- "Multica는 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw 등 27개 지원 도구를 스캔해 이미 설치된 것을 런타임으로 자동 등록합니다.",+ "Multica는 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Devin CLI, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw 등 28개 지원 도구를 스캔해 이미 설치된 것을 런타임으로 자동 등록합니다.",},],},@@ -197,7 +197,7 @@ export function createKoDict({question: "Multica는 어떤 코딩 에이전트를 지원하나요?",answer:- "Multica는 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw 등 27개 코딩 도구를 기본 지원합니다. 데몬이 이미 설치된 CLI를 자동으로 찾아 각각 런타임으로 등록합니다. 소스 코드가 공개되어 있으므로 직접 백엔드를 추가할 수도 있습니다. 셀프 호스팅에서는 QCA PAT와 기존 QCA 에이전트를 사용하여 태스크 실행용 관리형 원격 런타임으로 Qoder Cloud Agents를 설정할 수 있습니다.",+ "Multica는 Antigravity, Claude Code, CodeBuddy, CodeArts, Codex, Copilot, Cursor, DeepSeek Harness, DevEco Code, Devin CLI, Dim, Grok, Hermes, Kimi, Kiro CLI, MiniMax Code, Muse Code, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI, ZeroClaw 등 28개 코딩 도구를 기본 지원합니다. 데몬이 이미 설치된 CLI를 자동으로 찾아 각각 런타임으로 등록합니다. 소스 코드가 공개되어 있으므로 직접 백엔드를 추가할 수도 있습니다. 셀프 호스팅에서는 QCA PAT와 기존 QCA 에이전트를 사용하여 태스크 실행용 관리형 원격 런타임으로 Qoder Cloud Agents를 설정할 수 있습니다.",},{question: "셀프 호스팅만 가능한가요, 클라우드 버전도 있나요?",diff --git a/apps/web/features/landing/i18n/zh.ts b/apps/web/features/landing/i18n/zh.tsindex a77d373ad9..38e0f82ba8 100644--- a/apps/web/features/landing/i18n/zh.ts+++ b/apps/web/features/landing/i18n/zh.ts@@ -104,7 +104,7 @@ export function createZhDict(label: "\u8fd0\u884c\u65f6",title: "\u4e00\u4e2a\u63a7\u5236\u53f0\u7ba1\u7406\u6240\u6709\u7b97\u529b",description:- "\u672c\u5730\u5b88\u62a4\u8fdb\u7a0b\u548c\u4e91\u7aef\u8fd0\u884c\u65f6\uff0c\u5728\u540c\u4e00\u4e2a\u9762\u677f\u4e2d\u7ba1\u7406\u3002\u5b9e\u65f6\u76d1\u63a7\u5728\u7ebf/\u79bb\u7ebf\u72b6\u6001\u3001\u4f7f\u7528\u91cf\u56fe\u8868\u548c\u6d3b\u52a8\u70ed\u529b\u56fe\u3002\u81ea\u52a8\u68c0\u6d4b\u672c\u673a\u5df2\u5b89\u88c5\u7684 27 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u3002",+ "\u672c\u5730\u5b88\u62a4\u8fdb\u7a0b\u548c\u4e91\u7aef\u8fd0\u884c\u65f6\uff0c\u5728\u540c\u4e00\u4e2a\u9762\u677f\u4e2d\u7ba1\u7406\u3002\u5b9e\u65f6\u76d1\u63a7\u5728\u7ebf/\u79bb\u7ebf\u72b6\u6001\u3001\u4f7f\u7528\u91cf\u56fe\u8868\u548c\u6d3b\u52a8\u70ed\u529b\u56fe\u3002\u81ea\u52a8\u68c0\u6d4b\u672c\u673a\u5df2\u5b89\u88c5\u7684 28 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u3002",cards: [{title: "\u7edf\u4e00\u8fd0\u884c\u65f6\u9762\u677f",@@ -119,7 +119,7 @@ export function createZhDict({title: "\u9996\u6b21\u542f\u52a8\u81ea\u52a8\u6ce8\u518c",description:- "Multica \u626b\u63cf\u672c\u673a\u7684 27 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u2014\u2014Antigravity\u3001Claude Code\u3001CodeBuddy\u3001CodeArts\u3001Codex\u3001Copilot\u3001Cursor\u3001DeepSeek Harness\u3001DevEco Code\u3001Dim\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001MiniMax Code\u3001Muse Code\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\u3001ZeroClaw\u2014\u2014\u5e76\u4e3a\u6bcf\u6b3e\u5df2\u5b89\u88c5\u7684\u5de5\u5177\u6ce8\u518c\u4e00\u4e2a\u8fd0\u884c\u65f6\u3002",+ "Multica \u626b\u63cf\u672c\u673a\u7684 28 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u2014\u2014Antigravity\u3001Claude Code\u3001CodeBuddy\u3001CodeArts\u3001Codex\u3001Copilot\u3001Cursor\u3001DeepSeek Harness\u3001DevEco Code\u3001Devin CLI\u3001Dim\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001MiniMax Code\u3001Muse Code\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\u3001ZeroClaw\u2014\u2014\u5e76\u4e3a\u6bcf\u6b3e\u5df2\u5b89\u88c5\u7684\u5de5\u5177\u6ce8\u518c\u4e00\u4e2a\u8fd0\u884c\u65f6\u3002",},],},@@ -139,7 +139,7 @@ export function createZhDict({title: "\u5b89\u88c5 CLI \u5e76\u8fde\u63a5\u4f60\u7684\u673a\u5668",description:- "运行 multica setup——它会引导你完成 OAuth 登录、启动守护进程、并扫描 27 款支持的 AI 编程工具(Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw)。本机已安装的工具会被自动注册成运行时。",+ "运行 multica setup——它会引导你完成 OAuth 登录、启动守护进程、并扫描 28 款支持的 AI 编程工具(Antigravity、Claude Code、CodeBuddy、CodeArts、Codex、Copilot、Cursor、DeepSeek Harness、DevEco Code、Devin CLI、Dim、Grok、Hermes、Kimi、Kiro CLI、MiniMax Code、Muse Code、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI、ZeroClaw)。本机已安装的工具会被自动注册成运行时。",},{title: "\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2a 智能体",@@ -196,7 +196,7 @@ export function createZhDict({question: "Multica \u652f\u6301\u54ea\u4e9b\u7f16\u7801 智能体\uff1f",answer:- "Multica \u5f00\u7bb1\u5373\u7528\u652f\u6301 27 \u6b3e AI \u7f16\u7a0b\u5de5\u5177\uff1aAntigravity\u3001Claude Code\u3001CodeBuddy\u3001CodeArts\u3001Codex\u3001Copilot\u3001Cursor\u3001DeepSeek Harness\u3001DevEco Code\u3001Dim\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001MiniMax Code\u3001Muse Code\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\u3001ZeroClaw\u3002\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u81ea\u52a8\u68c0\u6d4b\u672c\u673a\u5df2\u5b89\u88c5\u7684 CLI \u5e76\u4e3a\u6bcf\u6b3e\u6ce8\u518c\u4e00\u4e2a\u8fd0\u884c\u65f6\u3002因为源码公开,你也可以自己添加后端。 自托管部署还可以使用 QCA PAT 和已有 QCA 智能体,将 Qoder Cloud Agents 配置为执行任务的托管远端运行时。",+ "Multica \u5f00\u7bb1\u5373\u7528\u652f\u6301 28 \u6b3e AI \u7f16\u7a0b\u5de5\u5177\uff1aAntigravity\u3001Claude Code\u3001CodeBuddy\u3001CodeArts\u3001Codex\u3001Copilot\u3001Cursor\u3001DeepSeek Harness\u3001DevEco Code\u3001Devin CLI\u3001Dim\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001MiniMax Code\u3001Muse Code\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\u3001ZeroClaw\u3002\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u81ea\u52a8\u68c0\u6d4b\u672c\u673a\u5df2\u5b89\u88c5\u7684 CLI \u5e76\u4e3a\u6bcf\u6b3e\u6ce8\u518c\u4e00\u4e2a\u8fd0\u884c\u65f6\u3002因为源码公开,你也可以自己添加后端。 自托管部署还可以使用 QCA PAT 和已有 QCA 智能体,将 Qoder Cloud Agents 配置为执行任务的托管远端运行时。",},{question: "\u9700\u8981\u81ea\u6258\u7ba1\u5417\uff0c\u8fd8\u662f\u6709\u4e91\u7248\u672c\uff1f",diff --git a/packages/core/agents/mcp-support.test.ts b/packages/core/agents/mcp-support.test.tsindex 24e180f7b0..ca590579b2 100644--- a/packages/core/agents/mcp-support.test.ts+++ b/packages/core/agents/mcp-support.test.ts@@ -5,6 +5,7 @@ import { providerSupportsMcpConfig } from "./mcp-support";describe("providerSupportsMcpConfig", () => {it("accepts a provider whose runtime consumes mcp_config", () => {expect(providerSupportsMcpConfig("claude")).toBe(true);+ expect(providerSupportsMcpConfig("devin")).toBe(true);});it("rejects providers whose runtime ignores mcp_config", () => {expect(providerSupportsMcpConfig("antigravity")).toBe(false);diff --git a/packages/core/agents/mcp-support.ts b/packages/core/agents/mcp-support.tsindex d1e150fb78..7b244a2900 100644--- a/packages/core/agents/mcp-support.ts+++ b/packages/core/agents/mcp-support.ts@@ -25,6 +25,7 @@ const MCP_SUPPORTED_PROVIDERS = new Set(["qwen","qwenpaw","mcode",+ "devin","traecli","dim","omp",diff --git a/packages/core/types/agent.ts b/packages/core/types/agent.tsindex a4a38650a0..8106f0907a 100644--- a/packages/core/types/agent.ts+++ b/packages/core/types/agent.ts@@ -131,6 +131,7 @@ export const RUNTIME_PROFILE_PROTOCOL_FAMILIES = ["qwenpaw","mcode","muse",+ "devin","zeroclaw",] as const;diff --git a/packages/views/runtimes/components/provider-logo.tsx b/packages/views/runtimes/components/provider-logo.tsxindex 5d3f4592ae..979a4c107a 100644--- a/packages/views/runtimes/components/provider-logo.tsx+++ b/packages/views/runtimes/components/provider-logo.tsx@@ -412,6 +412,8 @@ export function ProviderLogo({return <HermesLogo className={className} />;case "pi":return <PiLogo className={className} />;+ case "devin":+ return <Monitor className={className} />;case "omp":return <PiLogo className={className} />;case "copilot":diff --git a/packages/views/runtimes/components/runtime-profiles-dialog.test.tsx b/packages/views/runtimes/components/runtime-profiles-dialog.test.tsxindex 6a4cfe45f9..0593b20791 100644--- a/packages/views/runtimes/components/runtime-profiles-dialog.test.tsx+++ b/packages/views/runtimes/components/runtime-profiles-dialog.test.tsx@@ -205,6 +205,26 @@ describe("RuntimeProfilesDialog", () => {);});+ it("creates a custom Devin runtime from the protocol picker", async () => {+ renderDialog({ intent: "create" });+ fireEvent.click(screen.getByRole("button", { name: /^devin$/i }));+ fireEvent.change(screen.getByLabelText("Display name"), {+ target: { value: "Team Devin" },+ });+ fireEvent.change(screen.getByLabelText("Command"), {+ target: { value: "team-devin" },+ });+ fireEvent.click(screen.getByRole("button", { name: "Create runtime" }));+ await waitFor(() =>+ expect(mutationState.createProfile).toHaveBeenCalledWith({+ display_name: "Team Devin",+ runtime_type: "devin",+ command_name: "team-devin",+ fixed_args: [],+ }),+ );+ });+it("parses a pasted command line into fixed_args on create", async () => {renderDialog();diff --git a/scripts/agent-cli-command-names.txt b/scripts/agent-cli-command-names.txtindex c8893f36fd..92a79c0677 100644--- a/scripts/agent-cli-command-names.txt+++ b/scripts/agent-cli-command-names.txt@@ -6,6 +6,7 @@ codexcopilotcursor-agentdeveco+devindimdshgrokdiff --git a/server/internal/daemon/agents_probe.go b/server/internal/daemon/agents_probe.goindex 3393e30a3a..061085f170 100644--- a/server/internal/daemon/agents_probe.go+++ b/server/internal/daemon/agents_probe.go@@ -275,6 +275,9 @@ var probeAgentCLIs = func() map[string]AgentEntry {if e, ok := probe("MULTICA_MUSE_PATH", "muse", "MULTICA_MUSE_MODEL"); ok {agents["muse"] = e}+ if e, ok := probe("MULTICA_DEVIN_PATH", "devin", "MULTICA_DEVIN_MODEL"); ok {+ agents["devin"] = e+ }// Qoder CLI ships as the `qodercli` binary (Qoder Desktop does not put it// on PATH; users install it separately, often via an npm global prefix).// It must go through probe() like every other provider so the login-shelldiff --git a/server/internal/daemon/agents_probe_devin_test.go b/server/internal/daemon/agents_probe_devin_test.gonew file mode 100644index 0000000000..95d893fd5a--- /dev/null+++ b/server/internal/daemon/agents_probe_devin_test.go@@ -0,0 +1,52 @@+package daemon++import (+ "context"+ "path/filepath"+ "runtime"+ "testing"++ "github.com/multica-ai/multica/server/pkg/agent"+)++func TestProbeAgentCLIsDiscoversNativeDevin(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("POSIX executable fixture")+ }+ dir := t.TempDir()+ writeDaemonTestExecutable(t, filepath.Join(dir, "devin"), []byte("#!/bin/sh\nexit 0\n"))+ orig := resolveAgentsViaLoginShell+ t.Cleanup(func() { resolveAgentsViaLoginShell = orig })+ resolveAgentsViaLoginShell = func([]string) map[string]string { return map[string]string{} }+ resetShellResolveCacheForTest(t)+ t.Setenv("PATH", dir)+ t.Setenv("MULTICA_DEVIN_PATH", "")+ t.Setenv("MULTICA_DEVIN_MODEL", "selected-model")+ entry, ok := probeAgentCLIs()["devin"]+ if !ok || entry.Command != "devin" || entry.Model != "selected-model" {+ t.Fatalf("Devin not discovered as a native family: %+v ok=%v", entry, ok)+ }+ if providerDisplayName("devin") != "Devin" || agent.IsBuiltinRuntime("devin") {+ t.Fatal("Devin must be a native protocol family, not a self-referencing builtin descriptor")+ }+}++func TestDevinRegistrationUsesBinaryVersionGate(t *testing.T) {+ for _, tc := range []struct {+ version string+ allowed bool+ }{+ {"3000.3.21", false}, {"3000.3.22", true}, {"3000.10.21", true}, {"0.0.0-dev", false},+ } {+ t.Run(tc.version, func(t *testing.T) {+ fx := newBatchFixture(t)+ fx.probeVersion = tc.version+ checkAgentMinVersion = agent.CheckMinVersion+ fx.daemon.cfg.Agents = map[string]AgentEntry{"devin": {Path: "/fake/devin", Command: "devin"}}+ runtimes, belowMin, _ := fx.daemon.detectBuiltinRuntimes(context.Background())+ if (len(runtimes) == 1) != tc.allowed || (len(belowMin) == 0) != tc.allowed {+ t.Fatalf("version %s: runtimes=%v belowMin=%v", tc.version, runtimes, belowMin)+ }+ })+ }+}diff --git a/server/internal/daemon/config.go b/server/internal/daemon/config.goindex d90b46c1e4..d773b7636e 100644--- a/server/internal/daemon/config.go+++ b/server/internal/daemon/config.go@@ -266,7 +266,7 @@ func LoadConfig(overrides Overrides) (Config, error) {// can re-run the same discovery on a live daemon (MUL-5439).agents := probeAgentCLIs()if len(agents) == 0 && !overrides.AllowNoAgents {- return Config{}, fmt.Errorf("no agent CLI found: install claude, codebuddy, codearts, codex, copilot, opencode, deveco, openclaw, hermes, pi, omp, cursor-agent, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, qwenpaw, mcode, muse, dim, or zeroclaw and ensure it is on PATH")+ return Config{}, fmt.Errorf("no agent CLI found: install claude, codebuddy, codearts, codex, copilot, opencode, deveco, openclaw, hermes, pi, omp, cursor-agent, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, qwenpaw, mcode, muse, devin, dim, or zeroclaw and ensure it is on PATH")}claudeArgs, err := shellArgsFromEnv("MULTICA_CLAUDE_ARGS")@@ -974,7 +974,7 @@ func isExecutableFile(path string) bool {// doesn't require editing this list by hand.var defaultAgentCommandNames = append([]string{"claude", "codex", "opencode", "codearts", "deveco", "openclaw", "hermes",- "pi", "cursor-agent", "copilot", "kimi", "reasonix", "dsh", "kiro-cli", "codebuddy", "agy", "qodercli", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw", "mcode", "muse", "dim", "zeroclaw",+ "pi", "cursor-agent", "copilot", "kimi", "reasonix", "dsh", "kiro-cli", "codebuddy", "agy", "qodercli", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw", "mcode", "muse", "devin", "dim", "zeroclaw",}, agent.BuiltinRuntimeCommands()...)// codexDesktopAppBundlePaths returns candidate macOS app-bundle locations fordiff --git a/server/internal/daemon/execenv/context.go b/server/internal/daemon/execenv/context.goindex ac748c9a31..2b5a47bd49 100644--- a/server/internal/daemon/execenv/context.go+++ b/server/internal/daemon/execenv/context.go@@ -413,6 +413,8 @@ func skillsDirPath(workDir, provider string) string {case "mcode":// MiniMax Code discovers project-level skills from .minimax/skills/.return filepath.Join(workDir, ".minimax", "skills")+ case "devin":+ return filepath.Join(workDir, ".devin", "skills")case "muse":// Muse's native project root: https://meta-models.github.io/muse-code-sdk/next/guides/extend/skills/return filepath.Join(workDir, ".agents", "skills")diff --git a/server/internal/daemon/execenv/devin_test.go b/server/internal/daemon/execenv/devin_test.gonew file mode 100644index 0000000000..75f192bcc3--- /dev/null+++ b/server/internal/daemon/execenv/devin_test.go@@ -0,0 +1,54 @@+package execenv++import (+ "os"+ "path/filepath"+ "strings"+ "testing"+)++func TestDevinPrepareDeliversAndCleansBriefAndSkills(t *testing.T) {+ t.Parallel()+ workDir := t.TempDir()+ briefPath := filepath.Join(workDir, "AGENTS.md")+ const original = "# Repository instructions\nPreserve user files.\n"+ if err := os.WriteFile(briefPath, []byte(original), 0o644); err != nil {+ t.Fatal(err)+ }+ env, err := Prepare(PrepareParams{+ WorkspacesRoot: t.TempDir(), WorkspaceID: "devin-workspace", TaskID: "devin-task",+ Provider: "devin", LocalWorkDir: workDir,+ Task: TaskContextForEnv{+ IssueID: "11111111-2222-3333-4444-555555555555",+ AgentSkills: []SkillContextForEnv{{Name: "review-helper", Content: "Review carefully."}},+ },+ }, discardLogger())+ if err != nil {+ t.Fatal(err)+ }+ if _, err := InjectRuntimeConfig(env.WorkDir, "devin", TaskContextForEnv{IssueID: "11111111-2222-3333-4444-555555555555"}); err != nil {+ t.Fatal(err)+ }+ brief, err := os.ReadFile(briefPath)+ if err != nil || !strings.Contains(string(brief), original) || !strings.Contains(string(brief), "multica issue comment add") {+ t.Fatalf("missing brief or repository rules: %q err=%v", brief, err)+ }+ skillPath := filepath.Join(workDir, ".devin", "skills", "review-helper", "SKILL.md")+ skill, err := os.ReadFile(skillPath)+ if err != nil || !strings.Contains(string(skill), "Review carefully.") {+ t.Fatalf("native skill missing: %q err=%v", skill, err)+ }+ if err := CleanupSidecars(env.RootDir); err != nil {+ t.Fatal(err)+ }+ if err := CleanupRuntimeConfig(workDir, "devin"); err != nil {+ t.Fatal(err)+ }+ restored, err := os.ReadFile(briefPath)+ if err != nil || string(restored) != original {+ t.Fatalf("user instructions not restored: %q err=%v", restored, err)+ }+ if _, err := os.Stat(skillPath); !os.IsNotExist(err) {+ t.Fatalf("managed skill survived cleanup: %v", err)+ }+}diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.goindex 0bc4770d69..f3f4f1998a 100644--- a/server/internal/daemon/execenv/runtime_config.go+++ b/server/internal/daemon/execenv/runtime_config.go@@ -218,7 +218,7 @@ func runtimeConfigPath(workDir, provider string) string {return filepath.Join(workDir, "CODEBUDDY.md")case "qwen":return filepath.Join(workDir, "QWEN.md")- case "codex", "copilot", "opencode", "codearts", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwenpaw", "mcode", "muse", "dim", "zeroclaw":+ case "codex", "copilot", "opencode", "codearts", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwenpaw", "mcode", "muse", "dim", "zeroclaw", "devin":return filepath.Join(workDir, "AGENTS.md")default:return ""diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.goindex c94d3368b8..929a2140aa 100644--- a/server/internal/daemon/execenv/runtime_config_test.go+++ b/server/internal/daemon/execenv/runtime_config_test.go@@ -1083,6 +1083,7 @@ func TestInjectRuntimeConfigPreservesUserContent(t *testing.T) {{"reasonix", "AGENTS.md"},{"dsh", "AGENTS.md"},{"dim", "AGENTS.md"},+ {"devin", "AGENTS.md"},{"zeroclaw", "AGENTS.md"},{"kiro", "AGENTS.md"},{"antigravity", "AGENTS.md"},@@ -1149,6 +1150,17 @@ func TestRuntimeConfigPathDistinguishesCodebuddyFromClaude(t *testing.T) {}}+func TestRuntimeConfigPathDevinUsesAgentsMd(t *testing.T) {+ t.Parallel()+ dir := t.TempDir()++ got := runtimeConfigPath(dir, "devin")+ want := filepath.Join(dir, "AGENTS.md")+ if got != want {+ t.Fatalf("devin runtime config path = %q, want %q", got, want)+ }+}+func TestInjectRuntimeConfigUnknownProviderSkipsWrite(t *testing.T) {t.Parallel()dir := t.TempDir()@@ -1464,6 +1476,7 @@ func TestCleanupRuntimeConfigByProvider(t *testing.T) {{"reasonix", "AGENTS.md"},{"dsh", "AGENTS.md"},{"dim", "AGENTS.md"},+ {"devin", "AGENTS.md"},{"zeroclaw", "AGENTS.md"},{"kiro", "AGENTS.md"},{"antigravity", "AGENTS.md"},diff --git a/server/internal/daemon/execenv/sidecar_manifest_test.go b/server/internal/daemon/execenv/sidecar_manifest_test.goindex 72eff2d1ab..1e4cf2d312 100644--- a/server/internal/daemon/execenv/sidecar_manifest_test.go+++ b/server/internal/daemon/execenv/sidecar_manifest_test.go@@ -158,6 +158,7 @@ var allFileBasedProviders = []string{"reasonix","dsh","dim",+ "devin","zeroclaw","kiro","antigravity",@@ -243,6 +244,7 @@ func TestPrepareThenCleanupSidecarsPreservesUserSkillSibling(t *testing.T) {{"kimi", filepath.Join(".kimi", "skills", "my-own"), "SKILL.md"},{"reasonix", filepath.Join(".reasonix", "skills", "my-own"), "SKILL.md"},{"kiro", filepath.Join(".kiro", "skills", "my-own"), "SKILL.md"},+ {"devin", filepath.Join(".devin", "skills", "my-own"), "SKILL.md"},{"antigravity", filepath.Join(".agents", "skills", "my-own"), "SKILL.md"},{"qwen", filepath.Join(".qwen", "skills", "my-own"), "SKILL.md"},{"hermes", filepath.Join(".agent_context", "skills", "my-own"), "SKILL.md"},@@ -310,6 +312,7 @@ func TestPrepareThenCleanupSidecarsPreservesUnrelatedUserFiles(t *testing.T) {{"kimi", filepath.Join(".kimi", "config.json")},{"reasonix", filepath.Join(".reasonix", "config.toml")},{"kiro", filepath.Join(".kiro", "config.json")},+ {"devin", filepath.Join(".devin", "config.json")},{"antigravity", filepath.Join(".agents", "config.json")},{"qwen", filepath.Join(".qwen", "settings.json")},}@@ -643,6 +646,7 @@ var sameSlugSkillProviderCases = []struct {{"reasonix", filepath.Join(".reasonix", "skills", "issue-review")},{"dsh", filepath.Join(".dsh", "skills", "issue-review")},{"kiro", filepath.Join(".kiro", "skills", "issue-review")},+ {"devin", filepath.Join(".devin", "skills", "issue-review")},{"antigravity", filepath.Join(".agents", "skills", "issue-review")},{"muse", filepath.Join(".agents", "skills", "issue-review")},{"qwen", filepath.Join(".qwen", "skills", "issue-review")},diff --git a/server/internal/daemon/local_skills.go b/server/internal/daemon/local_skills.goindex 02662c2bc6..c4bff5b59a 100644--- a/server/internal/daemon/local_skills.go+++ b/server/internal/daemon/local_skills.go@@ -7,6 +7,7 @@ import ("log/slog""os""path/filepath"+ "runtime""sort""strings""unicode/utf8"@@ -132,6 +133,7 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)}var providerRoot string+ var additionalProviderRoots []string// Built-in runtime identities (e.g. "omp") declare their user skills dir// in the descriptor; resolve to providerRoot and fall through to the// common construction below so universal roots, merging, and fallback@@ -244,6 +246,8 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)// directly below it. Project skills are injected separately under// <workDir>/.minimax/skills.providerRoot = filepath.Join(home, ".minimax", "skills")+ case "devin":+ providerRoot, additionalProviderRoots = devinLocalSkillRoots(home, runtime.GOOS, os.Getenv("XDG_CONFIG_HOME"), os.Getenv("APPDATA"))case "muse":configHome := os.Getenv("XDG_CONFIG_HOME")if configHome == "" {@@ -261,6 +265,9 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)if providerRoot != "" {roots = append(roots, localSkillRoot{path: providerRoot, kind: localSkillRootProvider})}+ for _, path := range additionalProviderRoots {+ roots = append(roots, localSkillRoot{path: path, kind: localSkillRootProvider})+ }roots = append(roots, localSkillRoot{path: filepath.Join(home, ".agents", "skills"), kind: localSkillRootUniversal})if provider == "claude" {for _, plugin := range listEnabledClaudePlugins(home) {@@ -282,6 +289,25 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)return roots, true, nil}+// Include the documented Windsurf channels after Devin/Cognition roots and+// before the universal fallback. The order is deterministic for import/listing+// collisions; the explicit inputs keep OS resolution testable.+func devinLocalSkillRoots(home, goos, configHome, appData string) (string, []string) {+ if goos == "windows" {+ configHome = appData+ if configHome == "" {+ configHome = filepath.Join(home, "AppData", "Roaming")+ }+ } else if configHome == "" {+ configHome = filepath.Join(home, ".config")+ }+ additional := []string{filepath.Join(configHome, "cognition", "skills")}+ for _, channel := range []string{"windsurf", "windsurf-next", "windsurf-insiders"} {+ additional = append(additional, filepath.Join(home, ".codeium", channel, "skills"))+ }+ return filepath.Join(configHome, "devin", "skills"), additional+}+// hermesLocalSkillsRoot returns the skills dir of the Hermes home a task runs// against when its agent sets no HERMES_HOME or profile of its own. It goes// through execenv.ResolveHermesProfile — the resolver the task path uses — sodiff --git a/server/internal/daemon/local_skills_devin_test.go b/server/internal/daemon/local_skills_devin_test.gonew file mode 100644index 0000000000..db6f5a873d--- /dev/null+++ b/server/internal/daemon/local_skills_devin_test.go@@ -0,0 +1,64 @@+package daemon++import (+ "path/filepath"+ "reflect"+ "testing"+)++func TestDevinLocalSkillRoots(t *testing.T) {+ home := t.TempDir()+ custom := filepath.Join(home, "custom-config")+ for _, tc := range []struct {+ name, goos, xdg, appData, want string+ }{+ {"unix-default", "linux", "", "", filepath.Join(home, ".config")},+ {"unix-xdg", "darwin", custom, "", custom},+ {"windows-appdata", "windows", "ignored", custom, custom},+ {"windows-fallback", "windows", "ignored", "", filepath.Join(home, "AppData", "Roaming")},+ } {+ t.Run(tc.name, func(t *testing.T) {+ primary, legacy := devinLocalSkillRoots(home, tc.goos, tc.xdg, tc.appData)+ if primary != filepath.Join(tc.want, "devin", "skills") || !reflect.DeepEqual(legacy, []string{+ filepath.Join(tc.want, "cognition", "skills"),+ filepath.Join(home, ".codeium", "windsurf", "skills"),+ filepath.Join(home, ".codeium", "windsurf-next", "skills"),+ filepath.Join(home, ".codeium", "windsurf-insiders", "skills"),+ }) {+ t.Fatalf("roots = %q %q", primary, legacy)+ }+ })+ }+}++func TestDevinLocalSkillsMergeAndImportPrecedence(t *testing.T) {+ home := t.TempDir()+ setTestUserHome(t, home)+ configDir := filepath.Join(home, "config")+ t.Setenv("XDG_CONFIG_HOME", configDir)+ t.Setenv("APPDATA", configDir)+ roots := []string{+ filepath.Join(configDir, "devin", "skills"), filepath.Join(configDir, "cognition", "skills"),+ filepath.Join(home, ".codeium", "windsurf", "skills"), filepath.Join(home, ".codeium", "windsurf-next", "skills"),+ filepath.Join(home, ".codeium", "windsurf-insiders", "skills"), filepath.Join(home, ".agents", "skills"),+ }+ names := []string{"Devin Copy", "Cognition Copy", "Windsurf Copy", "Next Copy", "Insiders Copy", "Universal Copy"}+ keys := []string{"devin-only", "legacy-only", "windsurf-only", "next-only", "insiders-only", "universal-only"}+ for i, root := range roots {+ writeTestLocalSkill(t, root, "duplicate", map[string]string{"SKILL.md": "---\nname: " + names[i] + "\n---\n"})+ writeTestLocalSkill(t, root, keys[i], map[string]string{"SKILL.md": "---\nname: Unique\n---\n"})+ }+ skills, supported, err := listRuntimeLocalSkills("devin")+ if err != nil || !supported || len(skills) != len(roots)+1 {+ t.Fatalf("list = %+v supported=%v err=%v", skills, supported, err)+ }+ for _, key := range append([]string{"duplicate"}, keys...) {+ bundle, supported, err := loadRuntimeLocalSkillBundle("devin", key)+ if err != nil || !supported {+ t.Fatalf("import %s: supported=%v err=%v", key, supported, err)+ }+ if key == "duplicate" && (bundle.Name != names[0] || bundle.SourcePath != relativizeHomePath(filepath.Join(roots[0], key))) {+ t.Fatalf("import did not match provider-first listing: %+v", bundle)+ }+ }+}diff --git a/server/internal/metrics/labels.go b/server/internal/metrics/labels.goindex 608b74a566..811fd589e5 100644--- a/server/internal/metrics/labels.go+++ b/server/internal/metrics/labels.go@@ -160,6 +160,7 @@ var ("kimi": "kimi","reasonix": "reasonix","dim": "dim",+ "devin": "devin","mcode": "mcode","muse": "muse","zeroclaw": "zeroclaw",diff --git a/server/migrations/593_runtime_profile_add_devin.down.sql b/server/migrations/593_runtime_profile_add_devin.down.sqlnew file mode 100644index 0000000000..9f0e173b2a--- /dev/null+++ b/server/migrations/593_runtime_profile_add_devin.down.sql@@ -0,0 +1,33 @@+-- Restore the pre-Devin whitelist. NOT VALID leaves historical Devin rows+-- readable while preventing new Devin profiles after a database rollback.+ALTER TABLE runtime_profile+ DROP CONSTRAINT IF EXISTS runtime_profile_protocol_family_check,+ ADD CONSTRAINT runtime_profile_protocol_family_check+ CHECK (protocol_family IN (+ 'claude',+ 'codebuddy',+ 'codex',+ 'copilot',+ 'opencode',+ 'codearts',+ 'openclaw',+ 'hermes',+ 'pi',+ 'cursor',+ 'kimi',+ 'reasonix',+ 'dsh',+ 'kiro',+ 'antigravity',+ 'qoder',+ 'qoderclicn',+ 'traecli',+ 'deveco',+ 'grok',+ 'qwen',+ 'qwenpaw',+ 'mcode',+ 'muse',+ 'dim',+ 'zeroclaw'+ )) NOT VALID;diff --git a/server/migrations/593_runtime_profile_add_devin.up.sql b/server/migrations/593_runtime_profile_add_devin.up.sqlnew file mode 100644index 0000000000..4ff92ae224--- /dev/null+++ b/server/migrations/593_runtime_profile_add_devin.up.sql@@ -0,0 +1,34 @@+-- Expand the current whitelist without scanning historical rows. Replacing+-- both parts in one ALTER keeps the constraint present atomically.+ALTER TABLE runtime_profile+ DROP CONSTRAINT IF EXISTS runtime_profile_protocol_family_check,+ ADD CONSTRAINT runtime_profile_protocol_family_check+ CHECK (protocol_family IN (+ 'claude',+ 'codebuddy',+ 'codex',+ 'copilot',+ 'opencode',+ 'codearts',+ 'openclaw',+ 'hermes',+ 'pi',+ 'cursor',+ 'kimi',+ 'reasonix',+ 'dsh',+ 'kiro',+ 'antigravity',+ 'qoder',+ 'qoderclicn',+ 'traecli',+ 'deveco',+ 'grok',+ 'qwen',+ 'qwenpaw',+ 'mcode',+ 'muse',+ 'dim',+ 'zeroclaw',+ 'devin'+ )) NOT VALID;diff --git a/server/pkg/agent/acp_deliverable_test.go b/server/pkg/agent/acp_deliverable_test.goindex 59418fac6a..5890c1795a 100644--- a/server/pkg/agent/acp_deliverable_test.go+++ b/server/pkg/agent/acp_deliverable_test.go@@ -172,6 +172,7 @@ var acpDeliverableCases = []acpDeliverableCase{{backend: "traecli", binary: "traecli", notification: "session/update"},{backend: "grok", binary: "grok", notification: "session/update"},{backend: "mcode", binary: "mcode", notification: "session/update"},+ {backend: "devin", binary: "devin", notification: "session/update"},{backend: "kiro", binary: "kiro-cli", notification: "session/notification", camelUpdates: true},{backend: "qoder", binary: "qodercli", notification: "session/notification", camelUpdates: true},{backend: "qoderclicn", binary: "qoderclicn", notification: "session/notification", camelUpdates: true},@@ -212,6 +213,10 @@ func fakeACPDeliverableScript(c acpDeliverableCase) string {}toolResult := `{` + discriminator("tool_call_update", "ToolCallUpdate") +`,"toolCallId":"tc-read","name":"read_file","status":"completed","output":"<svg />"}`+ authMethods := `[{"id":"cached_token","name":"Cached login"},{"id":"xai.api_key","name":"API key"}]`+ if c.backend == "devin" {+ authMethods = `[{"id":"devin-browser","name":"Browser login"}]`+ }return `#!/bin/sh# Fake ACP runtime shared by the deliverable-boundary regression tests. All@@ -226,7 +231,7 @@ while IFS= read -r line; doid=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')case "$line" in*'"method":"initialize"'*)- printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"authMethods":[{"id":"cached_token","name":"Cached login"},{"id":"xai.api_key","name":"API key"}],"agentInfo":{"name":"fake","version":"0.3.10"},"agentCapabilities":{"loadSession":true}}}\n' "$id"+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"authMethods":` + authMethods + `,"agentInfo":{"name":"fake","version":"0.3.10"},"agentCapabilities":{"loadSession":true}}}\n' "$id";;*'"method":"authenticate"'*)printf '{"jsonrpc":"2.0","id":%s,"result":{}}\n' "$id"diff --git a/server/pkg/agent/agent.go b/server/pkg/agent/agent.goindex a26579a2e8..ea0799f744 100644--- a/server/pkg/agent/agent.go+++ b/server/pkg/agent/agent.go@@ -403,6 +403,7 @@ var SupportedTypes = []string{"mcode","muse","dim",+ "devin","zeroclaw",}@@ -507,6 +508,8 @@ func New(agentType string, cfg Config) (Backend, error) {return &qwenpawBackend{cfg: cfg}, nilcase "mcode":return &mcodeBackend{cfg: cfg}, nil+ case "devin":+ return &devinBackend{cfg: cfg}, nilcase "muse":return &museBackend{cfg: cfg}, nilcase "zeroclaw":@@ -556,6 +559,7 @@ var launchHeaders = map[string]string{"qwen": "qwen -p (stream-json)","qwenpaw": "qwenpaw acp","dim": "dim acp",+ "devin": "devin acp","mcode": "mcode acp","muse": "muse serve (msp)","zeroclaw": "zeroclaw acp",diff --git a/server/pkg/agent/devin.go b/server/pkg/agent/devin.gonew file mode 100644index 0000000000..27ea5b00e1--- /dev/null+++ b/server/pkg/agent/devin.go@@ -0,0 +1,539 @@+package agent++import (+ "context"+ "encoding/json"+ "errors"+ "fmt"+ "io"+ "os/exec"+ "path/filepath"+ "strings"+ "sync"+ "sync/atomic"+ "time"+)++// devinBlockedArgs are flags hardcoded by the daemon that must not be overridden+// by user-configured custom_args. `acp` is the protocol subcommand. Devin ACP+// does not take a root `--permission-mode`; auto-approve via ACP+// session/request_permission. `-p`/`--print` would leave ACP stdio.+var devinBlockedArgs = map[string]blockedArgMode{+ "acp": blockedStandalone,+ "--yolo": blockedStandalone,+ "--permission-mode": blockedWithValue,+ "--auto-approve": blockedStandalone,+ "--approval-mode": blockedWithValue,+ "-p": blockedStandalone,+ "--print": blockedStandalone,+ "--mode": blockedWithValue,+ "--output-format": blockedWithValue,+ "--model": blockedWithValue,+}++// devinBackend implements Backend by spawning `devin acp` and communicating+// via the standard ACP (Agent Client Protocol) JSON-RPC 2.0 transport over+// stdin/stdout.+//+// Devin CLI is host-local ACP (`devin acp`) — not cloud Devin VMs / Playbooks /+// Secrets. It does not take a root `--permission-mode`; auto-approve via ACP+// session/request_permission. Launched via `devin acp`, it implements+// `initialize`, `session/new`, `session/load`, `session/set_config_option`,+// and `session/prompt`. Model selection is confirmed against the session's+// configOptions, because --model may silently fall back to the CLI default.+type devinBackend struct {+ cfg Config+}++// Match the shared ACP backends' bound for trailing notifications and pipes.+var devinReaderDrainGrace = 2 * time.Second++func (b *devinBackend) Execute(ctx context.Context, prompt string, opts ExecOptions) (*Session, error) {+ execPath := b.cfg.ExecutablePath+ if execPath == "" {+ execPath = "devin"+ }+ if _, err := exec.LookPath(execPath); err != nil {+ return nil, fmt.Errorf("devin executable not found at %q: %w", execPath, err)+ }+ cwd := opts.Cwd+ if cwd == "" {+ cwd = "."+ }+ cwd, err := filepath.Abs(cwd)+ if err != nil {+ return nil, fmt.Errorf("devin working directory: %w", err)+ }++ // Translate the agent's mcp_config (Claude-style object of objects) into+ // the array shape ACP session/new and session/load expect. Fail closed on+ // malformed JSON so the launch surfaces the real error instead of silently+ // dropping every MCP server.+ mcpServers, err := buildACPMcpServers(opts.McpConfig, b.cfg.Logger)+ if err != nil {+ return nil, fmt.Errorf("devin: invalid mcp_config: %w", err)+ }++ timeout := opts.Timeout+ runCtx, cancel := runContext(ctx, timeout)++ devinArgs := []string{"acp"}+ if model := strings.TrimSpace(opts.Model); model != "" {+ devinArgs = append(devinArgs, "--model", model)+ }+ devinArgs = append(devinArgs, filterCustomArgs(opts.ExtraArgs, devinBlockedArgs, b.cfg.Logger)...)+ devinArgs = append(devinArgs, filterCustomArgs(opts.CustomArgs, devinBlockedArgs, b.cfg.Logger)...)+ cmd := b.cfg.commandAt(execPath).exec(runCtx, devinArgs...)+ hideAgentWindow(cmd)+ cmd.WaitDelay = devinReaderDrainGrace+ b.cfg.logAgentCommand(cmd, newAgentCommandLogArgs(devinArgs, trustAgentCommandPositional(0, "acp")))+ cmd.Dir = cwd+ cmd.Env = buildEnv(b.cfg.Env)++ stdout, err := cmd.StdoutPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("devin stdout pipe: %w", err)+ }+ stdin, err := cmd.StdinPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("devin stdin pipe: %w", err)+ }+ // StderrPipe + an explicit copier give us a join point (`stderrDone`)+ // that fires before the failure-promotion decision; see the matching+ // comment in hermes.go for why the io.MultiWriter form races with+ // stopReason=end_turn under load.+ providerErr := newACPProviderErrorSniffer("devin")+ stderr, err := cmd.StderrPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("devin stderr pipe: %w", err)+ }++ if err := startOwnedProcessTree(cmd, b.cfg.Logger); err != nil {+ cancel()+ return nil, fmt.Errorf("start devin: %w", err)+ }++ stderrSink := io.MultiWriter(newLogWriter(b.cfg.Logger, "[devin:stderr] "), providerErr)+ stderrDone := make(chan struct{})+ go func() {+ defer close(stderrDone)+ _, _ = io.Copy(stderrSink, stderr)+ }()++ b.cfg.Logger.Info("devin acp started", "pid", cmd.Process.Pid, "cwd", opts.Cwd)++ msgCh := make(chan Message, 256)+ resCh := make(chan Result, 1)++ var deliverable acpDeliverableTracker+ var streamingCurrentTurn atomic.Bool+ activity := make(chan struct{}, 1)++ promptDone := make(chan hermesPromptResult, 1)++ c := &hermesClient{+ cfg: b.cfg,+ stdin: stdin,+ pending: make(map[int]*pendingRPC),+ pendingTools: make(map[string]*pendingToolCall),+ acceptNotification: func(string) bool {+ return streamingCurrentTurn.Load()+ },+ onActivity: func() {+ select {+ case activity <- struct{}{}:+ default:+ }+ },+ onMessage: func(msg Message) {+ if !streamingCurrentTurn.Load() {+ return+ }+ if msg.Type == MessageToolUse {+ msg.Tool = kimiToolNameFromTitle(msg.Tool)+ }+ deliverable.observe(msg)+ trySend(msgCh, msg)+ },+ onPromptDone: func(result hermesPromptResult) {+ if !streamingCurrentTurn.Load() {+ return+ }+ select {+ case promptDone <- result:+ default:+ }+ },+ }++ readerDone := make(chan struct{})+ go func() {+ defer close(readerDone)+ scanner := newAgentStreamScanner(stdout)+ for scanner.Scan() {+ line := strings.TrimSpace(scanner.Text())+ if line == "" {+ continue+ }+ c.handleLine(line)+ }+ c.closeAllPending(fmt.Errorf("devin process exited"))+ }()++ var stopOnce sync.Once+ stop := func() {+ stopOnce.Do(func() {+ _ = stdin.Close()+ // Cancel before Wait: the child may ignore EOF. Wait closes our pipe+ // ends, releasing readers even if an escaped descendant holds them.+ cancel()+ _ = cmd.Wait()+ <-readerDone+ <-stderrDone+ releaseProcessGroup(cmd)+ })+ }++ go func() {+ defer close(msgCh)+ defer close(resCh)+ defer stop()++ startTime := time.Now()+ finalStatus := "completed"+ var finalError string+ var sessionID string+ var resumeRejected bool+ var sessionResult json.RawMessage++ initResult, err := c.request(runCtx, "initialize", map[string]any{+ "protocolVersion": 1,+ "clientInfo": map[string]any{+ "name": "multica-agent-sdk",+ "version": "0.2.0",+ },+ "clientCapabilities": map[string]any{},+ })+ if err != nil {+ finalStatus, finalError, _ = classifyACPResumeFailure(runCtx, "devin", "initialize", err, timeout, b.cfg.Logger)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }++ // Drop MCP entries whose remote transport the runtime didn't advertise+ // in its initialize response. See hermes.go for why sending an+ // unsupported transport tanks the whole session/new.+ mcpServers = filterACPMcpServersByCapability(mcpServers, extractACPMcpCapabilities(initResult), "devin", b.cfg)++ // ACP authentication is optional: the CLI reads the environment or its+ // stored login. Never guess a method or preempt session/new's auth error.+ if methodID := selectDevinAuthMethod(extractACPAuthMethods(initResult), envHasNonEmpty(cmd.Env, "WINDSURF_API_KEY")); methodID != "" {+ authParams := map[string]any{"methodId": methodID}+ if methodID == devinAuthMethodWindsurfAPIKey {+ authParams["_meta"] = map[string]any{"headless": true}+ }+ if _, err := c.request(runCtx, "authenticate", authParams); err != nil {+ finalStatus, finalError, _ = classifyACPResumeFailure(runCtx, "devin", "authenticate", err, timeout, b.cfg.Logger)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ b.cfg.Logger.Info("devin authenticated", "method", methodID)+ }++ if opts.ResumeSessionID != "" {+ if !devinLoadSessionSupported(initResult) {+ finalStatus, finalError, _ = classifyACPResumeFailure(runCtx, "devin", "session/load", fmt.Errorf("runtime does not support session loading"), timeout, b.cfg.Logger)+ resumeRejected = runCtx.Err() == nil+ resCh <- Result{Status: finalStatus, Error: finalError, ResumeRejected: resumeRejected, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ result, err := c.request(runCtx, "session/load", map[string]any{+ "cwd": cwd,+ "sessionId": opts.ResumeSessionID,+ "mcpServers": mcpServers,+ })+ if err != nil {+ finalStatus, finalError, resumeRejected = classifyACPResumeFailure(runCtx, "devin", "session/load", err, timeout, b.cfg.Logger)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds(), ResumeRejected: resumeRejected}+ return+ }+ var changed bool+ sessionID, changed = resolveResumedSessionID(opts.ResumeSessionID, result)+ if changed {+ b.cfg.Logger.Warn("agent returned a different session id on resume — original was likely lost; continuing with the new id",+ "backend", "devin",+ "requested", opts.ResumeSessionID,+ "actual", sessionID,+ )+ }+ sessionResult = result+ } else {+ result, err := c.request(runCtx, "session/new", map[string]any{+ "cwd": cwd,+ "mcpServers": mcpServers,+ })+ if err != nil {+ finalStatus, finalError, _ = classifyACPResumeFailure(runCtx, "devin", "session/new", err, timeout, b.cfg.Logger)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ sessionID = extractACPSessionID(result)+ if sessionID == "" {+ finalStatus = "failed"+ finalError = "devin session/new returned no session ID"+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ sessionResult = result+ }++ c.sessionID = sessionID+ effectiveModel, err := confirmDevinModel(runCtx, c.request, sessionID, opts.Model, sessionResult, func(ctx context.Context) ([]byte, error) {+ return devinModelsOutput(ctx, b.cfg.commandAt(execPath), cmd.Env, cwd)+ })+ if err != nil {+ finalStatus, finalError, _ = classifyACPResumeFailure(runCtx, "devin", "model selection", err, timeout, b.cfg.Logger)+ resumeRejected = runCtx.Err() == nil && opts.ResumeSessionID != "" && devinSessionNotFound(err)+ if setupFailureWithholdsSessionID(opts) || resumeRejected {+ sessionID = ""+ }+ resCh <- Result{Status: finalStatus, Error: finalError, SessionID: sessionID, ResumeRejected: resumeRejected, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ b.cfg.Logger.Info("devin session created", "session_id", sessionID)+ // Pin only after model setup succeeds, so a never-prompted session+ // cannot leave a dead resume pointer behind on the task row.+ trySend(msgCh, Message{Type: MessageStatus, Status: "running", SessionID: sessionID})++ userText := prompt+ if opts.SystemPrompt != "" {+ userText = opts.SystemPrompt + "\n\n---\n\n" + prompt+ }++ streamingCurrentTurn.Store(true)+ _, err = c.request(runCtx, "session/prompt", map[string]any{+ "sessionId": sessionID,+ "prompt": []map[string]any{+ {"type": "text", "text": userText},+ },+ })+ if err != nil {+ if runCtx.Err() == context.DeadlineExceeded {+ finalStatus = "timeout"+ finalError = fmt.Sprintf("devin timed out after %s", timeout)+ } else if runCtx.Err() == context.Canceled {+ finalStatus = "aborted"+ finalError = "execution cancelled"+ } else {+ finalStatus = "failed"+ finalError = fmt.Sprintf("devin session/prompt failed: %v", err)+ if opts.ResumeSessionID != "" && devinSessionNotFound(err) {+ b.cfg.Logger.Warn("resumed session not found at prompt time; clearing session id so the daemon retries fresh",+ "backend", "devin",+ "session_id", sessionID,+ )+ sessionID = ""+ resumeRejected = true+ }+ }+ } else {+ select {+ case pr := <-promptDone:+ if pr.stopReason == "cancelled" {+ finalStatus = "aborted"+ finalError = "devin cancelled the prompt"+ }+ c.mergeUsage(pr.usage)+ if pr.modelID != "" {+ effectiveModel = pr.modelID+ }+ default:+ }+ waitForACPNotificationQuiescence(runCtx, activity, readerDone, acpNotificationQuietTime, devinReaderDrainGrace)+ }++ duration := time.Since(startTime)+ b.cfg.Logger.Info("devin finished", "pid", cmd.Process.Pid, "status", finalStatus, "duration", duration.Round(time.Millisecond).String())++ _ = stdin.Close()+ if runCtx.Err() == nil {+ waitForHermesPipeDrain(readerDone, stderrDone, devinReaderDrainGrace)+ }+ stop()+ streamingCurrentTurn.Store(false)+ providerErr.Finalize()+ finalOutput, fullOutput := deliverable.result()++ // Promote completed→failed when stderr or the agent text stream show a+ // terminal upstream-LLM failure (HTTP 4xx / rate-limit / expired+ // token). Mirrors hermes/kimi/kiro/qoder/traecli.+ finalStatus, finalError = promoteACPResultOnProviderError(finalStatus, finalError, fullOutput, providerErr)++ u := c.accumulatedUsage()++ var usageMap map[string]TokenUsage+ if acpUsagePresent(u) {+ model := effectiveModel+ if model == "" {+ model = "unknown"+ }+ usageMap = map[string]TokenUsage{model: u}+ }++ resCh <- Result{+ Status: finalStatus,+ Output: finalOutput,+ Error: finalError,+ DurationMs: duration.Milliseconds(),+ SessionID: sessionID,+ Usage: usageMap,+ ResumeRejected: resumeRejected,+ }+ }()++ return &Session{Messages: msgCh, Result: resCh}, nil+}++func devinLoadSessionSupported(raw json.RawMessage) bool {+ var init struct {+ Capabilities struct {+ LoadSession bool `json:"loadSession"`+ } `json:"agentCapabilities"`+ }+ return json.Unmarshal(raw, &init) == nil && init.Capabilities.LoadSession+}++func devinSessionNotFound(err error) bool {+ var rpcErr *acpRPCError+ if errors.As(err, &rpcErr) && rpcErr.Code == -32016 {+ return acpSessionNotFoundWording(strings.ToLower(rpcErr.Message + " " + rpcErr.Data))+ }+ return isACPSessionNotFound(err)+}++const (+ devinAuthMethodWindsurfAPIKey = "windsurf-api-key"+)++// Only opt into the advertised API-key handshake when its credential exists.+// Unknown or interactive methods do not disable the CLI's stored credentials.+func selectDevinAuthMethod(methods []string, haveWindsurfKey bool) string {+ if haveWindsurfKey {+ for _, method := range methods {+ if strings.TrimSpace(method) == devinAuthMethodWindsurfAPIKey {+ return devinAuthMethodWindsurfAPIKey+ }+ }+ }+ return ""+}++// discoverDevinModels runs `devin models list --format json`.+// Unknown/empty output degrades to an empty catalog (manual entry).+func discoverDevinModels(ctx context.Context, runtimeCmd Command) ([]Model, error) {+ if runtimeCmd.Path == "" {+ runtimeCmd.Path = "devin"+ }+ if _, err := exec.LookPath(runtimeCmd.Path); err != nil {+ return []Model{}, nil+ }+ stdout, err := devinModelsOutput(ctx, runtimeCmd, nil, "")+ if err != nil {+ return nil, err+ }+ return parseDevinModels(stdout)+}++func devinModelsOutput(ctx context.Context, runtimeCmd Command, env []string, cwd string) ([]byte, error) {+ runCtx, cancel := context.WithTimeout(ctx, 15*time.Second)+ defer cancel()+ cmd := runtimeCmd.exec(runCtx, "models", "list", "--format", "json")+ cmd.Env, cmd.Dir = env, cwd+ hideAgentWindow(cmd)+ stdout, err := outputOwned(cmd, runtimeCmd.logger)+ if err != nil {+ return nil, fmt.Errorf("devin model discovery: %w", err)+ }+ return stdout, nil+}++func parseDevinModels(data []byte) ([]Model, error) {+ type entry struct {+ ID string `json:"id"`+ Name string `json:"name"`+ Label string `json:"label"`+ Provider string `json:"provider"`+ Model string `json:"model"`+ ModelUID string `json:"model_uid"`+ }+ var families struct {+ Families []struct {+ Slug string `json:"slug"`+ Variants []entry `json:"variants"`+ } `json:"families"`+ }+ if err := json.Unmarshal(data, &families); err == nil && len(families.Families) > 0 {+ out := make([]Model, 0, 64)+ seen := map[string]bool{}+ for _, fam := range families.Families {+ provider := strings.TrimSpace(fam.Slug)+ for _, e := range fam.Variants {+ id := strings.TrimSpace(e.ModelUID)+ if id == "" {+ id = strings.TrimSpace(e.ID)+ }+ if id == "" || seen[id] {+ continue+ }+ seen[id] = true+ label := strings.TrimSpace(e.Label)+ if label == "" {+ label = strings.TrimSpace(e.Name)+ }+ if label == "" {+ label = id+ }+ out = append(out, Model{ID: id, Label: label, Provider: provider})+ }+ }+ if len(out) > 0 {+ return out, nil+ }+ }+ var models []entry+ var wrapper struct {+ Models []entry `json:"models"`+ }+ if err := json.Unmarshal(data, &wrapper); err == nil && len(wrapper.Models) > 0 {+ models = wrapper.Models+ } else if err := json.Unmarshal(data, &models); err != nil {+ return []Model{}, nil+ }+ out := make([]Model, 0, len(models))+ seen := map[string]bool{}+ for _, e := range models {+ id := strings.TrimSpace(e.ID)+ if id == "" {+ id = strings.TrimSpace(e.ModelUID)+ }+ if id == "" {+ id = strings.TrimSpace(e.Model)+ }+ if id == "" || seen[id] {+ continue+ }+ seen[id] = true+ label := strings.TrimSpace(e.Name)+ if label == "" {+ label = strings.TrimSpace(e.Label)+ }+ if label == "" {+ label = id+ }+ out = append(out, Model{ID: id, Label: label, Provider: strings.TrimSpace(e.Provider)})+ }+ return out, nil+}diff --git a/server/pkg/agent/devin_cancel_unix_test.go b/server/pkg/agent/devin_cancel_unix_test.gonew file mode 100644index 0000000000..2112e11345--- /dev/null+++ b/server/pkg/agent/devin_cancel_unix_test.go@@ -0,0 +1,134 @@+//go:build unix++package agent++import (+ "context"+ "log/slog"+ "path/filepath"+ "syscall"+ "testing"+ "time"+)++func TestDevinTerminatesOwnedProcessTree(t *testing.T) {+ for _, stage := range []string{"cancel-prompt", "unsupported-resume", "cancel-model-discovery"} {+ t.Run(stage, func(t *testing.T) {+ failEarly := stage == "unsupported-resume"+ dir := t.TempDir()+ pidFile := filepath.Join(dir, "pids")+ fakePath := filepath.Join(dir, "devin")+ writeTestExecutable(t, fakePath, []byte(`#!/bin/sh+spawn_child() {+ ( sleep 300 ) >/dev/null 2>&1 &+ printf '%s %s\n' "$$" "$!" > "$DEVIN_PID_FILE"+}+if [ "$1" = models ]; then+ spawn_child+ while true; do sleep 1; done+fi++while IFS= read -r line; do+ id=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')+ case "$line" in+ *'"method":"initialize"'*)+ if [ "$DEVIN_EARLY_FAILURE" = true ]; then spawn_child; fi+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"agentCapabilities":{"loadSession":false}}}\n' "$id"+ if [ "$DEVIN_EARLY_FAILURE" = true ]; then while true; do sleep 1; done; fi+ ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"devin-session"}}\n' "$id"+ ;;+ *'"method":"session/prompt"'*)+ spawn_child+ while true; do sleep 1; done+ ;;+ esac+done+while true; do sleep 1; done+`))+ backend, err := New("devin", Config{ExecutablePath: fakePath, Logger: slog.Default(), Env: map[string]string{+ "DEVIN_PID_FILE": pidFile, "DEVIN_EARLY_FAILURE": map[bool]string{false: "false", true: "true"}[failEarly],+ }})+ if err != nil {+ t.Fatal(err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ opts := ExecOptions{Cwd: dir}+ if failEarly {+ opts.ResumeSessionID = "old-session"+ }+ if stage == "cancel-model-discovery" {+ opts.Model = "opus"+ }+ session, err := backend.Execute(ctx, "keep working", opts)+ if err != nil {+ t.Fatal(err)+ }+ messagesClosed := make(chan struct{})+ go func() {+ defer close(messagesClosed)+ for range session.Messages {+ }+ }()+ pids := waitForPids(t, pidFile)+ t.Cleanup(func() {+ for _, pid := range pids {+ _ = syscall.Kill(pid, syscall.SIGKILL)+ }+ })+ if !failEarly {+ cancel()+ }+ select {+ case result := <-session.Result:+ if failEarly {+ if result.Status != "failed" || !result.ResumeRejected {+ t.Fatalf("unsupported resume = %+v", result)+ }+ } else if result.Status != "aborted" {+ t.Fatalf("cancelled prompt = %+v", result)+ }+ case <-time.After(3 * time.Second):+ t.Fatal("process cleanup waited for the task timeout")+ }+ select {+ case <-messagesClosed:+ case <-time.After(3 * time.Second):+ t.Fatal("readers were not joined")+ }+ for _, pid := range pids {+ waitProcessGone(t, pid)+ }+ })+ }+}++func TestDevinBoundsEscapedPipeHolders(t *testing.T) {+ for _, tc := range []struct{ name, cases, status string }{+ {"completed", `+ *'"method":"initialize"'*)+ printf '{"jsonrpc":"2.0","id":%%s,"result":{"protocolVersion":1}}\n' "$id" ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%%s,"result":{"sessionId":"devin-session"}}\n' "$id" ;;+ *'"method":"session/prompt"'*)+ %s+ printf '{"jsonrpc":"2.0","id":%%s,"result":{"stopReason":"end_turn"}}\n' "$id"+ exit 0 ;;`, "completed"},+ {"early-failure", `+ *'"method":"initialize"'*)+ %s+ printf '{"jsonrpc":"2.0","id":%%s,"error":{"code":-32603,"message":"initialize refused"}}\n' "$id"+ exit 0 ;;`, "failed"},+ } {+ t.Run(tc.name, func(t *testing.T) {+ session, closed := startACPWithEscapedHolder(t, "devin", tc.cases)+ result := awaitHermesResult(t, session)+ if result.Status != tc.status {+ t.Fatalf("result=%+v, want %s", result, tc.status)+ }+ awaitHermesMessagesClosed(t, closed)+ })+ }+}diff --git a/server/pkg/agent/devin_contract_test.go b/server/pkg/agent/devin_contract_test.gonew file mode 100644index 0000000000..7b198afc1a--- /dev/null+++ b/server/pkg/agent/devin_contract_test.go@@ -0,0 +1,320 @@+package agent++import (+ "context"+ "encoding/json"+ "fmt"+ "io"+ "log/slog"+ "os"+ "path/filepath"+ "runtime"+ "strings"+ "testing"+ "time"+)++// Replays the reported Devin CLI v3000.10.21 wire contract without account access.+const fakeDevinContractScript = `#!/bin/sh+if [ "$1" = models ]; then+ printf '%s\n' "${DEVIN_TEST_CATALOG:-null}"+ exit 0+fi+while IFS= read -r line; do+ if [ -n "$DEVIN_REQUESTS_FILE" ]; then printf '%s\n' "$line" >> "$DEVIN_REQUESTS_FILE"; fi+ id=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')+ method=$(printf '%s' "$line" | sed -n 's/.*"method":"\([^"]*\)".*/\1/p')+ if [ "$method" = "$DEVIN_TEST_FAIL_RPC" ]; then+ printf '{"jsonrpc":"2.0","id":%s,"error":{"code":%s,"message":"%s"}}\n' "$id" "${DEVIN_TEST_ERROR_CODE:--32016}" "${DEVIN_TEST_ERROR_MESSAGE:-Session not found}"+ if [ "$DEVIN_TEST_IGNORE_EOF" != 1 ]; then exit 0; fi+ continue+ fi+ case "$method" in+ initialize)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"agentInfo":{"name":"affogato","version":"0.0.0-dev"},"agentCapabilities":{"loadSession":%s,"mcpCapabilities":{"http":false,"sse":false}},"authMethods":%s}}\n' "$id" "${DEVIN_TEST_LOAD_SUPPORTED:-true}" "${DEVIN_TEST_AUTH_METHODS:-[]}"+ ;;+ authenticate)+ printf '{"jsonrpc":"2.0","id":%s,"result":{}}\n' "$id"+ ;;+ session/new|session/load|session/set_config_option)+ model=${DEVIN_TEST_INITIAL_MODEL:-default-model}+ if [ "$method" = session/set_config_option ] && [ "$DEVIN_TEST_APPLY_MODEL" = 1 ]; then model=selected-model; fi+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"devin-session","configOptions":[{"id":"model","category":"model","name":"Model","type":"select","currentValue":"%s","options":[{"value":"default-model","name":"Default"},{"value":"selected-model","name":"Selected"}]}]}}\n' "$id" "$model"+ ;;+ session/prompt)+ printf '{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"devin-session","update":{"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"pong"}}}}\n'+ printf '{"jsonrpc":"2.0","id":%s,"result":{"stopReason":"end_turn","usage":{"totalTokens":10,"inputTokens":7,"outputTokens":3}}}\n' "$id"+ exit 0+ ;;+ esac+done+if [ "$DEVIN_TEST_IGNORE_EOF" = 1 ]; then while true; do sleep 1; done; fi+`++func TestDevinStoredCredentialsDoNotRequireAuthenticate(t *testing.T) {+ for _, method := range []string{"windsurf-api-key", "future-auth", "cached-login", "devin-browser"} {+ t.Run(method, func(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{}, map[string]string{+ "WINDSURF_API_KEY": "", "DEVIN_TEST_AUTH_METHODS": fmt.Sprintf(`[{"id":%q}]`, method),+ })+ if result.Status != "completed" || strings.Contains(requests, `"method":"authenticate"`) {+ t.Fatalf("stored credential path was intercepted: result=%+v requests=%s", result, requests)+ }+ })+ }+}++func TestDevinExplicitKeyAuthenticatesOnlyWhenAdvertised(t *testing.T) {+ for _, method := range []string{"windsurf-api-key", "future-auth"} {+ t.Run(method, func(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{}, map[string]string{+ "WINDSURF_API_KEY": "fixture-key", "DEVIN_TEST_AUTH_METHODS": fmt.Sprintf(`[{"id":%q}]`, method),+ })+ if result.Status != "completed" || strings.Contains(requests, `"method":"authenticate"`) != (method == "windsurf-api-key") {+ t.Fatalf("unexpected auth selection: result=%+v requests=%s", result, requests)+ }+ if strings.Contains(requests, "fixture-key") {+ t.Fatal("API key was copied into the RPC transcript")+ }+ })+ }+}++func TestDevinMissingCredentialsSurfaceSessionError(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{}, map[string]string{+ "WINDSURF_API_KEY": "", "DEVIN_TEST_AUTH_METHODS": `[{"id":"windsurf-api-key"}]`,+ "DEVIN_TEST_FAIL_RPC": "session/new", "DEVIN_TEST_ERROR_MESSAGE": "Authentication required: run devin auth login",+ })+ if result.Status != "failed" || result.ResumeRejected || result.SessionID != "" ||+ !strings.Contains(result.Error, "run devin auth login") || strings.Contains(requests, `"method":"session/prompt"`) {+ t.Fatalf("real session auth error was lost: result=%+v requests=%s", result, requests)+ }+}++func TestDevinAliasResolvedByCLIUsesCanonicalUsage(t *testing.T) {+ // The launch flag is `opus`, but ACP returns a canonical value, not the flag.+ result, _, requests := runDevinContract(t, ExecOptions{Model: "opus"}, map[string]string{+ "DEVIN_TEST_INITIAL_MODEL": "selected-model",+ "DEVIN_TEST_CATALOG": `{"families":[{"slug":"claude-opus-5","aliases":["opus"],"variants":[{"model_uid":"selected-model"}]}]}`,+ })+ if result.Status != "completed" || result.Usage["selected-model"].InputTokens != 7 ||+ strings.Contains(requests, `"method":"session/set_config_option"`) {+ t.Fatalf("resolved alias was rejected or misattributed: result=%+v requests=%s", result, requests)+ }+}++func TestDevinResumedAliasMustBeAppliedBeforePrompt(t *testing.T) {+ for _, applied := range []bool{false, true} {+ t.Run(fmt.Sprintf("applied=%v", applied), func(t *testing.T) {+ env := map[string]string{+ "DEVIN_TEST_CATALOG": `{"families":[{"slug":"claude-opus-5","aliases":["opus"],"variants":[{"model_uid":"selected-model"}]}]}`,+ }+ if applied {+ env["DEVIN_TEST_APPLY_MODEL"] = "1"+ }+ result, _, requests := runDevinContract(t, ExecOptions{Model: "opus", ResumeSessionID: "old-session"}, env)+ if strings.Contains(requests, `"method":"session/prompt"`) != applied ||+ !strings.Contains(requests, `"value":"selected-model"`) {+ t.Fatalf("alias was not applied canonically: result=%+v requests=%s", result, requests)+ }+ if applied {+ if result.Status != "completed" || result.Usage["selected-model"].InputTokens != 7 {+ t.Fatalf("alias usage was not canonical: %+v", result)+ }+ } else if result.Status != "failed" || result.ResumeRejected || len(result.Usage) != 0 {+ t.Fatalf("silent model fallback was accepted: %+v", result)+ }+ })+ }+}++func runDevinContract(t *testing.T, opts ExecOptions, env map[string]string) (Result, []Message, string) {+ t.Helper()+ if runtime.GOOS == "windows" {+ t.Skip("POSIX fake CLI; native Windows lifecycle is covered by the shared process ownership tests")+ }+ if env == nil {+ env = make(map[string]string)+ }+ requestsFile := filepath.Join(t.TempDir(), "requests.jsonl")+ env["DEVIN_REQUESTS_FILE"] = requestsFile+ fakePath := filepath.Join(t.TempDir(), "devin")+ writeTestExecutable(t, fakePath, []byte(fakeDevinContractScript))+ backend, err := New("devin", Config{ExecutablePath: fakePath, Logger: slog.New(slog.NewTextHandler(io.Discard, nil)), Env: env})+ if err != nil {+ t.Fatal(err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ session, err := backend.Execute(ctx, "say pong", opts)+ if err != nil {+ t.Fatal(err)+ }+ var messages []Message+ done := make(chan struct{})+ go func() {+ defer close(done)+ for message := range session.Messages {+ messages = append(messages, message)+ }+ }()+ var result Result+ select {+ case result = <-session.Result:+ case <-ctx.Done():+ t.Fatal("fake Devin did not return a result")+ }+ select {+ case <-done:+ case <-ctx.Done():+ t.Fatal("fake Devin did not close its message stream")+ }+ requests, err := os.ReadFile(requestsFile)+ if err != nil {+ t.Fatal(err)+ }+ return result, messages, string(requests)+}++func TestDevinSessionRejection(t *testing.T) {+ for _, rpc := range []string{"session/load", "session/set_config_option", "session/prompt"} {+ for _, rejected := range []bool{false, true} {+ t.Run(fmt.Sprintf("%s/rejected=%v", rpc, rejected), func(t *testing.T) {+ env := map[string]string{"DEVIN_TEST_FAIL_RPC": rpc}+ if !rejected {+ env["DEVIN_TEST_ERROR_MESSAGE"] = "Authentication required"+ }+ opts := ExecOptions{ResumeSessionID: "old-session"}+ if rpc == "session/set_config_option" {+ opts.Model = "selected-model"+ }+ result, _, _ := runDevinContract(t, opts, env)+ if result.Status != "failed" || result.ResumeRejected != rejected {+ t.Fatalf("result=%+v, want rejected=%v", result, rejected)+ }+ if rejected && result.SessionID != "" {+ t.Fatalf("rejected session pointer survived: %q", result.SessionID)+ }+ })+ }+ }+}++func TestDevinModelMustBeConfirmedBeforePrompt(t *testing.T) {+ for _, resumed := range []bool{false, true} {+ for _, applied := range []bool{false, true} {+ t.Run(fmt.Sprintf("resume=%v/applied=%v", resumed, applied), func(t *testing.T) {+ opts := ExecOptions{Model: "selected-model"}+ if resumed {+ opts.ResumeSessionID = "old-session"+ }+ env := map[string]string{}+ if applied {+ env["DEVIN_TEST_APPLY_MODEL"] = "1"+ }+ result, messages, requests := runDevinContract(t, opts, env)+ promptSent := strings.Contains(requests, `"method":"session/prompt"`)+ if promptSent != applied {+ t.Fatalf("unconfirmed model reached prompt: applied=%v requests=%s", applied, requests)+ }+ if applied {+ usage, ok := result.Usage["selected-model"]+ if result.Status != "completed" || !ok || usage.InputTokens != 7 || usage.OutputTokens != 3 {+ t.Fatalf("confirmed model attribution failed: %+v", result)+ }+ } else {+ if result.Status != "failed" || result.ResumeRejected {+ t.Fatalf("model rejection was mistaken for a session rejection: %+v", result)+ }+ for _, message := range messages {+ if message.Type == MessageStatus && message.SessionID != "" {+ t.Fatal("session was pinned before setup succeeded")+ }+ }+ if !resumed && result.SessionID != "" {+ t.Fatal("never-prompted fresh session was published")+ }+ }+ })+ }+ }+}++func TestDevinDefaultModelAndAbsoluteCwd(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{}, nil)+ if result.Status != "completed" || result.Usage["default-model"].InputTokens != 7 {+ t.Fatalf("configOptions default was not attributed: %+v", result)+ }+ for _, line := range strings.Split(strings.TrimSpace(requests), "\n") {+ var request struct {+ Method string `json:"method"`+ Params struct {+ Cwd string `json:"cwd"`+ } `json:"params"`+ }+ if err := json.Unmarshal([]byte(line), &request); err != nil {+ t.Fatal(err)+ }+ if request.Method == "session/new" && !filepath.IsAbs(request.Params.Cwd) {+ t.Fatalf("relative cwd sent to Devin: %q", request.Params.Cwd)+ }+ }+}++func TestDevinUnadvertisedModelFailsBeforePrompt(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{Model: "unavailable-model"}, nil)+ if result.Status != "failed" || result.SessionID != "" || result.ResumeRejected || len(result.Usage) != 0 || strings.Contains(requests, `"method":"session/prompt"`) {+ t.Fatalf("unavailable model was not rejected before prompt: %+v requests=%s", result, requests)+ }+}++func TestDevinEarlyFailureCancelsBeforeWait(t *testing.T) {+ started := time.Now()+ result, _, _ := runDevinContract(t, ExecOptions{}, map[string]string{+ "DEVIN_TEST_FAIL_RPC": "initialize", "DEVIN_TEST_IGNORE_EOF": "1",+ })+ if result.Status != "failed" || time.Since(started) > 3*time.Second {+ t.Fatalf("early failure waited for task timeout: %+v elapsed=%s", result, time.Since(started))+ }+}++func TestDevinLoadCapability(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{ResumeSessionID: "old-session"}, map[string]string{+ "DEVIN_TEST_LOAD_SUPPORTED": "false",+ })+ if !result.ResumeRejected || strings.Contains(requests, `"method":"session/load"`) {+ t.Fatalf("unsupported load was sent: %+v requests=%s", result, requests)+ }+}++func TestDevinGroupedModelOptions(t *testing.T) {+ raw := json.RawMessage(`{"configOptions":[{"id":"unrelated","currentValue":true},{"id":"model","category":"model","currentValue":"a","options":[{"group":"recommended","name":"Recommended","options":[{"value":"b","name":"Model B"}]}]}]}`)+ requested := false+ actual, err := confirmDevinModel(context.Background(), func(_ context.Context, method string, params any) (json.RawMessage, error) {+ requested = method == "session/set_config_option" && params.(map[string]any)["value"] == "b"+ return json.RawMessage(`{"configOptions":[{"id":"model","category":"model","currentValue":"b"}]}`), nil+ }, "session", "b", raw, nil)+ if err != nil || actual != "b" || !requested {+ t.Fatalf("grouped choice was not applied: model=%q err=%v", actual, err)+ }+}++func TestDevinMcpFollowsAdvertisedTransports(t *testing.T) {+ result, _, requests := runDevinContract(t, ExecOptions{McpConfig: json.RawMessage(`{"mcpServers":{"local":{"command":"fake-mcp","args":["serve"]},"remote":{"type":"http","url":"https://example.invalid/mcp"}}}`)}, nil)+ if result.Status != "completed" || !strings.Contains(requests, "fake-mcp") || strings.Contains(requests, "example.invalid") {+ t.Fatalf("unsupported remote MCP reached session/new: result=%+v requests=%s", result, requests)+ }+}++func TestDevinMinimumBinaryVersion(t *testing.T) {+ for _, tc := range []struct {+ version string+ rejected bool+ }{+ {"3000.3.21", true}, {"3000.3.22", false}, {"3000.10.21", false}, {"0.0.0-dev", true},+ } {+ if err := CheckMinVersion("devin", tc.version); (err != nil) != tc.rejected {+ t.Errorf("binary version %q: err=%v rejected=%v", tc.version, err, tc.rejected)+ }+ }+}diff --git a/server/pkg/agent/devin_model.go b/server/pkg/agent/devin_model.gonew file mode 100644index 0000000000..ba4065c36e--- /dev/null+++ b/server/pkg/agent/devin_model.go@@ -0,0 +1,175 @@+package agent++import (+ "context"+ "encoding/json"+ "fmt"+ "strings"+ "unicode"+)++type devinModelChoice struct {+ Value string `json:"value"`+ Name string `json:"name"`+ Options []devinModelChoice `json:"options"`+}++type devinModelOption struct {+ ID string `json:"id"`+ Category string `json:"category"`+ CurrentValue string `json:"currentValue"`+ Options []devinModelChoice `json:"options"`+}++func devinSessionModel(raw json.RawMessage) devinModelOption {+ var response struct {+ ConfigOptions []json.RawMessage `json:"configOptions"`+ }+ if json.Unmarshal(raw, &response) == nil {+ for _, rawOption := range response.ConfigOptions {+ var option devinModelOption+ if json.Unmarshal(rawOption, &option) == nil && (option.Category == "model" || option.ID == "model") {+ return option+ }+ }+ }+ // Older CLI builds expose the same selected-model fact in models.+ return devinModelOption{CurrentValue: extractACPCurrentModelID(raw)}+}++func devinModelAvailable(choices []devinModelChoice, value string) bool {+ for _, choice := range choices {+ if choice.Value == value || devinModelAvailable(choice.Options, value) {+ return true+ }+ }+ return false+}++func normalizeDevinModelName(value string) string {+ return strings.Map(func(r rune) rune {+ if unicode.IsLetter(r) || unicode.IsDigit(r) {+ return unicode.ToLower(r)+ }+ return -1+ }, value)+}++func devinNamedModelValues(choices []devinModelChoice, name string, values map[string]bool) {+ for _, choice := range choices {+ if choice.Value != "" && normalizeDevinModelName(choice.Name) == name {+ values[choice.Value] = true+ }+ devinNamedModelValues(choice.Options, name, values)+ }+}++// Catalog aliases identify a family, never account entitlement. Do not infer+// versions from opaque model IDs or guess a winner across ambiguous families.+func devinCatalogModelValues(data []byte, requested string) (map[string]bool, error) {+ var catalog struct {+ Families []struct {+ Slug string `json:"slug"`+ Name string `json:"family_label"`+ Aliases []string `json:"aliases"`+ Variants []struct {+ ID string `json:"model_uid"`+ Label string `json:"label"`+ } `json:"variants"`+ } `json:"families"`+ }+ if err := json.Unmarshal(data, &catalog); err != nil {+ return nil, fmt.Errorf("read Devin model aliases: %w", err)+ }+ name := normalizeDevinModelName(requested)+ values := make(map[string]bool)+ if name == "" {+ return values, nil+ }+ matchedFamilies := 0+ for _, family := range catalog.Families {+ familyMatch := false+ for _, alias := range append([]string{family.Slug, family.Name}, family.Aliases...) {+ if normalizeDevinModelName(alias) == name {+ familyMatch = true+ break+ }+ }+ matched := false+ for _, variant := range family.Variants {+ if variant.ID != "" && (familyMatch || variant.ID == requested || normalizeDevinModelName(variant.Label) == name) {+ values[variant.ID] = true+ matched = true+ }+ }+ if matched {+ matchedFamilies+++ }+ }+ if matchedFamilies > 1 {+ return nil, fmt.Errorf("Devin model name %q matches multiple families; choose a canonical model ID", requested)+ }+ return values, nil+}++// confirmDevinModel treats the session's state, not the launch flag or global+// catalog, as authoritative. The CLI can accept --model and silently use its+// configured default when that model is unavailable to the account. Session+// configOptions also let a resumed conversation apply a changed model choice.+func confirmDevinModel(ctx context.Context, request acpRequestFn, sessionID, requested string, raw json.RawMessage, catalog func(context.Context) ([]byte, error)) (string, error) {+ option := devinSessionModel(raw)+ requested = strings.TrimSpace(requested)+ if requested == "" || requested == option.CurrentValue {+ return option.CurrentValue, nil+ }+ values := map[string]bool{requested: true}+ if !devinModelAvailable(option.Options, requested) {+ values = make(map[string]bool)+ if name := normalizeDevinModelName(requested); name != "" {+ devinNamedModelValues(option.Options, name, values)+ }+ if len(values) > 1 {+ return "", fmt.Errorf("Devin model name %q matches multiple session choices; choose a canonical model ID", requested)+ }+ if len(values) == 0 && catalog != nil {+ data, err := catalog(ctx)+ if err != nil {+ return "", fmt.Errorf("resolve Devin model %q: %w; choose a canonical model ID", requested, err)+ }+ values, err = devinCatalogModelValues(data, requested)+ if err != nil {+ return "", err+ }+ }+ }+ if option.CurrentValue != "" && values[option.CurrentValue] {+ return option.CurrentValue, nil+ }+ // A fresh CLI may already have resolved an alias above. On resume, set a+ // canonical advertised value only if there is one unambiguous candidate.+ selected := ""+ for value := range values {+ if devinModelAvailable(option.Options, value) {+ if selected != "" {+ return "", fmt.Errorf("Devin model name %q has multiple available variants; choose a canonical model ID", requested)+ }+ selected = value+ }+ }+ if option.ID == "" || selected == "" {+ return "", fmt.Errorf("requested Devin model %q is unavailable or cannot be confirmed (session model %q); choose an available model ID or use the CLI default", requested, option.CurrentValue)+ }+ result, err := request(ctx, "session/set_config_option", map[string]any{+ "sessionId": sessionID,+ "configId": option.ID,+ "value": selected,+ })+ if err != nil {+ return "", fmt.Errorf("set Devin model %q: %w", requested, err)+ }+ actual := devinSessionModel(result).CurrentValue+ if actual != selected {+ return "", fmt.Errorf("Devin did not confirm requested model %q (session model %q); no prompt was sent", requested, actual)+ }+ return actual, nil+}diff --git a/server/pkg/agent/devin_model_test.go b/server/pkg/agent/devin_model_test.gonew file mode 100644index 0000000000..998b988188--- /dev/null+++ b/server/pkg/agent/devin_model_test.go@@ -0,0 +1,58 @@+package agent++import (+ "context"+ "encoding/json"+ "fmt"+ "testing"+)++func TestDevinModelNamesAndAliases(t *testing.T) {+ const catalog = `{"families":[{"slug":"claude-opus-5","family_label":"Claude Opus 5","aliases":["opus"],"variants":[{"model_uid":"opus-high","label":"Opus High"},{"model_uid":"opus-low","label":"Opus Low"}]},{"slug":"swe-2","aliases":["swe"],"variants":[{"model_uid":"swe-2"}]}]}`+ for _, tc := range []struct {+ name, requested, current, options, catalog, want, set string+ wantError bool+ }{+ {name: "canonical", requested: "opus-high", current: "opus-high", want: "opus-high"},+ {name: "default", current: "swe-2", want: "swe-2"},+ {name: "alias-resolved", requested: "opus", current: "opus-high", catalog: catalog, want: "opus-high"},+ {name: "slug-resolved", requested: "claude-opus-5", current: "opus-low", catalog: catalog, want: "opus-low"},+ {name: "family-name", requested: "Claude Opus 5", current: "opus-high", catalog: catalog, want: "opus-high"},+ {name: "session-name", requested: "Opus High", current: "opus-high", options: `[{"value":"opus-high","name":"Opus High"}]`, want: "opus-high"},+ {name: "session-name-normalized", requested: "OPUS-HIGH", current: "opus-high", options: `[{"value":"opus-high","name":"Opus High"}]`, want: "opus-high"},+ {name: "catalog-variant-name", requested: "Opus High", current: "opus-high", catalog: catalog, want: "opus-high"},+ {name: "resume-alias", requested: "opus", current: "swe-2", options: `[{"value":"opus-high","name":"Opus High"}]`, catalog: catalog, want: "opus-high", set: "opus-high"},+ {name: "unavailable-family-fallback", requested: "opus", current: "swe-2", catalog: catalog, wantError: true},+ {name: "ambiguous-variant", requested: "opus", current: "swe-2", options: `[{"value":"opus-high"},{"value":"opus-low"}]`, catalog: catalog, wantError: true},+ {name: "ambiguous-session-name", requested: "Opus", current: "opus-high", options: `[{"value":"opus-high","name":"Opus"},{"value":"opus-low","name":"Opus"}]`, wantError: true},+ {name: "ambiguous-family", requested: "opus", current: "opus-high", catalog: `{"families":[{"aliases":["opus"],"variants":[{"model_uid":"opus-high"}]},{"aliases":["opus"],"variants":[{"model_uid":"old-opus"}]}]}`, wantError: true},+ {name: "unknown-partial", requested: "op", current: "swe-2", catalog: catalog, wantError: true},+ {name: "punctuation-not-an-alias", requested: ".", current: "swe-2", catalog: catalog, wantError: true},+ {name: "opaque-id-not-guessed", requested: "MODEL_PRIVATE_2", current: "swe-2", catalog: catalog, wantError: true},+ {name: "bad-catalog", requested: "opus", current: "swe-2", catalog: `invalid`, wantError: true},+ } {+ t.Run(tc.name, func(t *testing.T) {+ options := tc.options+ if options == "" {+ options = "[]"+ }+ raw := json.RawMessage(fmt.Sprintf(`{"configOptions":[{"id":"model","currentValue":%q,"options":%s}]}`, tc.current, options))+ set := ""+ actual, err := confirmDevinModel(context.Background(), func(_ context.Context, method string, params any) (json.RawMessage, error) {+ if method != "session/set_config_option" {+ t.Fatalf("unexpected RPC %s", method)+ }+ set = params.(map[string]any)["value"].(string)+ return json.RawMessage(fmt.Sprintf(`{"configOptions":[{"id":"model","currentValue":%q}]}`, set)), nil+ }, "session", tc.requested, raw, func(context.Context) ([]byte, error) {+ if tc.catalog == "" {+ t.Fatal("exact session choice unexpectedly required a catalog process")+ }+ return []byte(tc.catalog), nil+ })+ if (err != nil) != tc.wantError || actual != tc.want || set != tc.set {+ t.Fatalf("actual=%q set=%q err=%v; want model=%q set=%q error=%v", actual, set, err, tc.want, tc.set, tc.wantError)+ }+ })+ }+}diff --git a/server/pkg/agent/devin_test.go b/server/pkg/agent/devin_test.gonew file mode 100644index 0000000000..b7d917ec7d--- /dev/null+++ b/server/pkg/agent/devin_test.go@@ -0,0 +1,238 @@+package agent++import (+ "context"+ "log/slog"+ "os"+ "path/filepath"+ "strings"+ "testing"+ "time"+)++func TestDevinNativeBackendConstruction(t *testing.T) {+ t.Parallel()++ if !IsSupportedType("devin") || IsBuiltinRuntime("devin") {+ t.Fatal("Devin must be a native protocol family, not a self-referencing derived runtime")+ }++ b, err := New("devin", Config{Logger: slog.Default(), ExecutablePath: "devin"})+ if err != nil {+ t.Fatalf("New(devin): %v", err)+ }+ if _, ok := b.(*devinBackend); !ok {+ t.Fatalf("New(devin) = %T, want *devinBackend", b)+ }++ resolved, err := ResolveBackend("devin", Config{Logger: slog.Default()})+ if err != nil {+ t.Fatalf("ResolveBackend(devin): %v", err)+ }+ if _, ok := resolved.(*devinBackend); !ok {+ t.Fatalf("ResolveBackend(devin) = %T, want *devinBackend", resolved)+ }+}++func fakeDevinACPScript() string {+ return `#!/bin/sh+if [ -n "$DEVIN_ARGS_FILE" ]; then+ for arg in "$@"; do+ printf '%s\n' "$arg" >> "$DEVIN_ARGS_FILE"+ done+fi+while IFS= read -r line; do+ if [ -n "$DEVIN_REQUESTS_FILE" ]; then+ printf '%s\n' "$line" >> "$DEVIN_REQUESTS_FILE"+ fi+ id=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')+ case "$line" in+ *'"method":"initialize"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"agentCapabilities":{"loadSession":true,"mcpCapabilities":{"http":true,"sse":true}}}}\n' "$id"+ ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"ses_devin","models":{"currentModelId":"swe-1.7-lightning"}}}\n' "$id"+ ;;+ *'"method":"session/load"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"ses_loaded"}}\n' "$id"+ ;;+ *'"method":"session/prompt"'*)+ printf '{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"ses_devin","update":{"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"pong"}}}}\n'+ printf '{"jsonrpc":"2.0","id":%s,"result":{"stopReason":"end_turn"}}\n' "$id"+ exit 0+ ;;+ esac+done+`+}++func TestDevinBackendStreamsAndCompletes(t *testing.T) {+ t.Parallel()+ fakePath := filepath.Join(t.TempDir(), "devin")+ writeTestExecutable(t, fakePath, []byte(fakeDevinACPScript()))++ backend, err := New("devin", Config{ExecutablePath: fakePath, Logger: slog.Default()})+ if err != nil {+ t.Fatalf("new devin backend: %v", err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()++ session, err := backend.Execute(ctx, "say pong", ExecOptions{Timeout: 5 * time.Second})+ if err != nil {+ t.Fatalf("execute: %v", err)+ }+ var messages []Message+ done := make(chan struct{})+ go func() {+ defer close(done)+ for m := range session.Messages {+ messages = append(messages, m)+ }+ }()+ result := <-session.Result+ <-done++ if result.Status != "completed" {+ t.Fatalf("expected completed, got status=%q error=%q", result.Status, result.Error)+ }+ if !strings.Contains(result.Output, "pong") {+ t.Fatalf("output = %q, want pong", result.Output)+ }+ if result.SessionID != "ses_devin" {+ t.Fatalf("session id = %q, want ses_devin", result.SessionID)+ }+}++func TestDevinBlockedArgsFiltering(t *testing.T) {+ t.Parallel()+ tempDir := t.TempDir()+ argsFile := filepath.Join(tempDir, "argv.txt")+ fakePath := filepath.Join(tempDir, "devin")+ writeTestExecutable(t, fakePath, []byte(fakeDevinACPScript()))++ backend, err := New("devin", Config{+ ExecutablePath: fakePath,+ Logger: slog.Default(),+ Env: map[string]string{"DEVIN_ARGS_FILE": argsFile},+ })+ if err != nil {+ t.Fatalf("new devin backend: %v", err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()++ session, err := backend.Execute(ctx, "task", ExecOptions{+ Timeout: 5 * time.Second,+ CustomArgs: []string{"acp", "--yolo", "--permission-mode", "bypass", "-p", "--add-dir", "/tmp/extra"},+ })+ if err != nil {+ t.Fatalf("execute: %v", err)+ }+ go func() {+ for range session.Messages {+ }+ }()+ if result := <-session.Result; result.Status != "completed" {+ t.Fatalf("task failed: %s", result.Error)+ }++ raw, err := os.ReadFile(argsFile)+ if err != nil {+ t.Fatalf("read args file: %v", err)+ }+ lines := strings.Split(strings.TrimSpace(string(raw)), "\n")+ if len(lines) < 1 || lines[0] != "acp" {+ t.Fatalf("argv = %q, want acp first", lines)+ }+ if c := countTokens(lines, "acp"); c != 1 {+ t.Errorf("expected exactly one acp, got %d (%q)", c, lines)+ }+ for _, blocked := range []string{"--yolo", "--permission-mode", "bypass", "-p"} {+ for _, got := range lines {+ if got == blocked {+ t.Errorf("blocked custom arg %q survived: %q", blocked, lines)+ }+ }+ }+ if !strings.Contains(strings.Join(lines, " "), "--add-dir /tmp/extra") {+ t.Errorf("expected allowed --add-dir to survive, got %q", lines)+ }+}++func TestDevinPassesModelFlag(t *testing.T) {+ t.Parallel()+ tempDir := t.TempDir()+ argsFile := filepath.Join(tempDir, "argv.txt")+ fakePath := filepath.Join(tempDir, "devin")+ writeTestExecutable(t, fakePath, []byte(fakeDevinACPScript()))++ backend, err := New("devin", Config{+ ExecutablePath: fakePath,+ Logger: slog.Default(),+ Env: map[string]string{"DEVIN_ARGS_FILE": argsFile},+ })+ if err != nil {+ t.Fatalf("new devin backend: %v", err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)+ defer cancel()+ session, err := backend.Execute(ctx, "task", ExecOptions{+ Timeout: 5 * time.Second,+ Model: "swe-1.7-lightning",+ })+ if err != nil {+ t.Fatalf("execute: %v", err)+ }+ go func() {+ for range session.Messages {+ }+ }()+ if result := <-session.Result; result.Status != "completed" {+ t.Fatalf("task failed: %s", result.Error)+ }+ raw, err := os.ReadFile(argsFile)+ if err != nil {+ t.Fatalf("read args: %v", err)+ }+ got := strings.Join(strings.Split(strings.TrimSpace(string(raw)), "\n"), " ")+ if got != "acp --model swe-1.7-lightning" {+ t.Fatalf("argv = %q, want acp --model swe-1.7-lightning", got)+ }+}++func TestSelectDevinAuthMethod(t *testing.T) {+ t.Parallel()+ for _, methods := range [][]string{nil, {"windsurf-api-key"}, {"cached-login"}, {"devin-cli"}, {"local"}, {"login"}, {"devin-browser"}, {"future-auth"}, {"devin-browser", "windsurf-api-key"}} {+ for _, haveKey := range []bool{false, true} {+ want := ""+ for _, method := range methods {+ if method == "windsurf-api-key" && haveKey {+ want = method+ }+ }+ if got := selectDevinAuthMethod(methods, haveKey); got != want {+ t.Errorf("methods=%v haveKey=%v: got %q want %q", methods, haveKey, got, want)+ }+ }+ }+}++func TestParseDevinModels(t *testing.T) {+ t.Parallel()+ got, err := parseDevinModels([]byte(`{"models":[{"id":"kimi-k2.5","name":"Kimi K2.5"}]}`))+ if err != nil {+ t.Fatal(err)+ }+ if len(got) != 1 || got[0].ID != "kimi-k2.5" || got[0].Label != "Kimi K2.5" {+ t.Fatalf("got %+v", got)+ }+ got, err = parseDevinModels([]byte(`[{"id":"opus","label":"Opus"}]`))+ if err != nil || len(got) != 1 || got[0].Label != "Opus" {+ t.Fatalf("array form: %+v err %v", got, err)+ }+ got, err = parseDevinModels([]byte(`{"families":[{"slug":"kimi-k3","variants":[{"model_uid":"kimi-k3-high","label":"Kimi K3 High"}]}]}`))+ if err != nil || len(got) != 1 || got[0].ID != "kimi-k3-high" || got[0].Provider != "kimi-k3" {+ t.Fatalf("families form: %+v err %v", got, err)+ }+}diff --git a/server/pkg/agent/hermes_escaped_holder_unix_test.go b/server/pkg/agent/hermes_escaped_holder_unix_test.goindex c455de3d29..eca00cd01f 100644--- a/server/pkg/agent/hermes_escaped_holder_unix_test.go+++ b/server/pkg/agent/hermes_escaped_holder_unix_test.go@@ -142,6 +142,11 @@ func TestHermesBackendClosesSessionWhenEarlyFailureLeavesEscapedHolder(t *testin// left the agent's process group.func startHermesWithEscapedHolder(t *testing.T, cases string) (*Session, <-chan struct{}) {t.Helper()+ return startACPWithEscapedHolder(t, "hermes", cases)+}++func startACPWithEscapedHolder(t *testing.T, provider, cases string) (*Session, <-chan struct{}) {+ t.Helper()testBinary, err := os.Executable()if err != nil {@@ -149,7 +154,7 @@ func startHermesWithEscapedHolder(t *testing.T, cases string) (*Session, <-chan}dir := t.TempDir()statePath := filepath.Join(dir, "holder-state")- fakePath := filepath.Join(dir, "hermes")+ fakePath := filepath.Join(dir, provider)// The holder is started without redirections on purpose: inheriting fd 1// and 2 is what keeps the daemon's pipes open after their writer is gone.//@@ -172,9 +177,9 @@ done`, spawnHolder)writeTestExecutable(t, fakePath, []byte(script))- backend, err := New("hermes", Config{ExecutablePath: fakePath, Logger: slog.Default()})+ backend, err := New(provider, Config{ExecutablePath: fakePath, Logger: slog.Default()})if err != nil {- t.Fatalf("new hermes backend: %v", err)+ t.Fatalf("new %s backend: %v", provider, err)}ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)t.Cleanup(cancel)diff --git a/server/pkg/agent/kiro.go b/server/pkg/agent/kiro.goindex ec2acea338..85d22ccbc1 100644--- a/server/pkg/agent/kiro.go+++ b/server/pkg/agent/kiro.go@@ -563,6 +563,20 @@ func (b *kiroBackend) Execute(ctx context.Context, prompt string, opts ExecOptioduration := time.Since(startTime)b.cfg.Logger.Info("kiro finished", "pid", cmd.Process.Pid, "status", finalStatus, "duration", duration.Round(time.Millisecond).String())+ // Detecting the header cancels the RPC, not the panic reporter. Give+ // trailing Message/Location writes a bounded chance to reach stderr+ // before closing stdin or killing the process. A live or silent panic+ // may never close stderr; task cancellation must still interrupt this.+ if runtimePanic.Fired() && runCtx.Err() == nil {+ drainTimer := time.NewTimer(kiroReaderDrainGrace)+ select {+ case <-stderrDone:+ case <-runCtx.Done():+ case <-drainTimer.C:+ }+ drainTimer.Stop()+ }+stdin.Close()cancel()diff --git a/server/pkg/agent/kiro_panic_test.go b/server/pkg/agent/kiro_panic_test.goindex f4c6f58f95..c22e897f4a 100644--- a/server/pkg/agent/kiro_panic_test.go+++ b/server/pkg/agent/kiro_panic_test.go@@ -36,6 +36,8 @@ while IFS= read -r line; dosleep 0.3fiprintf '\033[31mThe application panicked (crashed).\033[0m\n' >&2+ if [ -n "$KIRO_PANIC_DETAIL_DELAY" ]; then sleep "$KIRO_PANIC_DETAIL_DELAY"; fi+ if [ -n "$KIRO_PANIC_HEADER_ONLY" ]; then continue; fiprintf 'Message: first agent loop request should never fail: AgentLoopResponse(Custom("invalid conversation history received"))\n' >&2printf 'Location: crates/agent/src/agent/mod.rs:3744\n' >&2if [ -n "$KIRO_PANIC_EXIT" ]; then@@ -136,6 +138,29 @@ func TestKiroPanicThenExitIsStillClassifiedAsPanic(t *testing.T) {}}+func TestKiroPanicDetailsMayFollowHeaderInLaterWrites(t *testing.T) {+ for _, exit := range []bool{false, true} {+ t.Run(map[bool]string{false: "live-process", true: "exiting-process"}[exit], func(t *testing.T) {+ env := map[string]string{"KIRO_PANIC_DETAIL_DELAY": "0.05"}+ if exit {+ env["KIRO_PANIC_EXIT"] = "1"+ }+ result, _ := runKiroPanicScript(t, env, ExecOptions{ResumeSessionID: "ses_broken"})+ if result.Status != "failed" || !result.ResumeRejected || !taskfailure.UnresumableHistory(result.Error) ||+ !strings.Contains(result.Error, "Location: crates/agent/src/agent/mod.rs:3744") {+ t.Fatalf("panic details were lost before process termination: %+v", result)+ }+ })+ }+}++func TestKiroPanicHeaderWithoutDetailsStillFailsFast(t *testing.T) {+ result, elapsed := runKiroPanicScript(t, map[string]string{"KIRO_PANIC_HEADER_ONLY": "1"}, ExecOptions{})+ if result.Status != "failed" || result.ResumeRejected || !strings.Contains(result.Error, "The application panicked") || elapsed > 10*time.Second {+ t.Fatalf("waiting for panic details did not stay bounded: result=%+v elapsed=%s", result, elapsed)+ }+}+// TestKiroFreshSessionPanicDoesNotRejectResume: a cold session cannot be// "resume rejected". It must still fail fast instead of hanging.func TestKiroFreshSessionPanicDoesNotRejectResume(t *testing.T) {diff --git a/server/pkg/agent/launch.go b/server/pkg/agent/launch.goindex 22a26feeb6..fd510849a4 100644--- a/server/pkg/agent/launch.go+++ b/server/pkg/agent/launch.go@@ -465,6 +465,7 @@ var launchPrefixBlockedArgs = map[string]map[string]blockedArgMode{"reasonix": reasonixBlockedArgs,"traecli": traecliBlockedArgs,"dim": dimBlockedArgs,+ "devin": devinBlockedArgs,"zeroclaw": zeroclawBlockedArgs,}diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.goindex 03ad69be1b..a738388fb7 100644--- a/server/pkg/agent/models.go+++ b/server/pkg/agent/models.go@@ -304,6 +304,10 @@ func ListModels(ctx context.Context, providerType string, runtimeCmd Command) (C// makes model selection session-scoped, restore a discovery helper// here modelled on discoverTraecliModels.return Catalog{Models: []Model{}}, nil+ case "devin":+ return cachedDiscovery(discoveryCacheKey(providerType, runtimeCmd), func() (Catalog, error) {+ return discovered(discoverDevinModels(ctx, runtimeCmd))+ })case "mcode":// MCode's ACP server does not expose session-scoped model selection or// a model catalog. The configured MCode runtime owns the model choice.diff --git a/server/pkg/agent/version.go b/server/pkg/agent/version.goindex 3d892a5ed9..20d713590f 100644--- a/server/pkg/agent/version.go+++ b/server/pkg/agent/version.go@@ -18,14 +18,15 @@ import (var MinVersions = map[string]string{"antigravity": "1.1.10", // stream-json usage plus reliable headless --model selection"claude": "2.0.0",- "codex": "0.100.0", // app-server --listen stdio:// added in 0.100.0- "copilot": "1.0.0", // --output-format json envelope stable from 1.0.x- "grok": "0.2.89", // ACP + authenticate/session-load/set_model/MCP and --effort thinking flag- "qwen": "0.20.0", // stream-json protocol captured and verified against Qwen Code 0.20.0- "dim": "0.3.10", // cross-run session/load: per-process lock releases on graceful exit- "mcode": "0.1.2", // ACP v1 session/new, prompt, MCP capability forwarding- "muse": "1.4.10", // MSP stable surface: session/start, turn/start, item stream- "zeroclaw": "0.8.0", // persistent ACP sessions and session/resume were added in 0.8.0+ "codex": "0.100.0", // app-server --listen stdio:// added in 0.100.0+ "copilot": "1.0.0", // --output-format json envelope stable from 1.0.x+ "grok": "0.2.89", // ACP + authenticate/session-load/set_model/MCP and --effort thinking flag+ "qwen": "0.20.0", // stream-json protocol captured and verified against Qwen Code 0.20.0+ "dim": "0.3.10", // cross-run session/load: per-process lock releases on graceful exit+ "mcode": "0.1.2", // ACP v1 session/new, prompt, MCP capability forwarding+ "muse": "1.4.10", // MSP stable surface: session/start, turn/start, item stream+ "devin": "3000.3.22", // devin acp --model was introduced in 3000.3.22+ "zeroclaw": "0.8.0", // persistent ACP sessions and session/resume were added in 0.8.0// opencode: honors TMPDIR/TMP/TEMP from 1.1.54. Earlier builds ignore all// three when their embedded Bun runtime extracts a native module, writing// into the shared system temp dir whatever the daemon exports — one 4-8 MB