Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6273: feat(agent): add MiniMax Code ACP runtime (#7035)
DanielWalnutde902a4aab8a
diff --git a/CLI_AND_DAEMON.md b/CLI_AND_DAEMON.mdindex 6e565fd5a9..ffe3ce2066 100644--- a/CLI_AND_DAEMON.md+++ b/CLI_AND_DAEMON.md@@ -224,6 +224,7 @@ The daemon auto-detects these AI CLIs on your PATH:| [Grok Build CLI](https://docs.x.ai/) | `grok` | xAI Grok Build CLI (ACP via `grok agent stdio`) || [Qwen Code](https://github.com/QwenLM/qwen-code) | `qwen` | Alibaba Qwen Code (`qwen -p` with stream-json) || [QwenPaw](https://github.com/agentscope-ai/QwenPaw) | `qwenpaw` | QwenPaw ACP coding agent (ACP via `qwenpaw acp`; model is fixed by its own configuration) |+| [MiniMax Code](https://github.com/MiniMax-AI/minimax-code) | `mcode` | MiniMax Code ACP coding agent (ACP via `mcode acp`; model is managed by MCode) || [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) | `dsh` | DeepSeek Harness (`dsh --profile multica --stdio`; requires the Multica runtime profile to be installed; reads AGENTS.md and .dsh/skills/) |You need at least one installed. The daemon registers each detected CLI as an available runtime.@@ -331,6 +332,7 @@ Agent-specific overrides:| `MULTICA_QWEN_ARGS` | Daemon-wide extra Qwen arguments (POSIX shellword parsing; managed protocol flags are filtered) || `MULTICA_QWENPAW_PATH` | Custom path to the `qwenpaw` binary || `MULTICA_QWENPAW_ARGS` | Daemon-wide extra QwenPaw arguments (POSIX shellword parsing; managed protocol flags are filtered) |+| `MULTICA_MCODE_PATH` | Custom path to the `mcode` binary || `MULTICA_DSH_PATH` | Custom path to the `dsh` binary || `MULTICA_DSH_MODEL` | Override the DeepSeek Harness model used (a model id from the dsh catalog, e.g. `deepseek-official/deepseek-chat`) |@@ -341,7 +343,7 @@ The daemon launches Qwen Code as `qwen -p <prompt> --output-format stream-json`.#### `mcp_config` on ACP runtimes-ACP-family runtimes — Hermes, Kimi, Kiro, Grok, Qoder, Reasonix, Trae, Qwenpaw, and any custom runtime profile whose `protocol_family` is one of them — receive MCP servers **over the ACP session protocol**, not through a config file. The daemon translates the agent's `mcp_config` into ACP's `McpServer` array and sends it with `session/new`, and again with that runtime's resume request (`session/resume` on Hermes, Kimi, Qoder and Reasonix; `session/load` on Kiro, Grok, Trae and Qwenpaw) so a resumed task keeps the same tools.+ACP-family runtimes — Hermes, Kimi, Kiro, Grok, Qoder, Reasonix, Trae, QwenPaw, MiniMax Code, and any custom runtime profile whose `protocol_family` is one of them — receive MCP servers **over the ACP session protocol**, not through a config file. The daemon translates the agent's `mcp_config` into ACP's `McpServer` array and sends it with `session/new`, and again with that runtime's resume request (`session/resume` on Hermes, Kimi, Qoder and Reasonix; `session/load` on Kiro, Grok, Trae and QwenPaw) so a resumed task keeps the same tools. MiniMax Code 0.1.2 advertises no session-loading capability, so a later run falls back to a fresh session.Nothing is written to the runtime's own config file, and the runtime's own file is not read or merged. `~/.hermes/…`, `~/.jcode/mcp.json` and the like stay untouched; an agent's servers travel with its tasks instead of being installed per machine.@@ -355,6 +357,8 @@ If a configured server produces no tools, check the daemon log for those warningThe daemon launches QwenPaw as `qwenpaw acp --workspace <per-task dir>`. It writes the task brief to `AGENTS.md`, and materialises the run's bound skills into `<per-task dir>/skills/` plus a `skill.json` manifest, so QwenPaw discovers them through its own workspace skill discovery. `acp` and `--workspace` are reserved: `custom_args` cannot override them. QwenPaw is the one runtime with no `MULTICA_QWENPAW_MODEL`: its `session/set_model` writes to a shared, persistent agent config rather than the session, so Multica never sends it a model and leaves that choice to QwenPaw's own configuration.+The daemon launches MiniMax Code as `mcode acp`, writes the task brief to `AGENTS.md`, and injects bound skills under `.minimax/skills/`. MCode owns model selection and currently advertises `loadSession: false`; Multica therefore starts a fresh MCode session when a later run cannot load the saved session.+#### Hermes agent memoryHermes discovers skills only from its own home, so binding Multica skills to a Hermes agent makes the daemon build a per-task `HERMES_HOME` overlay for that agent. The agent's long-term memory (`memories/`) does **not** live inside that task-scoped overlay: it is linked to a persistent store atdiff --git a/README.md b/README.mdindex 4e6b75297d..b0fb09b167 100644--- a/README.md+++ b/README.md@@ -162,6 +162,7 @@ authenticated, so switching providers is a dropdown, not a migration.| Qwen Code | `qwen` | QwenPaw | `qwenpaw` || Reasonix | `reasonix` | Trae CLI | `traecli` || DeepSeek Harness | `dsh` | Oh-My-Pi | `omp` |+| MiniMax Code | `mcode` | — | — |Installing and authenticating them: [Install an agent runtime](https://multica.ai/docs/install-agent-runtime) ·[Providers](https://multica.ai/docs/providers)diff --git a/SELF_HOSTING.md b/SELF_HOSTING.mdindex 888b721c8a..6310c97d74 100644--- a/SELF_HOSTING.md+++ b/SELF_HOSTING.md@@ -129,6 +129,7 @@ You also need at least one AI agent CLI installed:- [Grok Build CLI](https://docs.x.ai/) (`grok` on PATH)- Qwen Code (`qwen` on PATH)- [QwenPaw](https://github.com/agentscope-ai/QwenPaw) (`qwenpaw` on PATH; pick its model in QwenPaw's own configuration)+- [MiniMax Code CLI](https://www.npmjs.com/package/@minimax-ai/code) (`mcode` 0.1.2+ on PATH). Install a supported Node.js release (`>=22.19 <23` or `>=24 <27`), run `npm install --global @minimax-ai/code@latest`, then `mcode login`.- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh` on PATH with the Multica runtime profile installed; set `DEEPSEEK_API_KEY`)### b) One-command setupdiff --git a/apps/docs/content/docs/environment-variables.ja.mdx b/apps/docs/content/docs/environment-variables.ja.mdxindex 6533f2cf3d..46e8c0d66d 100644--- a/apps/docs/content/docs/environment-variables.ja.mdx+++ b/apps/docs/content/docs/environment-variables.ja.mdx@@ -214,7 +214,7 @@ API key と base URL の両方が空の場合、サーバーサイド LLM 生成| `MULTICA_AGENT_TEMP_BASE` | `/tmp`(Linux/macOS) | Linux/macOS 専用。作業ごとのプライベート一時ディレクトリの親ディレクトリ。既存かつ書き込み可能な絶対パスである必要があり、無効な値の場合は `/tmp` にフォールバックせず作業の開始に失敗します。短いパスを選んでください。子ツールがその配下に AF_UNIX ソケットを作成する場合があり、`sun_path` の上限は Linux で 108 バイト、macOS で 104 バイトです || `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | デバッグ用にタスクディレクトリを保持 |-各 AI コーディングツールは `MULTICA_<PROVIDER>_PATH` と `MULTICA_<PROVIDER>_MODEL` でコマンドパスとデフォルトモデルを上書きできます。QwenPaw だけは例外で、Multica がモデルを渡さないため `MULTICA_QWENPAW_MODEL` はありません。詳しくは [AI コーディングツール比較](/providers#モデルの取得元) を参照してください。DeepSeek Harness は `MULTICA_DSH_PATH` と `MULTICA_DSH_MODEL` に対応しています(値は dsh のモデルカタログにあるモデル ID、例: `deepseek-official/deepseek-chat`)。マシン全体のデフォルト引数 `MULTICA_<PROVIDER>_ARGS` は、現在 Claude Code、Codex、CodeBuddy、Qwen Code、QwenPaw の 5 ツールに対応しています。対応する変数は `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS`、`MULTICA_QWEN_ARGS`、`MULTICA_QWENPAW_ARGS` です。例:+各 AI コーディングツールは `MULTICA_<PROVIDER>_PATH` でコマンドパスを上書きでき、モデル上書き対応ツールでは `MULTICA_<PROVIDER>_MODEL` も利用できます。QwenPaw と MiniMax Code にはモデル変数がなく、MiniMax Code のパス変数は `MULTICA_MCODE_PATH` です。詳しくは [AI コーディングツール比較](/providers#モデルの取得元) を参照してください。DeepSeek Harness は `MULTICA_DSH_PATH` と `MULTICA_DSH_MODEL` に対応しています(値は dsh のモデルカタログにあるモデル ID、例: `deepseek-official/deepseek-chat`)。マシン全体のデフォルト引数 `MULTICA_<PROVIDER>_ARGS` は、現在 Claude Code、Codex、CodeBuddy、Qwen Code、QwenPaw の 5 ツールに対応しています。対応する変数は `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS`、`MULTICA_QWEN_ARGS`、`MULTICA_QWENPAW_ARGS` です。例:```dotenvMULTICA_CLAUDE_PATH=/opt/bin/claudediff --git a/apps/docs/content/docs/environment-variables.ko.mdx b/apps/docs/content/docs/environment-variables.ko.mdxindex 437a881e63..97138ede16 100644--- a/apps/docs/content/docs/environment-variables.ko.mdx+++ b/apps/docs/content/docs/environment-variables.ko.mdx@@ -214,7 +214,7 @@ API key와 base URL이 모두 비어 있으면 서버 측 LLM 생성이 꺼지| `MULTICA_AGENT_TEMP_BASE` | `/tmp`(Linux/macOS) | Linux/macOS 전용. 작업별 비공개 임시 디렉터리의 상위 디렉터리입니다. 기존의 쓰기 가능한 절대 경로여야 하며, 값이 잘못되면 `/tmp`로 대체하지 않고 작업 시작에 실패합니다. 짧은 경로를 선택하세요. 하위 도구가 그 아래에 AF_UNIX 소켓을 만들 수 있으며 `sun_path` 제한은 Linux에서 108바이트, macOS에서 104바이트입니다 || `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | 디버깅을 위해 실행 태스크 디렉터리 유지 |-각 AI 코딩 도구는 `MULTICA_<PROVIDER>_PATH`와 `MULTICA_<PROVIDER>_MODEL`로 명령 경로와 기본 모델을 덮어쓸 수 있습니다. QwenPaw만 예외로, Multica가 모델을 전달하지 않기 때문에 `MULTICA_QWENPAW_MODEL`이 없습니다. 자세한 내용은 [AI 코딩 도구 비교](/providers#모델-출처)를 참고하세요. DeepSeek Harness는 `MULTICA_DSH_PATH`와 `MULTICA_DSH_MODEL`을 지원합니다(값은 dsh 모델 카탈로그의 모델 ID, 예: `deepseek-official/deepseek-chat`). 컴퓨터 전체 기본 인수 `MULTICA_<PROVIDER>_ARGS`는 현재 Claude Code, Codex, CodeBuddy, Qwen Code, QwenPaw 다섯 도구를 지원합니다. 해당 변수는 `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, `MULTICA_QWEN_ARGS`, `MULTICA_QWENPAW_ARGS`입니다. 예시:+각 AI 코딩 도구는 `MULTICA_<PROVIDER>_PATH`로 명령 경로를 덮어쓸 수 있으며 모델 재정의를 지원하는 도구는 `MULTICA_<PROVIDER>_MODEL`도 사용할 수 있습니다. QwenPaw와 MiniMax Code에는 모델 변수가 없고 MiniMax Code의 경로 변수는 `MULTICA_MCODE_PATH`입니다. 자세한 내용은 [AI 코딩 도구 비교](/providers#모델-출처)를 참고하세요. DeepSeek Harness는 `MULTICA_DSH_PATH`와 `MULTICA_DSH_MODEL`을 지원합니다(값은 dsh 모델 카탈로그의 모델 ID, 예: `deepseek-official/deepseek-chat`). 컴퓨터 전체 기본 인수 `MULTICA_<PROVIDER>_ARGS`는 현재 Claude Code, Codex, CodeBuddy, Qwen Code, QwenPaw 다섯 도구를 지원합니다. 해당 변수는 `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, `MULTICA_QWEN_ARGS`, `MULTICA_QWENPAW_ARGS`입니다. 예시:```dotenvMULTICA_CLAUDE_PATH=/opt/bin/claudediff --git a/apps/docs/content/docs/environment-variables.mdx b/apps/docs/content/docs/environment-variables.mdxindex 636d418348..3eacefaa90 100644--- a/apps/docs/content/docs/environment-variables.mdx+++ b/apps/docs/content/docs/environment-variables.mdx@@ -214,7 +214,7 @@ The variables below are read on the computer that runs your agents, not in the A| `MULTICA_AGENT_TEMP_BASE` | `/tmp` (Linux/macOS) | Linux/macOS only. Parent directory for private per-task temp dirs; must be an existing, writable absolute directory, and an invalid value fails task startup instead of falling back to `/tmp`. Pick a short path — child tools may bind AF_UNIX sockets under it, and `sun_path` is limited to 108 bytes on Linux and 104 on macOS || `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | Keep task directories for debugging |-Each AI coding tool accepts `MULTICA_<PROVIDER>_PATH` and `MULTICA_<PROVIDER>_MODEL` to override the command path and default model. QwenPaw is the exception: it has no `MULTICA_QWENPAW_MODEL`, because Multica never sends it a model — see [AI coding tools comparison](/providers#model-sources). DeepSeek Harness supports `MULTICA_DSH_PATH` and `MULTICA_DSH_MODEL` (a model id from the dsh catalog, e.g. `deepseek-official/deepseek-chat`). Machine-wide default arguments via `MULTICA_<PROVIDER>_ARGS` are currently supported for five tools: Claude Code, Codex, CodeBuddy, Qwen Code, and QwenPaw. The variables are `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, `MULTICA_QWEN_ARGS`, and `MULTICA_QWENPAW_ARGS`. For example:+Each AI coding tool accepts `MULTICA_<PROVIDER>_PATH` and, when model overrides are supported, `MULTICA_<PROVIDER>_MODEL`. QwenPaw and MiniMax Code have no model variable because Multica never sends them a model; MiniMax Code's path variable is `MULTICA_MCODE_PATH` — see [AI coding tools comparison](/providers#model-sources). DeepSeek Harness supports `MULTICA_DSH_PATH` and `MULTICA_DSH_MODEL` (a model id from the dsh catalog, e.g. `deepseek-official/deepseek-chat`). Machine-wide default arguments via `MULTICA_<PROVIDER>_ARGS` are currently supported for five tools: Claude Code, Codex, CodeBuddy, Qwen Code, and QwenPaw. The variables are `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, `MULTICA_QWEN_ARGS`, and `MULTICA_QWENPAW_ARGS`. For example:```dotenvMULTICA_CLAUDE_PATH=/opt/bin/claudediff --git a/apps/docs/content/docs/environment-variables.zh.mdx b/apps/docs/content/docs/environment-variables.zh.mdxindex 128bf5d1fe..f2ca1a7479 100644--- a/apps/docs/content/docs/environment-variables.zh.mdx+++ b/apps/docs/content/docs/environment-variables.zh.mdx@@ -214,7 +214,7 @@ API key 与 base URL 都为空时,服务端 LLM 生成关闭,调用方会使| `MULTICA_AGENT_TEMP_BASE` | `/tmp`(Linux/macOS) | 仅适用于 Linux/macOS。私有 task 临时目录的父目录;必须是现有、可写的绝对路径,无效值会使 task 启动失败,不会回退到 `/tmp`。请选择较短的路径——子工具可能会在其中绑定 AF_UNIX socket;Linux 的 `sun_path` 上限为 108 字节,macOS 为 104 字节 || `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | 保留执行任务目录用于调试 |-各 AI 编程工具可以使用 `MULTICA_<PROVIDER>_PATH` 和 `MULTICA_<PROVIDER>_MODEL` 覆盖命令路径与默认模型。QwenPaw 是例外:它没有 `MULTICA_QWENPAW_MODEL`,因为 Multica 不会向它传模型,详见 [AI 编程工具对比](/providers#模型来源)。DeepSeek Harness 支持 `MULTICA_DSH_PATH` 和 `MULTICA_DSH_MODEL`(取值为 dsh 模型目录中的模型 id,例如 `deepseek-official/deepseek-chat`)。全机默认参数 `MULTICA_<PROVIDER>_ARGS` 目前支持 Claude Code、Codex、CodeBuddy、Qwen Code 和 QwenPaw 五款工具。对应变量是 `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS`、`MULTICA_QWEN_ARGS` 和 `MULTICA_QWENPAW_ARGS`。例如:+各 AI 编程工具可以使用 `MULTICA_<PROVIDER>_PATH` 覆盖命令路径;支持模型覆盖的工具还可以使用 `MULTICA_<PROVIDER>_MODEL`。QwenPaw 和 MiniMax Code 没有模型变量,因为 Multica 不会向它们传模型;MiniMax Code 的路径变量是 `MULTICA_MCODE_PATH`。详见 [AI 编程工具对比](/providers#模型来源)。DeepSeek Harness 支持 `MULTICA_DSH_PATH` 和 `MULTICA_DSH_MODEL`(取值为 dsh 模型目录中的模型 id,例如 `deepseek-official/deepseek-chat`)。全机默认参数 `MULTICA_<PROVIDER>_ARGS` 目前支持 Claude Code、Codex、CodeBuddy、Qwen Code 和 QwenPaw 五款工具。对应变量是 `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS`、`MULTICA_QWEN_ARGS` 和 `MULTICA_QWENPAW_ARGS`。例如:```dotenvMULTICA_CLAUDE_PATH=/opt/bin/claudediff --git a/apps/docs/content/docs/install-agent-runtime.ja.mdx b/apps/docs/content/docs/install-agent-runtime.ja.mdxindex 5d717a3924..be18dde68c 100644--- a/apps/docs/content/docs/install-agent-runtime.ja.mdx+++ b/apps/docs/content/docs/install-agent-runtime.ja.mdx@@ -27,6 +27,7 @@ Multica は現在、次のコマンドを検出します。| Hermes Agent | `hermes` | [Hermes クイックスタート](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) || Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) || 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) || 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) |@@ -48,12 +49,14 @@ Reasonix を使う場合は、デーモンを起動する前に `reasonix setup`QwenPaw を使う場合は、QwenPaw 側の設定でプロバイダーとモデルを選んでください。Multica が実行時に QwenPaw のモデルを上書きすることはできません。+MiniMax Code を使う場合は、対応する Node.js バージョン(`>=22.19 <23` または `>=24 <27`)をインストールし、`npm install --global @minimax-ai/code@latest` を実行してください。npm のグローバルインストールによって `mcode` は npm のグローバル実行ファイルディレクトリに配置されます。`command -v mcode` または `Get-Command mcode` で見つからない場合は、そのディレクトリを `PATH` に追加してください。その後 `mcode login` を実行します。モデルは MiniMax Code が管理し、Multica から ACP 経由で上書きすることはできません。+DeepSeek Harness を使う場合は、Node.js 20+ をインストールして `npm install -g @deepseek-ai/dsh` を実行し、Multica ランタイムプロファイルを追加してください(`dsh plugin --profile multica add <bundle>`)。デーモンは `dsh --profile multica --probe` が成功した場合のみ DeepSeek Harness を登録します。デーモンを起動する前に `DEEPSEEK_API_KEY` を設定(または dsh の設定に保存)してください。ログイン情報はツールがローカル環境に保存します。Multica が Claude、Codex、Cursor などの CLI のログイントークンを受け取ることはありません。<Callout type="info">-Claude Code は 2.0.0 以降、Codex は 0.100.0 以降、Copilot は 1.0.0 以降、Grok は 0.2.89 以降、Qwen Code は 0.20.0 以降が必要です。最低バージョンを満たしていない場合、デーモンはそのランタイムを登録しません。+Claude Code は 2.0.0 以降、Codex は 0.100.0 以降、Copilot は 1.0.0 以降、Grok は 0.2.89 以降、Qwen Code は 0.20.0 以降、MiniMax Code は 0.1.2 以降が必要です。最低バージョンを満たしていない場合、デーモンはそのランタイムを登録しません。</Callout>## 3. デーモンからコマンドを見つけられることを確認するdiff --git a/apps/docs/content/docs/install-agent-runtime.ko.mdx b/apps/docs/content/docs/install-agent-runtime.ko.mdxindex ec89ab3323..8da6431300 100644--- a/apps/docs/content/docs/install-agent-runtime.ko.mdx+++ b/apps/docs/content/docs/install-agent-runtime.ko.mdx@@ -27,6 +27,7 @@ Multica는 현재 다음 명령을 감지합니다.| Hermes Agent | `hermes` | [Hermes 빠른 시작](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) || Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) || 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) || 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) |@@ -48,12 +49,14 @@ Reasonix를 사용할 때는 데몬을 시작하기 전에 `reasonix setup`을QwenPaw를 사용할 때는 QwenPaw 자체 설정에서 공급자와 모델을 선택하세요. Multica는 실행 시 QwenPaw의 모델을 덮어쓸 수 없습니다.+MiniMax Code를 사용하려면 지원되는 Node.js 버전(`>=22.19 <23` 또는 `>=24 <27`)을 설치한 뒤 `npm install --global @minimax-ai/code@latest`를 실행하세요. npm 전역 설치는 `mcode`를 npm의 전역 실행 파일 디렉터리에 추가합니다. `command -v mcode` 또는 `Get-Command mcode`에서 찾지 못하면 해당 디렉터리를 `PATH`에 추가하세요. 그다음 `mcode login`을 실행합니다. 모델은 MiniMax Code가 관리하며 Multica는 ACP를 통해 이를 덮어쓸 수 없습니다.+DeepSeek Harness를 사용하려면 Node.js 20+를 설치하고 `npm install -g @deepseek-ai/dsh`를 실행한 뒤 Multica 런타임 프로필을 추가하세요(`dsh plugin --profile multica add <bundle>`). 데몬은 `dsh --profile multica --probe`가 성공한 경우에만 DeepSeek Harness를 등록합니다. 데몬을 시작하기 전에 `DEEPSEEK_API_KEY`를 설정(또는 dsh 자체 설정에 저장)하세요.로그인 자격 증명은 도구가 로컬에 저장합니다. Multica는 Claude, Codex, Cursor 또는 다른 CLI의 로그인 token을 받지 않습니다.<Callout type="info">-Claude Code는 2.0.0 이상, Codex는 0.100.0 이상, Copilot은 1.0.0 이상, Grok은 0.2.89 이상, Qwen Code는 0.20.0 이상이 필요합니다. 최소 버전보다 낮으면 데몬이 해당 런타임을 등록하지 않습니다.+Claude Code는 2.0.0 이상, Codex는 0.100.0 이상, Copilot은 1.0.0 이상, Grok은 0.2.89 이상, Qwen Code는 0.20.0 이상, MiniMax Code는 0.1.2 이상이 필요합니다. 최소 버전보다 낮으면 데몬이 해당 런타임을 등록하지 않습니다.</Callout>## 3. 데몬이 명령을 찾을 수 있는지 확인diff --git a/apps/docs/content/docs/install-agent-runtime.mdx b/apps/docs/content/docs/install-agent-runtime.mdxindex 96003cbb4b..dc1ce88f51 100644--- a/apps/docs/content/docs/install-agent-runtime.mdx+++ b/apps/docs/content/docs/install-agent-runtime.mdx@@ -27,6 +27,7 @@ Multica currently detects these commands:| Hermes Agent | `hermes` | [Hermes quickstart](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) || Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) || Kiro CLI | `kiro-cli` | [Install Kiro CLI](https://kiro.dev/docs/cli/installation/) |+| MiniMax Code | `mcode` | [Install MiniMax Code CLI](https://www.npmjs.com/package/@minimax-ai/code) || OpenClaw | `openclaw` | [Install OpenClaw](https://docs.openclaw.ai/install) || OpenCode | `opencode` | [OpenCode quickstart](https://opencode.ai/en/docs) || Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |@@ -48,12 +49,14 @@ For Reasonix, run `reasonix setup` and configure a default provider and model beFor QwenPaw, choose the provider and model in QwenPaw's own configuration. Multica cannot override a QwenPaw model at run time.+For MiniMax Code, install a supported Node.js release (`>=22.19 <23` or `>=24 <27`) and run `npm install --global @minimax-ai/code@latest`. A global npm install places `mcode` on npm's global binary path; if `command -v mcode` or `Get-Command mcode` cannot find it, add that path to `PATH`. Then run `mcode login`. MiniMax Code owns the model selection; Multica cannot override it through ACP.+For DeepSeek Harness, install Node.js 20+ and run `npm install -g @deepseek-ai/dsh`, then add the Multica runtime profile to it (`dsh plugin --profile multica add <bundle>`). The daemon registers DeepSeek Harness only after `dsh --profile multica --probe` succeeds. Set `DEEPSEEK_API_KEY` (or store it in dsh's own settings) before starting the daemon.Those login credentials are stored locally by the tool itself. Multica never receives login tokens from Claude, Codex, Cursor, or any other CLI.<Callout type="info">-Claude Code requires 2.0.0 or later, Codex 0.100.0 or later, Copilot 1.0.0 or later, Grok 0.2.89 or later, and Qwen Code 0.20.0 or later. Below the minimum version, the daemon does not register the corresponding runtime.+Claude Code requires 2.0.0 or later, Codex 0.100.0 or later, Copilot 1.0.0 or later, Grok 0.2.89 or later, Qwen Code 0.20.0 or later, and MiniMax Code 0.1.2 or later. Below the minimum version, the daemon does not register the corresponding runtime.</Callout>## 3. Confirm the daemon can find the commanddiff --git a/apps/docs/content/docs/install-agent-runtime.zh.mdx b/apps/docs/content/docs/install-agent-runtime.zh.mdxindex 20a6f4524d..d34b76f2e1 100644--- a/apps/docs/content/docs/install-agent-runtime.zh.mdx+++ b/apps/docs/content/docs/install-agent-runtime.zh.mdx@@ -27,6 +27,7 @@ Multica 当前会检测以下命令:| Hermes Agent | `hermes` | [Hermes 快速开始](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) || Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) || 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) || 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) |@@ -48,12 +49,14 @@ Multica 当前会检测以下命令:使用 QwenPaw 时,请在 QwenPaw 自身的配置里选择模型服务和模型。Multica 无法在执行时覆盖 QwenPaw 的模型。+使用 MiniMax Code 时,请安装受支持的 Node.js 版本(`>=22.19 <23` 或 `>=24 <27`),并运行 `npm install --global @minimax-ai/code@latest`。全局 npm 安装会把 `mcode` 放入 npm 的全局可执行目录;如果 `command -v mcode` 或 `Get-Command mcode` 找不到它,请将该目录加入 `PATH`。然后运行 `mcode login`。模型由 MiniMax Code 管理,Multica 无法通过 ACP 覆盖它。+使用 DeepSeek Harness 时,请先安装 Node.js 20+ 并运行 `npm install -g @deepseek-ai/dsh`,然后为它安装 Multica 运行时 profile(`dsh plugin --profile multica add <bundle>`)。守护进程只有在 `dsh --profile multica --probe` 成功后才注册 DeepSeek Harness。启动守护进程前请设置 `DEEPSEEK_API_KEY`(或在 dsh 自身设置中保存)。这些登录凭据由工具保存在本机。Multica 不会接收 Claude、Codex、Cursor 或其他 CLI 的登录 token。<Callout type="info">-Claude Code 需要 2.0.0 或更高版本,Codex 需要 0.100.0 或更高版本,Copilot 需要 1.0.0 或更高版本,Grok 需要 0.2.89 或更高版本,Qwen Code 需要 0.20.0 或更高版本。低于最低版本时,守护进程不会注册对应运行时。+Claude Code 需要 2.0.0 或更高版本,Codex 需要 0.100.0 或更高版本,Copilot 需要 1.0.0 或更高版本,Grok 需要 0.2.89 或更高版本,Qwen Code 需要 0.20.0 或更高版本,MiniMax Code 需要 0.1.2 或更高版本。低于最低版本时,守护进程不会注册对应运行时。</Callout>## 3. 确认守护进程能够找到命令diff --git a/apps/docs/content/docs/providers.ja.mdx b/apps/docs/content/docs/providers.ja.mdxindex 7804873006..673894c418 100644--- a/apps/docs/content/docs/providers.ja.mdx+++ b/apps/docs/content/docs/providers.ja.mdx@@ -32,6 +32,7 @@ Multica は、普段使っている AI コーディングツールの代わり| Hermes | `hermes` | ✓ | ✓ | 1 回の実行専用の `HERMES_HOME/skills/` || Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` || Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |+| MiniMax Code | `mcode` | — | ✓ | `.minimax/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | — | `.pi/skills/` |@@ -51,7 +52,7 @@ Multica は、普段使っている AI コーディングツールの代わりモデルを選択しない場合、Multica はそのツールのデフォルト設定を使用します。一覧が空の場合は、ランタイムがオンラインでツールにログイン済みであることを確認してから、モデル一覧を更新してください。-唯一の例外が QwenPaw です。Multica 側で選んだモデルを受け付けないため、選択欄は操作できず「ランタイムで管理」と表示されます。モデルは QwenPaw 側の設定で選んでください。QwenPaw のモデル一覧が空なのは正常であり、ランタイムがオフラインであることを示すものではありません。+QwenPaw と MiniMax Code は例外です。Multica 側で選んだモデルを受け付けないため、選択欄は操作できず「ランタイムで管理」と表示されます。モデルは各ツール側の設定で選んでください。モデル一覧が空なのは正常であり、ランタイムがオフラインであることを示すものではありません。DeepSeek Harness のモデルカタログはランタイム自身が提供します(`dsh --profile multica --list-models`)。モデル ID は `provider/model` 形式(例: `deepseek-official/deepseek-chat`)なので、一覧から完全な ID を選択してください。@@ -61,7 +62,7 @@ DeepSeek Harness のモデルカタログはランタイム自身が提供しま## セッション再開-上記のツールはすべて、後続の実行で既存のセッションを続行できます。ただし、元のセッションが残っており、そのセッションへアクセスできるランタイムでタスクが実行される必要があります。+表で ✓ が付いたツールは、後続の実行で既存のセッションを続行できます。ただし、元のセッションが残っており、そのセッションへアクセスできるランタイムでタスクが実行される必要があります。MiniMax Code 0.1.2 は ACP でセッション読み込み機能を通知しないため、後続の実行では新しい MCode セッションを開始します。Multica はツールから返されたセッション識別子を保存します。次に同じイシューで作業を続けるとき、ランタイムはそのセッションの再開を試みます。再開できない場合は、新しいセッションを作成して実行を続けます。Pi はローカルのセッションファイルパスを保存するため、元のコンピューターとファイルへの依存度が高くなります。diff --git a/apps/docs/content/docs/providers.ko.mdx b/apps/docs/content/docs/providers.ko.mdxindex 256e1a8cf5..ec24e5aa5b 100644--- a/apps/docs/content/docs/providers.ko.mdx+++ b/apps/docs/content/docs/providers.ko.mdx@@ -32,6 +32,7 @@ Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타| Hermes | `hermes` | ✓ | ✓ | 실행별 `HERMES_HOME/skills/` || Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` || Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |+| MiniMax Code | `mcode` | — | ✓ | `.minimax/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | — | `.pi/skills/` |@@ -51,7 +52,7 @@ Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타모델을 선택하지 않으면 Multica가 해당 도구의 기본 설정을 사용합니다. 목록이 비어 있다면 런타임이 온라인이고 도구에 로그인되어 있는지 확인한 뒤 모델 목록을 새로 고치세요.-QwenPaw만 예외입니다. Multica에서 고른 모델을 받아들이지 않으므로 선택 상자가 비활성 상태로 "런타임에서 관리"라고 표시됩니다. 모델은 QwenPaw 자체 설정에서 선택하세요. QwenPaw의 모델 목록이 비어 있는 것은 정상이며 런타임이 오프라인이라는 뜻이 아닙니다.+QwenPaw와 MiniMax Code는 예외입니다. Multica에서 고른 모델을 받아들이지 않으므로 선택 상자가 비활성 상태로 "런타임에서 관리"라고 표시됩니다. 모델은 각 도구의 자체 설정에서 선택하세요. 모델 목록이 비어 있는 것은 정상이며 런타임이 오프라인이라는 뜻이 아닙니다.DeepSeek Harness의 모델 카탈로그는 런타임 자체가 제공합니다(`dsh --profile multica --list-models`). 모델 ID는 `provider/model` 형식(예: `deepseek-official/deepseek-chat`)이므로 목록에서 전체 ID를 선택하세요.@@ -61,7 +62,7 @@ DeepSeek Harness의 모델 카탈로그는 런타임 자체가 제공합니다(`## 세션 복원-위 도구는 모두 이후 실행에서 기존 세션을 이어갈 수 있습니다. 원래 세션이 여전히 존재하고 해당 세션에 접근할 수 있는 런타임이 태스크를 실행해야 합니다.+표에서 ✓로 표시된 도구는 이후 실행에서 기존 세션을 이어갈 수 있습니다. 원래 세션이 여전히 존재하고 해당 세션에 접근할 수 있는 런타임이 태스크를 실행해야 합니다. MiniMax Code 0.1.2는 ACP에서 세션 로드 기능을 알리지 않으므로 이후 실행에서는 새 MCode 세션을 시작합니다.Multica는 도구가 반환한 세션 식별자를 저장합니다. 다음에 같은 이슈에서 작업을 이어갈 때 런타임이 이 세션의 복원을 시도합니다. 복원할 수 없으면 새 세션을 만들어 계속 실행합니다. Pi는 로컬 세션 파일 경로를 저장하므로 원래 컴퓨터와 파일에 더 많이 의존합니다.diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdxindex c2cd1ec16f..d40abcd1e9 100644--- a/apps/docs/content/docs/providers.mdx+++ b/apps/docs/content/docs/providers.mdx@@ -32,6 +32,7 @@ Install steps are in [Install AI coding tools](/install-agent-runtime).| Hermes | `hermes` | ✓ | ✓ | per-task `HERMES_HOME/skills/` || Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` || Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |+| MiniMax Code | `mcode` | — | ✓ | `.minimax/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | — | `.pi/skills/` |@@ -51,7 +52,7 @@ When you create an agent, the model list comes from the corresponding runtime. SIf 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.-QwenPaw is the one exception: it does not accept a model chosen from Multica, so the picker is inert and shows "Managed by runtime". Choose the model in QwenPaw's own configuration instead. An empty model list is expected there and is not a sign that the runtime is offline.+QwenPaw and MiniMax Code 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 is expected there and is not a sign that 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.@@ -61,7 +62,7 @@ Different tools may use different model names. After switching AI coding tools,## Session resumption-All of these tools support continuing an existing session in a later run. The prerequisites are that the original session still exists and the task is executed by a runtime that can reach it.+All tools marked ✓ support continuing an existing session in a later run. The prerequisites are that the original session still exists and the task is executed by a runtime that can reach it. MiniMax Code 0.1.2 advertises no session-loading capability over ACP, so Multica starts a fresh MCode session for a later run.Multica stores the session identifier the tool returns. The next time work continues on the same issue, the runtime tries to resume that session; when it cannot, it creates a new session and keeps going. Pi stores a local session file path, so it depends more on the original computer and file.diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdxindex 65eafc2cd1..3275b56e02 100644--- a/apps/docs/content/docs/providers.zh.mdx+++ b/apps/docs/content/docs/providers.zh.mdx@@ -32,6 +32,7 @@ Multica 不会替代你使用的 AI 编程工具。运行时会调用电脑上| Hermes | `hermes` | ✓ | ✓ | 单次执行的 `HERMES_HOME/skills/` || Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` || Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |+| MiniMax Code | `mcode` | — | ✓ | `.minimax/skills/` || OpenClaw | `openclaw` | ✓ | ✓ | `skills/` || OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` || Pi | `pi` | ✓ | — | `.pi/skills/` |@@ -51,7 +52,7 @@ Multica 不会替代你使用的 AI 编程工具。运行时会调用电脑上不选择模型时,Multica 使用该工具的默认设置。列表为空时,先确认运行时在线并且工具已经登录,再刷新模型列表。-QwenPaw 是唯一的例外:它不接受在 Multica 侧选择的模型,因此选择框不可用,显示为"由运行时管理"。请改在 QwenPaw 自身的配置里选择模型。它的模型列表为空属于正常情况,并不表示运行时离线。+QwenPaw 和 MiniMax Code 是例外:它们不接受在 Multica 侧选择的模型,因此选择框不可用,显示为"由运行时管理"。请改在工具自身的配置里选择模型。模型列表为空属于正常情况,并不表示运行时离线。DeepSeek Harness 的模型目录由运行时自身提供(`dsh --profile multica --list-models`)。它的模型 id 采用 `provider/model` 形式(例如 `deepseek-official/deepseek-chat`),请从列表中选择完整 id。@@ -61,7 +62,7 @@ DeepSeek Harness 的模型目录由运行时自身提供(`dsh --profile multic## 会话恢复-这些工具都支持在后续执行中继续已有会话。前提是原来的会话仍然存在,并且任务由能够访问它的运行时执行。+表格中标记 ✓ 的工具支持在后续执行中继续已有会话。前提是原来的会话仍然存在,并且任务由能够访问它的运行时执行。MiniMax Code 0.1.2 尚未通过 ACP 声明会话加载能力,因此后续执行会新建 MCode 会话。Multica 会保存工具返回的会话标识。下一次在同一 issue 中继续工作时,运行时会尝试恢复这段会话;无法恢复时,会创建一个新会话继续执行。Pi 保存的是本地会话文件路径,因此更依赖原来的电脑和文件。diff --git a/packages/core/agents/mcp-support.test.ts b/packages/core/agents/mcp-support.test.tsindex 5f2cab1fdb..83ebbbaf4b 100644--- a/packages/core/agents/mcp-support.test.ts+++ b/packages/core/agents/mcp-support.test.ts@@ -21,6 +21,7 @@ describe("providerSupportsMcpConfig", () => {expect(providerSupportsMcpConfig("qwenpaw")).toBe(true);expect(providerSupportsMcpConfig("traecli")).toBe(true);expect(providerSupportsMcpConfig("grok")).toBe(true);+ expect(providerSupportsMcpConfig("mcode")).toBe(true);});it("rejects providers whose runtime ignores mcp_config", () => {diff --git a/packages/core/agents/mcp-support.ts b/packages/core/agents/mcp-support.tsindex 728d6b360d..d763b6d854 100644--- a/packages/core/agents/mcp-support.ts+++ b/packages/core/agents/mcp-support.ts@@ -22,6 +22,7 @@ const MCP_SUPPORTED_PROVIDERS = new Set(["qoderclicn","qwen","qwenpaw",+ "mcode","traecli",]);diff --git a/packages/core/runtimes/display.test.ts b/packages/core/runtimes/display.test.tsindex f02a00280e..6c46ad1114 100644--- a/packages/core/runtimes/display.test.ts+++ b/packages/core/runtimes/display.test.ts@@ -100,6 +100,13 @@ describe("runtimeDisplayLabel", () => {provider: "qwenpaw",}),).toBe("box (QwenPaw)");+ expect(+ runtimeDisplayLabel({+ name: "MiniMax Code (host)",+ custom_name: "box",+ provider: "mcode",+ }),+ ).toBe("box (MiniMax Code)");});it("first-letter-capitalizes non-overridden slugs, matching the daemon", () => {diff --git a/packages/core/runtimes/display.ts b/packages/core/runtimes/display.tsindex 7210936758..f49fc0e23a 100644--- a/packages/core/runtimes/display.ts+++ b/packages/core/runtimes/display.ts@@ -37,7 +37,7 @@ export function runtimeDisplayLabel(* (server/internal/daemon/daemon.go): the daemon bakes that display name into* `name` for the no-alias case (for example, "Trae (host)"), so the aliased label has to use* the exact same names or the two paths drift apart (#5260). `qoderclicn`,- * `dsh`, `traecli`, `qwen`, and `qwenpaw` need overrides today — every other provider is a+ * `dsh`, `traecli`, `qwen`, `qwenpaw`, and `mcode` need overrides today — every other provider is a* first-letter capitalization of its slug on both sides. Keep in sync with the daemon map.*/const PROVIDER_DISPLAY_NAMES: Record<string, string> = {@@ -46,6 +46,7 @@ const PROVIDER_DISPLAY_NAMES: Record<string, string> = {traecli: "Trae",qwen: "Qwen Code",qwenpaw: "QwenPaw",+ mcode: "MiniMax Code",omp: "Oh-My-Pi",};diff --git a/packages/core/types/agent.ts b/packages/core/types/agent.tsindex 408cdc7d91..9912d6fd78 100644--- a/packages/core/types/agent.ts+++ b/packages/core/types/agent.ts@@ -128,6 +128,7 @@ export const RUNTIME_PROFILE_PROTOCOL_FAMILIES = ["grok","qwen","qwenpaw",+ "mcode",] as const;export type RuntimeProtocolFamily =diff --git a/scripts/agent-cli-command-names.txt b/scripts/agent-cli-command-names.txtindex 772c739a09..1340b2dccc 100644--- a/scripts/agent-cli-command-names.txt+++ b/scripts/agent-cli-command-names.txt@@ -20,3 +20,4 @@ qoderclicnreasonixtraecliqwenpaw+mcodediff --git a/server/internal/daemon/agents_probe.go b/server/internal/daemon/agents_probe.goindex f22721252e..dac64c6e6c 100644--- a/server/internal/daemon/agents_probe.go+++ b/server/internal/daemon/agents_probe.go@@ -258,6 +258,11 @@ var probeAgentCLIs = func() map[string]AgentEntry {if e, ok := probe("MULTICA_QWENPAW_PATH", "qwenpaw", ""); ok {agents["qwenpaw"] = e}+ // MiniMax Code (`mcode`) exposes an ACP v1 server through `mcode acp`.+ // Model selection is owned by the MCode runtime, so there is no model env.+ if e, ok := probe("MULTICA_MCODE_PATH", "mcode", ""); ok {+ agents["mcode"] = e+ }return agents}diff --git a/server/internal/daemon/config.go b/server/internal/daemon/config.goindex 80b4805822..9fe54719f7 100644--- a/server/internal/daemon/config.go+++ b/server/internal/daemon/config.go@@ -94,7 +94,7 @@ type Config struct {CLIVersion string // multica CLI version (e.g. "0.1.13")LaunchedBy string // "desktop" when spawned by the Electron app, empty for standaloneProfile string // profile name (empty = default)- Agents map[string]AgentEntry // keyed by provider: claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, dsh, kiro, antigravity, qoder, qoderclicn, traecli, grok, qwen, qwenpaw (plus built-in runtime identities from agent.BuiltinRuntimes, e.g. omp)+ Agents map[string]AgentEntry // keyed by provider: claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, dsh, kiro, antigravity, qoder, qoderclicn, traecli, grok, qwen, qwenpaw, mcode (plus built-in runtime identities from agent.BuiltinRuntimes, e.g. omp)WorkspacesRoot string // base path for execution envs (default: ~/multica_workspaces)KeepEnvAfterTask bool // preserve env after task for debuggingHealthPort int // local HTTP port for health checks (default: 19514)@@ -237,7 +237,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, codex, copilot, opencode, deveco, openclaw, hermes, pi, omp, cursor-agent, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, or qwenpaw and ensure it is on PATH")+ return Config{}, fmt.Errorf("no agent CLI found: install claude, codebuddy, codex, copilot, opencode, deveco, openclaw, hermes, pi, omp, cursor-agent, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, qwenpaw, or mcode and ensure it is on PATH")}claudeArgs, err := shellArgsFromEnv("MULTICA_CLAUDE_ARGS")@@ -829,7 +829,7 @@ func isExecutableFile(path string) bool {// doesn't require editing this list by hand.var defaultAgentCommandNames = append([]string{"claude", "codex", "opencode", "deveco", "openclaw", "hermes",- "pi", "cursor-agent", "copilot", "kimi", "reasonix", "dsh", "kiro-cli", "codebuddy", "agy", "qodercli", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw",+ "pi", "cursor-agent", "copilot", "kimi", "reasonix", "dsh", "kiro-cli", "codebuddy", "agy", "qodercli", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw", "mcode",}, agent.BuiltinRuntimeCommands()...)// codexDesktopAppBundlePaths returns candidate macOS app-bundle locations fordiff --git a/server/internal/daemon/daemon.go b/server/internal/daemon/daemon.goindex 53c94e7c07..6fee42f1b3 100644--- a/server/internal/daemon/daemon.go+++ b/server/internal/daemon/daemon.go@@ -5570,6 +5570,7 @@ var runtimeDisplayNameOverrides = map[string]string{"qoderclicn": "Qoder CN","qwen": "Qwen Code","qwenpaw": "QwenPaw",+ "mcode": "MiniMax Code",}func init() {@@ -5607,7 +5608,8 @@ func providerDisplayName(name string) string {// probed each one over its real launch path with a canary in the context file// and no inline delivery: claude 2.1.220 (CLAUDE.md), codex 0.144.6 driving the// app-server (AGENTS.md), opencode 1.17.7 (AGENTS.md), pi 0.67.2 (AGENTS.md),-// hermes 0.18.2 over ACP (AGENTS.md). kiro was confirmed earlier by a kiro-cli+// hermes 0.18.2 over ACP (AGENTS.md). MCode 0.1.2 also loads AGENTS.md by its+// native runtime contract. kiro was confirmed earlier by a kiro-cli// 2.13.0 ACP smoke — see the call site. Still unprobed: grok, qoder, codebuddy.func providerNeedsInlineSystemPrompt(provider string) bool {switch provider {diff --git a/server/internal/daemon/execenv/context.go b/server/internal/daemon/execenv/context.goindex 4acad2665a..ee113838c6 100644--- a/server/internal/daemon/execenv/context.go+++ b/server/internal/daemon/execenv/context.go@@ -136,6 +136,7 @@ func writeWorkspacesRootMarkerAtomic(path string, data []byte) error {// Qoder/Qoder CN: skills → {workDir}/.qoder/skills/{name}/SKILL.md (project-level; see the provider docs)// Qwen Code: skills → {workDir}/.qwen/skills/{name}/SKILL.md (native project-level discovery)// QwenPaw: skills → {workDir}/.qwenpaw/skills/{name}/SKILL.md (native project-level discovery)+// MiniMax Code: skills → {workDir}/.minimax/skills/{name}/SKILL.md (native project-level discovery)// Antigravity: skills → {workDir}/.agents/skills/{name}/SKILL.md (native discovery — see https://antigravity.google/docs/gcli-migration "Workspace skills")// Default: skills → {workDir}/.agent_context/skills/{name}/SKILL.md//@@ -414,6 +415,9 @@ func skillsDirPath(workDir, provider string) string {// QwenPaw discovers workspace-level skills from <workDir>/skill_pool/.// See get_workspace_skills_dir in QwenPaw's skill_system/store.py.return filepath.Join(workDir, "skill_pool")+ case "mcode":+ // MiniMax Code discovers project-level skills from .minimax/skills/.+ return filepath.Join(workDir, ".minimax", "skills")case "traecli":// Official TRAE CLI discovers project-level skills from .traecli/skills/// in the workdir (global skills live in ~/.traecli/skills). Seediff --git a/server/internal/daemon/execenv/execenv_test.go b/server/internal/daemon/execenv/execenv_test.goindex a8221de4a8..17336d0c4b 100644--- a/server/internal/daemon/execenv/execenv_test.go+++ b/server/internal/daemon/execenv/execenv_test.go@@ -888,6 +888,15 @@ func TestReuseSkillRefreshIsCanonicalAcrossProviders(t *testing.T) {}}+func TestMcodeUsesNativeProjectSkillRoot(t *testing.T) {+ t.Parallel()+ workDir := t.TempDir()+ want := filepath.Join(workDir, ".minimax", "skills")+ if got := skillsDirPath(workDir, "mcode"); got != want {+ t.Fatalf("skillsDirPath(mcode) = %q, want %q", got, want)+ }+}+func TestCleanupPreservesLogs(t *testing.T) {t.Parallel()workspacesRoot := t.TempDir()diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.goindex 047d9cab84..1d48f19410 100644--- a/server/internal/daemon/execenv/runtime_config.go+++ b/server/internal/daemon/execenv/runtime_config.go@@ -214,7 +214,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", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwenpaw":+ case "codex", "copilot", "opencode", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwenpaw", "mcode":return filepath.Join(workDir, "AGENTS.md")default:return ""diff --git a/server/internal/daemon/execenv/sidecar_manifest_test.go b/server/internal/daemon/execenv/sidecar_manifest_test.goindex 070858f561..c0ac86df9f 100644--- a/server/internal/daemon/execenv/sidecar_manifest_test.go+++ b/server/internal/daemon/execenv/sidecar_manifest_test.go@@ -160,6 +160,7 @@ var allFileBasedProviders = []string{"antigravity","qwen","qwenpaw",+ "mcode",}// TestPrepareThenCleanupSidecarsRoundTripEmptyWorkdir is the headlinediff --git a/server/internal/daemon/local_skills.go b/server/internal/daemon/local_skills.goindex 5924d49e76..4ccb91c8a6 100644--- a/server/internal/daemon/local_skills.go+++ b/server/internal/daemon/local_skills.go@@ -231,6 +231,11 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)}}providerRoot = filepath.Join(qwenpawHome, "skill_pool")+ case "mcode":+ // MCode's default data directory is ~/.minimax; global skills live+ // directly below it. Project skills are injected separately under+ // <workDir>/.minimax/skills.+ providerRoot = filepath.Join(home, ".minimax", "skills")default:return nil, false, nil}diff --git a/server/internal/daemon/local_skills_test.go b/server/internal/daemon/local_skills_test.goindex d9130317ba..1ec349b1a8 100644--- a/server/internal/daemon/local_skills_test.go+++ b/server/internal/daemon/local_skills_test.go@@ -100,6 +100,26 @@ func TestListRuntimeLocalSkills_Claude(t *testing.T) {}}+func TestListRuntimeLocalSkills_Mcode(t *testing.T) {+ home := t.TempDir()+ t.Setenv("HOME", home)++ writeTestLocalSkill(t, filepath.Join(home, ".minimax", "skills"), "mcode-review", map[string]string{+ "SKILL.md": "---\nname: MCode Review\ndescription: Review code with MiniMax Code\n---\n",+ })++ skills, supported, err := listRuntimeLocalSkills("mcode")+ if err != nil {+ t.Fatalf("listRuntimeLocalSkills: %v", err)+ }+ if !supported || len(skills) != 1 {+ t.Fatalf("supported=%v skills=%#v", supported, skills)+ }+ if skills[0].SourcePath != "~/.minimax/skills/mcode-review" {+ t.Fatalf("source_path = %q", skills[0].SourcePath)+ }+}+// TestListRuntimeLocalSkills_Codebuddy is the regression guard for a bug// where CodeBuddy was treated as a drop-in alias for Claude and local// (user-level) skills were discovered from ~/.claude/skills. CodeBuddy Codediff --git a/server/internal/daemon/remote_mcp_broker.go b/server/internal/daemon/remote_mcp_broker.goindex 22946d7051..2929361069 100644--- a/server/internal/daemon/remote_mcp_broker.go+++ b/server/internal/daemon/remote_mcp_broker.go@@ -160,7 +160,7 @@ func startTaskRemoteMCPBrokers(setupCtx, lifetimeCtx context.Context, taskID, prfunc providerSupportsRemoteMCPBroker(provider string) bool {switch provider {- case "codex", "claude", "hermes", "qoder":+ case "codex", "claude", "hermes", "qoder", "mcode":return truedefault:return falsediff --git a/server/internal/daemon/remote_mcp_broker_test.go b/server/internal/daemon/remote_mcp_broker_test.goindex e8c2d42bde..035453d17d 100644--- a/server/internal/daemon/remote_mcp_broker_test.go+++ b/server/internal/daemon/remote_mcp_broker_test.go@@ -142,7 +142,7 @@ func TestRemoteMCPProxyRechecksCredentialBeforeUpstreamCall(t *testing.T) {}func TestRemoteMCPProviderMatrixAndConfigMerge(t *testing.T) {- for _, provider := range []string{"codex", "claude", "hermes", "qoder"} {+ for _, provider := range []string{"codex", "claude", "hermes", "qoder", "mcode"} {if !providerSupportsRemoteMCPBroker(provider) {t.Fatalf("provider %s must support Remote MCP", provider)}diff --git a/server/migrations/342_runtime_profile_add_mcode.down.sql b/server/migrations/342_runtime_profile_add_mcode.down.sqlnew file mode 100644index 0000000000..8d7fe0b11c--- /dev/null+++ b/server/migrations/342_runtime_profile_add_mcode.down.sql@@ -0,0 +1,28 @@+-- Restore the pre-MCode whitelist. Existing MCode rows remain valid because the+-- replacement constraint is NOT VALID, but new MCode profiles are blocked.+ALTER TABLE runtime_profile DROP CONSTRAINT IF EXISTS runtime_profile_protocol_family_check;++ALTER TABLE runtime_profile ADD CONSTRAINT runtime_profile_protocol_family_check+ CHECK (protocol_family IN (+ 'claude',+ 'codebuddy',+ 'codex',+ 'copilot',+ 'opencode',+ 'openclaw',+ 'hermes',+ 'pi',+ 'cursor',+ 'kimi',+ 'reasonix',+ 'dsh',+ 'kiro',+ 'antigravity',+ 'qoder',+ 'qoderclicn',+ 'traecli',+ 'deveco',+ 'grok',+ 'qwen',+ 'qwenpaw'+ )) NOT VALID;diff --git a/server/migrations/342_runtime_profile_add_mcode.up.sql b/server/migrations/342_runtime_profile_add_mcode.up.sqlnew file mode 100644index 0000000000..7088f29efd--- /dev/null+++ b/server/migrations/342_runtime_profile_add_mcode.up.sql@@ -0,0 +1,29 @@+-- Add MiniMax Code as a first-party ACP protocol family. NOT VALID preserves+-- historical-row tolerance while enforcing the expanded whitelist for new rows.+ALTER TABLE runtime_profile DROP CONSTRAINT IF EXISTS runtime_profile_protocol_family_check;++ALTER TABLE runtime_profile ADD CONSTRAINT runtime_profile_protocol_family_check+ CHECK (protocol_family IN (+ 'claude',+ 'codebuddy',+ 'codex',+ 'copilot',+ 'opencode',+ 'openclaw',+ 'hermes',+ 'pi',+ 'cursor',+ 'kimi',+ 'reasonix',+ 'dsh',+ 'kiro',+ 'antigravity',+ 'qoder',+ 'qoderclicn',+ 'traecli',+ 'deveco',+ 'grok',+ 'qwen',+ 'qwenpaw',+ 'mcode'+ )) NOT VALID;diff --git a/server/pkg/agent/acp_deliverable_test.go b/server/pkg/agent/acp_deliverable_test.goindex 1c44b752ff..8ebebc7409 100644--- a/server/pkg/agent/acp_deliverable_test.go+++ b/server/pkg/agent/acp_deliverable_test.go@@ -169,6 +169,7 @@ var acpDeliverableCases = []acpDeliverableCase{{backend: "reasonix", binary: "reasonix", notification: "session/update"},{backend: "traecli", binary: "traecli", notification: "session/update"},{backend: "grok", binary: "grok", notification: "session/update"},+ {backend: "mcode", binary: "mcode", 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},diff --git a/server/pkg/agent/agent.go b/server/pkg/agent/agent.goindex 15c2d43c04..04145c23fc 100644--- a/server/pkg/agent/agent.go+++ b/server/pkg/agent/agent.go@@ -1,7 +1,7 @@// Package agent provides a unified interface for executing prompts via// coding agents (Claude Code, CodeBuddy, Codex, Copilot, OpenCode, DevEco Code,// OpenClaw, Hermes, Pi, Oh-My-Pi, Cursor, Kimi, Reasonix, Kiro, Antigravity, Qoder,-// Trae, Grok, Qwen Code, QwenPaw). It+// Trae, Grok, Qwen Code, QwenPaw, MiniMax Code). It// mirrors the happy-cli AgentBackend pattern, translated to idiomatic Go.package agent@@ -10,6 +10,7 @@ import ("encoding/json""fmt""log/slog"+ "strings""time")@@ -242,7 +243,7 @@ type Result struct {// Config configures a Backend instance.type Config struct {- ExecutablePath string // path to CLI binary (claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, qwenpaw)+ ExecutablePath string // path to CLI binary (claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, dsh, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, qwenpaw, mcode)CLIVersion string // detected version paired with ExecutablePath; observation only, never used to choose behaviorEnv map[string]string // extra environment variablesLogger *slog.Logger@@ -273,7 +274,7 @@ type Config struct {}// New creates a Backend for the given agent type.-// Supported types: "claude", "codebuddy", "codex", "copilot", "opencode", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw".+// Supported types: "claude", "codebuddy", "codex", "copilot", "opencode", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "reasonix", "dsh", "kiro", "antigravity", "qoder", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw", "mcode".//// SupportedTypes is the canonical whitelist of agent types eligible to back a// custom runtime profile. It MUST stay in lockstep with the@@ -281,7 +282,8 @@ type Config struct {// migration 134 to add qoder, migration 136 to add traecli, migration 175 to// add deveco, migration 179 to add grok, migration 202 to add qwen,// migration 242 to add qoderclicn, migration 253 to add qwenpaw,-// migration 254 to add reasonix, migration 313 to add dsh): a+// migration 254 to add reasonix, migration 313 to add dsh, migration 327 to+// add mcode): a// custom runtime profile may only// be based on a backend Multica officially supports.// qoder and qoderclicn share the same ACP backend; keeping both provider keys@@ -313,6 +315,7 @@ var SupportedTypes = []string{"grok","qwen","qwenpaw",+ "mcode",}// IsSupportedType reports whether agentType is in the SupportedTypes whitelist.@@ -406,8 +409,10 @@ func New(agentType string, cfg Config) (Backend, error) {return &qwenBackend{cfg: cfg}, nilcase "qwenpaw":return &qwenpawBackend{cfg: cfg}, nil+ case "mcode":+ return &mcodeBackend{cfg: cfg}, nildefault:- return nil, fmt.Errorf("unknown agent type: %q (supported: claude, codebuddy, codex, copilot, opencode, deveco, openclaw, hermes, pi, cursor, kimi, reasonix, dsh, kiro, antigravity, qoder, qoderclicn, traecli, grok, qwen, qwenpaw)", agentType)+ return nil, fmt.Errorf("unknown agent type: %q (supported: %s)", agentType, strings.Join(SupportedTypes, ", "))}}@@ -449,6 +454,7 @@ var launchHeaders = map[string]string{"grok": "grok agent stdio","qwen": "qwen -p (stream-json)","qwenpaw": "qwenpaw acp",+ "mcode": "mcode acp",}// LaunchHeader returns the user-visible launch skeleton for agentType, or andiff --git a/server/pkg/agent/agent_supported_types_test.go b/server/pkg/agent/agent_supported_types_test.goindex 80ce7f2849..8f59e73581 100644--- a/server/pkg/agent/agent_supported_types_test.go+++ b/server/pkg/agent/agent_supported_types_test.go@@ -40,14 +40,14 @@ func TestSupportedTypesMatchesMigrationWhitelist(t *testing.T) {"claude": true, "codebuddy": true, "codex": true, "copilot": true,"opencode": true, "deveco": true, "openclaw": true, "hermes": true,"pi": true, "cursor": true, "kimi": true, "reasonix": true, "dsh": true, "kiro": true, "antigravity": true,- "qoder": true, "qoderclicn": true, "traecli": true, "grok": true, "qwen": true, "qwenpaw": true,+ "qoder": true, "qoderclicn": true, "traecli": true, "grok": true, "qwen": true, "qwenpaw": true, "mcode": true,}if len(SupportedTypes) != len(want) {t.Fatalf("SupportedTypes has %d entries, migration whitelist has %d; keep them in lockstep", len(SupportedTypes), len(want))}for _, typ := range SupportedTypes {if !want[typ] {- t.Errorf("SupportedTypes contains %q which is not in the migration 313 protocol_family CHECK", typ)+ t.Errorf("SupportedTypes contains %q which is not in the latest protocol_family CHECK", typ)}}}diff --git a/server/pkg/agent/hermes_test.go b/server/pkg/agent/hermes_test.goindex 5fc3d1ab8f..2ec30401ee 100644--- a/server/pkg/agent/hermes_test.go+++ b/server/pkg/agent/hermes_test.go@@ -2996,7 +2996,7 @@ func TestFilterACPMcpServersByCapabilityOmittedForwardsOnListedRuntime(t *testinfunc TestFilterACPMcpServersByCapabilityOmittedStillDropsOnUnlistedRuntimes(t *testing.T) {t.Parallel()caps := acpMcpTransportCapabilities{Declaration: acpMcpCapabilitiesOmitted}- for _, backend := range []string{"kimi", "kiro", "grok", "qoder", "reasonix", "traecli", "qwenpaw"} {+ for _, backend := range []string{"kimi", "kiro", "grok", "qoder", "reasonix", "traecli", "qwenpaw", "mcode"} {assertOnlyStdioSurvives(t, backend,filterACPMcpServersByCapability(mixedTransportACPServers(), caps, backend, builtinACPConfig()))}diff --git a/server/pkg/agent/mcode.go b/server/pkg/agent/mcode.gonew file mode 100644index 0000000000..8f1eee7fd7--- /dev/null+++ b/server/pkg/agent/mcode.go@@ -0,0 +1,368 @@+package agent++import (+ "context"+ "encoding/json"+ "fmt"+ "io"+ "os/exec"+ "strings"+ "sync"+ "sync/atomic"+ "syscall"+ "time"+)++// mcodeBlockedArgs protect the ACP stdio transport selected by the daemon.+// The public CLI currently exposes no options on `mcode acp`; its only child+// command is the interactive `login` flow, which cannot run inside a claimed+// headless task. Keeping these tokens out of custom_args prevents a profile or+// agent from replacing the protocol process with help or authentication UI.+var mcodeBlockedArgs = map[string]blockedArgMode{+ "acp": blockedStandalone,+ "login": blockedStandalone,+ "--region": blockedWithValue,+ "-h": blockedStandalone,+ "--help": blockedStandalone,+}++// mcodeBackend runs MiniMax Code as an ACP v1 agent server via `mcode acp`.+// MiniMax Code owns its Runtime, Session, permission, and questionnaire loops;+// this adapter only maps the shared ACP stream into Multica's Backend contract.+//+// The current public ACP surface deliberately declares loadSession:false and+// does not expose session-scoped model selection. Resume therefore returns a+// typed rejection so the daemon can retry on a fresh session, and model choice+// stays managed by MiniMax Code. If a later version advertises loadSession,+// the standard session/load path below begins working without a compatibility+// guess or a version-string gate.+type mcodeBackend struct {+ cfg Config+}++var mcodeReaderDrainGrace = 2 * time.Second++type mcodeMessageStream struct {+ ch chan Message+ mu sync.Mutex+ closed bool+}++func newMcodeMessageStream(size int) *mcodeMessageStream {+ return &mcodeMessageStream{ch: make(chan Message, size)}+}++func (s *mcodeMessageStream) send(message Message) {+ s.mu.Lock()+ defer s.mu.Unlock()+ if s.closed {+ return+ }+ trySend(s.ch, message)+}++func (s *mcodeMessageStream) close() {+ s.mu.Lock()+ defer s.mu.Unlock()+ if s.closed {+ return+ }+ s.closed = true+ close(s.ch)+}++func (b *mcodeBackend) Execute(ctx context.Context, prompt string, opts ExecOptions) (*Session, error) {+ execPath := b.cfg.ExecutablePath+ if execPath == "" {+ execPath = "mcode"+ }+ if _, err := exec.LookPath(execPath); err != nil {+ return nil, fmt.Errorf("mcode executable not found at %q: %w", execPath, err)+ }++ mcpServers, err := buildACPMcpServers(opts.McpConfig, b.cfg.Logger)+ if err != nil {+ return nil, fmt.Errorf("mcode: invalid mcp_config: %w", err)+ }++ runCtx, cancel := runContext(ctx, opts.Timeout)+ args := []string{"acp"}+ args = append(args, filterCustomArgs(opts.ExtraArgs, mcodeBlockedArgs, b.cfg.Logger)...)+ args = append(args, filterCustomArgs(opts.CustomArgs, mcodeBlockedArgs, b.cfg.Logger)...)+ cmd := b.cfg.commandAt(execPath).exec(runCtx, args...)+ hideAgentWindow(cmd)+ configureProcessGroup(cmd)+ cmd.Cancel = func() error {+ if cmd.Process != nil {+ signalProcessGroup(cmd, syscall.SIGKILL)+ }+ return nil+ }+ cmd.WaitDelay = mcodeReaderDrainGrace+ b.cfg.Logger.Info("agent command", "exec", execPath, "args", args)+ if opts.Cwd != "" {+ cmd.Dir = opts.Cwd+ }+ cmd.Env = buildEnv(b.cfg.Env)++ stdout, err := cmd.StdoutPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("mcode stdout pipe: %w", err)+ }+ stdin, err := cmd.StdinPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("mcode stdin pipe: %w", err)+ }+ providerErr := newACPProviderErrorSniffer("mcode")+ stderr, err := cmd.StderrPipe()+ if err != nil {+ cancel()+ return nil, fmt.Errorf("mcode stderr pipe: %w", err)+ }+ if err := startOwnedProcessTree(cmd, b.cfg.Logger); err != nil {+ cancel()+ return nil, fmt.Errorf("start mcode: %w", err)+ }++ stderrSink := io.MultiWriter(newLogWriter(b.cfg.Logger, "[mcode:stderr] "), providerErr)+ stderrDone := make(chan struct{})+ go func() {+ defer close(stderrDone)+ _, _ = io.Copy(stderrSink, stderr)+ }()++ b.cfg.Logger.Info("mcode acp started", "pid", cmd.Process.Pid, "cwd", opts.Cwd)+ msgStream := newMcodeMessageStream(256)+ resCh := make(chan Result, 1)+ var deliverable acpDeliverableTracker+ var streamingCurrentTurn atomic.Bool+ promptDone := make(chan hermesPromptResult, 1)+ activity := make(chan struct{}, 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(message Message) {+ if !streamingCurrentTurn.Load() {+ return+ }+ deliverable.observe(message)+ msgStream.send(message)+ },+ 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 != "" {+ c.handleLine(line)+ }+ }+ c.closeAllPending(fmt.Errorf("mcode process exited"))+ }()++ go func() {+ defer msgStream.close()+ defer close(resCh)+ defer func() {+ _ = stdin.Close()+ // Cancellation must remain reachable before Wait. MCode or a tool+ // descendant may ignore stdin EOF, so waiting first can deadlock every+ // early-return path, including a rejected session resume.+ cancel()+ _ = cmd.Wait()+ releaseProcessGroup(cmd)+ }()++ startTime := time.Now()+ finalStatus := "completed"+ var finalError string+ var sessionID string+ var resumeRejected bool++ 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 = mcodeRequestFailure(runCtx, opts.Timeout, "initialize", err)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }++ mcpServers = filterACPMcpServersByCapability(+ mcpServers,+ extractACPMcpCapabilities(initResult),+ "mcode",+ b.cfg,+ )+ cwd := opts.Cwd+ if cwd == "" {+ cwd = "."+ }++ if opts.ResumeSessionID != "" {+ if !mcodeLoadSessionSupported(initResult) {+ finalStatus = "failed"+ finalError = "mcode ACP does not support session loading; retry with a fresh session"+ resumeRejected = true+ resCh <- Result{+ Status: finalStatus,+ Error: finalError,+ DurationMs: time.Since(startTime).Milliseconds(),+ ResumeRejected: true,+ }+ return+ }+ result, loadErr := c.request(runCtx, "session/load", map[string]any{+ "cwd": cwd,+ "sessionId": opts.ResumeSessionID,+ "mcpServers": mcpServers,+ })+ if loadErr != nil {+ finalStatus, finalError = mcodeRequestFailure(runCtx, opts.Timeout, "session/load", loadErr)+ if finalStatus == "failed" && isACPSessionNotFound(loadErr) {+ resumeRejected = true+ }+ resCh <- Result{+ Status: finalStatus,+ Error: finalError,+ DurationMs: time.Since(startTime).Milliseconds(),+ ResumeRejected: resumeRejected,+ }+ return+ }+ sessionID, _ = resolveResumedSessionID(opts.ResumeSessionID, result)+ } else {+ result, newErr := c.request(runCtx, "session/new", map[string]any{+ "cwd": cwd,+ "mcpServers": mcpServers,+ })+ if newErr != nil {+ finalStatus, finalError = mcodeRequestFailure(runCtx, opts.Timeout, "session/new", newErr)+ resCh <- Result{Status: finalStatus, Error: finalError, DurationMs: time.Since(startTime).Milliseconds()}+ return+ }+ sessionID = extractACPSessionID(result)+ if sessionID == "" {+ resCh <- Result{+ Status: "failed",+ Error: "mcode session/new returned no session ID",+ DurationMs: time.Since(startTime).Milliseconds(),+ }+ return+ }+ }++ c.sessionID = sessionID+ if opts.SystemPrompt != "" {+ b.cfg.Logger.Debug("mcode ignoring ExecOptions.SystemPrompt; using cwd-scoped AGENTS.md", "cwd", opts.Cwd)+ }+ streamingCurrentTurn.Store(true)+ _, err = c.request(runCtx, "session/prompt", map[string]any{+ "sessionId": sessionID,+ "prompt": []map[string]any{+ {"type": "text", "text": prompt},+ },+ })+ if err != nil {+ finalStatus, finalError = mcodeRequestFailure(runCtx, opts.Timeout, "session/prompt", err)+ if opts.ResumeSessionID != "" && isACPSessionNotFound(err) {+ resumeRejected = true+ sessionID = ""+ }+ } else {+ select {+ case result := <-promptDone:+ c.mergeUsage(result.usage)+ if result.stopReason == "cancelled" {+ finalStatus = "aborted"+ finalError = "execution cancelled"+ } else if result.stopReason == "max_turn_requests" {+ finalStatus = "failed"+ finalError = "mcode reached its maximum turn requests"+ }+ default:+ }+ waitForACPNotificationQuiescence(runCtx, activity, readerDone, acpNotificationQuietTime, mcodeReaderDrainGrace)+ }+ streamingCurrentTurn.Store(false)++ duration := time.Since(startTime)+ _ = stdin.Close()+ cancel()+ <-readerDone+ <-stderrDone++ finalOutput, fullOutput := deliverable.result()+ finalStatus, finalError = promoteACPResultOnProviderError(+ finalStatus,+ finalError,+ fullOutput,+ providerErr,+ )+ var usage map[string]TokenUsage+ if accumulated := c.accumulatedUsage(); acpUsagePresent(accumulated) {+ usage = map[string]TokenUsage{"unknown": accumulated}+ }+ resCh <- Result{+ Status: finalStatus,+ Output: finalOutput,+ Error: finalError,+ DurationMs: duration.Milliseconds(),+ SessionID: sessionID,+ ResumeRejected: resumeRejected,+ Usage: usage,+ }+ }()++ return &Session{Messages: msgStream.ch, Result: resCh}, nil+}++func mcodeLoadSessionSupported(result json.RawMessage) bool {+ var payload struct {+ AgentCapabilities struct {+ LoadSession bool `json:"loadSession"`+ } `json:"agentCapabilities"`+ }+ return json.Unmarshal(result, &payload) == nil && payload.AgentCapabilities.LoadSession+}++func mcodeRequestFailure(ctx context.Context, timeout time.Duration, operation string, err error) (string, string) {+ if ctx.Err() == context.DeadlineExceeded {+ return "timeout", fmt.Sprintf("mcode timed out during %s after %s", operation, timeout)+ }+ if ctx.Err() == context.Canceled {+ return "aborted", "execution cancelled"+ }+ return "failed", fmt.Sprintf("mcode %s failed: %v", operation, err)+}diff --git a/server/pkg/agent/mcode_cancel_unix_test.go b/server/pkg/agent/mcode_cancel_unix_test.gonew file mode 100644index 0000000000..25eebd95cf--- /dev/null+++ b/server/pkg/agent/mcode_cancel_unix_test.go@@ -0,0 +1,154 @@+//go:build unix++package agent++import (+ "context"+ "log/slog"+ "os"+ "path/filepath"+ "syscall"+ "testing"+ "time"+)++func TestMcodeUnsupportedResumeTerminatesProcessTreeBeforeWait(t *testing.T) {+ tempDir := t.TempDir()+ pidFile := filepath.Join(tempDir, "pids")+ fakePath := filepath.Join(tempDir, "mcode")+ writeTestExecutable(t, fakePath, []byte(`#!/bin/sh+while IFS= read -r line; do+ id=$(printf '%s' "$line" | sed -n 's/.*"id":\([0-9]*\).*/\1/p')+ case "$line" in+ *'"method":"initialize"'*)+ ( sleep 300 ) >/dev/null 2>&1 &+ child=$!+ printf '%s %s\n' "$$" "$child" > "$MCODE_PID_FILE"+ printf '{"jsonrpc":"2.0","id":%s,"result":{"protocolVersion":1,"agentCapabilities":{"loadSession":false}}}\n' "$id"+ while true; do sleep 1; done+ ;;+ esac+done+while true; do sleep 1; done+`))++ backend, err := New("mcode", Config{+ ExecutablePath: fakePath,+ Logger: slog.Default(),+ Env: map[string]string{"MCODE_PID_FILE": pidFile},+ })+ if err != nil {+ t.Fatalf("new mcode backend: %v", err)+ }++ ctx, cancel := context.WithCancel(context.Background())+ t.Cleanup(cancel)+ session, err := backend.Execute(ctx, "continue", ExecOptions{+ Cwd: tempDir,+ ResumeSessionID: "mcode-old-session",+ })+ if err != nil {+ t.Fatalf("execute: %v", err)+ }++ pids := waitForPids(t, pidFile)+ t.Cleanup(func() {+ for _, pid := range pids {+ _ = syscall.Kill(pid, syscall.SIGKILL)+ }+ })++ select {+ case result := <-session.Result:+ if result.Status != "failed" || !result.ResumeRejected {+ t.Fatalf("result = %+v, want failed ResumeRejected", result)+ }+ case <-time.After(2 * time.Second):+ cancel()+ t.Fatal("result did not arrive before process cleanup")+ }++ select {+ case _, ok := <-session.Messages:+ if ok {+ t.Fatal("message stream emitted unexpected message")+ }+ case <-time.After(2 * time.Second):+ cancel()+ t.Fatal("message stream did not close before process cleanup")+ }++ for _, pid := range pids {+ waitProcessGone(t, pid)+ }+}++// TestMcodeCancellationTerminatesProcessTree verifies the public Backend.Execute+// cancellation contract: an aborted MCode run must not leave the ACP process or+// any tool subprocess it spawned running after the result is returned.+func TestMcodeCancellationTerminatesProcessTree(t *testing.T) {+ tempDir := t.TempDir()+ pidFile := filepath.Join(tempDir, "pids")+ fakePath := filepath.Join(tempDir, "mcode")+ writeTestExecutable(t, fakePath, []byte(`#!/bin/sh+while IFS= read -r line; do+ 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":false}}}\n' "$id"+ ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%s,"result":{"sessionId":"mcode-cancel-session"}}\n' "$id"+ ;;+ *'"method":"session/prompt"'*)+ ( sleep 300 ) >/dev/null 2>&1 &+ child=$!+ printf '%s %s\n' "$$" "$child" > "$MCODE_PID_FILE"+ while true; do sleep 1; done+ ;;+ esac+done+`))++ backend, err := New("mcode", Config{+ ExecutablePath: fakePath,+ Logger: slog.Default(),+ Env: map[string]string{"MCODE_PID_FILE": pidFile},+ })+ if err != nil {+ t.Fatalf("new mcode backend: %v", err)+ }++ ctx, cancel := context.WithCancel(context.Background())+ defer cancel()+ session, err := backend.Execute(ctx, "keep working", ExecOptions{Cwd: tempDir})+ if err != nil {+ t.Fatalf("execute: %v", err)+ }+ go func() {+ for range session.Messages {+ }+ }()++ pids := waitForPids(t, pidFile)+ t.Cleanup(func() {+ for _, pid := range pids {+ _ = syscall.Kill(pid, syscall.SIGKILL)+ }+ _ = os.Remove(pidFile)+ })+ cancel()++ select {+ case result := <-session.Result:+ if result.Status != "aborted" {+ t.Errorf("status = %q, want aborted", result.Status)+ }+ case <-time.After(10 * time.Second):+ t.Fatal("Execute did not return after cancellation")+ }++ for _, pid := range pids {+ waitProcessGone(t, pid)+ }+}diff --git a/server/pkg/agent/mcode_integration_test.go b/server/pkg/agent/mcode_integration_test.gonew file mode 100644index 0000000000..d2f9a82e0d--- /dev/null+++ b/server/pkg/agent/mcode_integration_test.go@@ -0,0 +1,116 @@+//go:build agentintegration++package agent++import (+ "context"+ "log/slog"+ "os"+ "os/exec"+ "path/filepath"+ "strings"+ "testing"+ "time"+)++// TestMcodeRealACPContextAndToolSmoke drives an authenticated MiniMax Code ACP+// turn end-to-end. Workspace canaries exercise cwd-scoped instructions, project+// skill lookup, file access, and ACP tool event forwarding together.+func TestMcodeRealACPContextAndToolSmoke(t *testing.T) {+ requireRealAgentSmoke(t)+ if testing.Short() {+ t.Skip("skipping real-binary smoke test in -short mode")+ }++ path, err := exec.LookPath("mcode")+ if err != nil {+ t.Skip("mcode not on PATH; skipping real-binary smoke test")+ }+ if version, err := exec.Command(path, "--version").CombinedOutput(); err == nil {+ t.Logf("mcode --version: %s", strings.TrimSpace(string(version)))+ } else {+ t.Logf("mcode version unavailable: %v (%s)", err, strings.TrimSpace(string(version)))+ }++ workDir := t.TempDir()+ writeMcodeSmokeFile(t, filepath.Join(workDir, "AGENTS.md"), `# Multica smoke context++For every response in this workspace, include the exact marker AGENTS-MCODE-OK.+`)+ writeMcodeSmokeFile(t, filepath.Join(workDir, ".minimax", "skills", "multica-smoke", "SKILL.md"), `---+name: multica-smoke+description: Use when asked to run the Multica MiniMax Code integration smoke.+---+# Multica smoke skill++Read tool-canary.txt with a file-reading tool. Include the exact marker SKILL-MCODE-OK and the file contents in the final response.+`)+ writeMcodeSmokeFile(t, filepath.Join(workDir, "tool-canary.txt"), "TOOL-MCODE-OK\n")++ backend, err := New("mcode", Config{ExecutablePath: path, Logger: slog.Default()})+ if err != nil {+ t.Fatalf("new mcode backend: %v", err)+ }+ ctx, cancel := context.WithTimeout(context.Background(), 240*time.Second)+ defer cancel()++ session, err := backend.Execute(ctx,+ "Run the multica-smoke skill. Follow the workspace instructions and return its requested evidence.",+ ExecOptions{Cwd: workDir, Timeout: 210 * time.Second},+ )+ if err != nil {+ t.Fatalf("execute: %v", err)+ }++ var toolUses, toolResults int+ var canaryToolResult bool+ messagesDone := make(chan struct{})+ go func() {+ defer close(messagesDone)+ for message := range session.Messages {+ switch message.Type {+ case MessageToolUse:+ toolUses+++ case MessageToolResult:+ toolResults+++ if strings.Contains(message.Output, "TOOL-MCODE-OK") {+ canaryToolResult = true+ }+ }+ }+ }()++ var result Result+ select {+ case result = <-session.Result:+ case <-time.After(240 * time.Second):+ t.Fatal("timeout waiting for real mcode result")+ }+ <-messagesDone++ if result.Status != "completed" {+ t.Fatalf("real mcode run did not complete: status=%q error=%q output=%q", result.Status, result.Error, result.Output)+ }+ for _, marker := range []string{"AGENTS-MCODE-OK", "SKILL-MCODE-OK", "TOOL-MCODE-OK"} {+ if !strings.Contains(result.Output, marker) {+ t.Fatalf("real mcode output missing %s: %q", marker, result.Output)+ }+ }+ if toolUses == 0 || toolResults == 0 || !canaryToolResult {+ t.Fatalf("real mcode stream did not expose canary file execution: uses=%d results=%d canary_result=%t", toolUses, toolResults, canaryToolResult)+ }+ if result.SessionID == "" {+ t.Fatal("real mcode run returned an empty session id")+ }+ t.Logf("real mcode smoke OK: session=%s tools=%d/%d output=%q", result.SessionID, toolUses, toolResults, result.Output)+}++func writeMcodeSmokeFile(t *testing.T, path, content string) {+ t.Helper()+ if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {+ t.Fatalf("create %s parent: %v", path, err)+ }+ if err := os.WriteFile(path, []byte(content), 0o644); err != nil {+ t.Fatalf("write %s: %v", path, err)+ }+}diff --git a/server/pkg/agent/mcode_test.go b/server/pkg/agent/mcode_test.gonew file mode 100644index 0000000000..e4bcf8c639--- /dev/null+++ b/server/pkg/agent/mcode_test.go@@ -0,0 +1,192 @@+package agent++import (+ "context"+ "encoding/json"+ "fmt"+ "log/slog"+ "os"+ "path/filepath"+ "strings"+ "testing"+)++func writeFakeMcodeACP(t *testing.T, loadSession bool) (string, string, string) {+ t.Helper()+ dir := t.TempDir()+ bin := filepath.Join(dir, "mcode")+ requests := filepath.Join(dir, "requests.jsonl")+ args := filepath.Join(dir, "args.txt")+ script := fmt.Sprintf(`#!/bin/sh+printf '%%s\n' "$*" > %q+while IFS= read -r line; do+ printf '%%s\n' "$line" >> %q+ 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":%t,"mcpCapabilities":{"http":true,"sse":true}}}}\n' "$id"+ ;;+ *'"method":"session/new"'*)+ printf '{"jsonrpc":"2.0","id":%%s,"result":{"sessionId":"mcode-session-new"}}\n' "$id"+ ;;+ *'"method":"session/load"'*)+ printf '{"jsonrpc":"2.0","id":%%s,"result":{}}\n' "$id"+ ;;+ *'"method":"session/prompt"'*)+ printf '{"jsonrpc":"2.0","id":%%s,"result":{"stopReason":"end_turn"}}\n' "$id"+ sleep 0.05+ printf '{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"mcode-session-new","update":{"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"MCode completed the task"}}}}\n'+ ;;+ *)+ printf '{"jsonrpc":"2.0","id":%%s,"error":{"code":-32601,"message":"method not found"}}\n' "$id"+ ;;+ esac+done+`, args, requests, loadSession)+ if err := os.WriteFile(bin, []byte(script), 0o755); err != nil {+ t.Fatalf("write fake mcode: %v", err)+ }+ return bin, requests, args+}++func TestNewReturnsMcodeBackend(t *testing.T) {+ t.Parallel()+ backend, err := New("mcode", Config{ExecutablePath: "/nonexistent/mcode"})+ if err != nil {+ t.Fatalf("New(mcode) error: %v", err)+ }+ if _, ok := backend.(*mcodeBackend); !ok {+ t.Fatalf("New(mcode) = %T, want *mcodeBackend", backend)+ }+}++func TestMcodeModelSelectionIsRuntimeManaged(t *testing.T) {+ t.Parallel()+ if ModelSelectionSupported("mcode") {+ t.Fatal("MCode ACP does not expose session-scoped model selection")+ }+}++func TestMcodeFreshSessionUsesACPAndForwardsMCP(t *testing.T) {+ t.Parallel()+ bin, requestsFile, argsFile := writeFakeMcodeACP(t, false)+ backend, err := New("mcode", Config{+ ExecutablePath: bin,+ Logger: slog.Default(),+ })+ if err != nil {+ t.Fatalf("New(mcode): %v", err)+ }+ session, err := backend.Execute(context.Background(), "ship it", ExecOptions{+ Cwd: t.TempDir(),+ McpConfig: json.RawMessage(`{"mcpServers":{"docs":{"command":"docs-server","args":["--stdio"]},"remote":{"type":"http","url":"https://example.test/mcp"},"events":{"type":"sse","url":"https://example.test/events"}}}`),+ })+ if err != nil {+ t.Fatalf("Execute: %v", err)+ }+ var text strings.Builder+ for message := range session.Messages {+ if message.Type == MessageText {+ text.WriteString(message.Content)+ }+ }+ result := <-session.Result+ if result.Status != "completed" || result.SessionID != "mcode-session-new" {+ t.Fatalf("result = %+v", result)+ }+ if result.Output != "MCode completed the task" {+ t.Fatalf("result output = %q, want final MCode message", result.Output)+ }+ if !strings.Contains(text.String(), "MCode completed the task") {+ t.Fatalf("streamed text = %q", text.String())+ }++ args, err := os.ReadFile(argsFile)+ if err != nil {+ t.Fatalf("read args: %v", err)+ }+ if strings.TrimSpace(string(args)) != "acp" {+ t.Fatalf("mcode args = %q, want %q", strings.TrimSpace(string(args)), "acp")+ }+ requests, err := os.ReadFile(requestsFile)+ if err != nil {+ t.Fatalf("read requests: %v", err)+ }+ raw := string(requests)+ for _, want := range []string{`"method":"session/new"`, `"mcpServers"`, `"docs-server"`, `"https://example.test/mcp"`, `"https://example.test/events"`, `"type":"sse"`, `"method":"session/prompt"`, `"text":"ship it"`} {+ if !strings.Contains(raw, want) {+ t.Fatalf("requests missing %s:\n%s", want, raw)+ }+ }+}++func TestMcodeUnsupportedResumeRequestsFreshRetry(t *testing.T) {+ t.Parallel()+ bin, requestsFile, _ := writeFakeMcodeACP(t, false)+ backend, err := New("mcode", Config{ExecutablePath: bin, Logger: slog.Default()})+ if err != nil {+ t.Fatalf("New(mcode): %v", err)+ }+ session, err := backend.Execute(context.Background(), "continue", ExecOptions{+ Cwd: t.TempDir(),+ ResumeSessionID: "old-mcode-session",+ })+ if err != nil {+ t.Fatalf("Execute: %v", err)+ }+ for range session.Messages {+ }+ result := <-session.Result+ if result.Status != "failed" || !result.ResumeRejected {+ t.Fatalf("result = %+v, want failed ResumeRejected", result)+ }+ if !strings.Contains(result.Error, "does not support session loading") {+ t.Fatalf("error = %q", result.Error)+ }+ requests, err := os.ReadFile(requestsFile)+ if err != nil {+ t.Fatalf("read requests: %v", err)+ }+ raw := string(requests)+ if strings.Contains(raw, `"method":"session/load"`) || strings.Contains(raw, `"method":"session/prompt"`) {+ t.Fatalf("unsupported resume must stop after initialize:\n%s", raw)+ }+}++func TestMcodeLoadSessionWhenCapabilityAppears(t *testing.T) {+ t.Parallel()+ bin, requestsFile, _ := writeFakeMcodeACP(t, true)+ backend, err := New("mcode", Config{ExecutablePath: bin, Logger: slog.Default()})+ if err != nil {+ t.Fatalf("New(mcode): %v", err)+ }+ session, err := backend.Execute(context.Background(), "continue", ExecOptions{+ Cwd: t.TempDir(),+ ResumeSessionID: "old-mcode-session",+ })+ if err != nil {+ t.Fatalf("Execute: %v", err)+ }+ for range session.Messages {+ }+ result := <-session.Result+ if result.Status != "completed" || result.SessionID != "old-mcode-session" {+ t.Fatalf("result = %+v", result)+ }+ requests, err := os.ReadFile(requestsFile)+ if err != nil {+ t.Fatalf("read requests: %v", err)+ }+ if !strings.Contains(string(requests), `"method":"session/load"`) {+ t.Fatalf("loadSession capability was not honored:\n%s", requests)+ }+}++func TestMcodeBlockedArgsKeepACPTransportStable(t *testing.T) {+ t.Parallel()+ for _, arg := range []string{"acp", "login", "--region", "-h", "--help"} {+ if _, ok := mcodeBlockedArgs[arg]; !ok {+ t.Errorf("mcodeBlockedArgs missing %q", arg)+ }+ }+}diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.goindex 2b34e6d9c0..06b7ce1777 100644--- a/server/pkg/agent/models.go+++ b/server/pkg/agent/models.go@@ -243,6 +243,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 "mcode":+ // MCode's ACP server does not expose session-scoped model selection or+ // a model catalog. The configured MCode runtime owns the model choice.+ return Catalog{Models: []Model{}}, nilcase "grok":// xAI Grok Build is ACP-native (`grok agent stdio`); model catalog// comes from session/new. Falls back to a small static list so the@@ -269,13 +273,15 @@ func ListModels(ctx context.Context, providerType string, runtimeCmd Command) (C// dropdown plus a silently-ignored manual-entry field.func ModelSelectionSupported(providerType string) bool {switch providerType {- case "qwenpaw":+ case "qwenpaw", "mcode":// QwenPaw's `session/set_model` persists to agent.json at the agent// scope, not the session scope. Calling it would mutate the user's// shared, persistent agent config. Model override is therefore// unsupported — the runtime uses whatever model is configured in// the agent profile. If QwenPaw makes model selection session-scoped- // upstream, this can be reverted to `true`.+ // upstream, this can be reverted to `true`. MCode similarly exposes no+ // model option through ACP, so its runtime configuration remains the+ // source of truth.return falsedefault:return truediff --git a/server/pkg/agent/version.go b/server/pkg/agent/version.goindex 85ad406d3d..605ff7cc4f 100644--- a/server/pkg/agent/version.go+++ b/server/pkg/agent/version.go@@ -16,6 +16,7 @@ var MinVersions = map[string]string{"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+ "mcode": "0.1.2", // ACP v1 session/new, prompt, MCP capability forwarding}// MinQuickCreateCLIVersion gates the agent-create (quick-create) flow againstdiff --git a/server/pkg/agent/version_test.go b/server/pkg/agent/version_test.goindex 040e3e0b15..14a871e2e3 100644--- a/server/pkg/agent/version_test.go+++ b/server/pkg/agent/version_test.go@@ -175,6 +175,8 @@ func TestCheckMinVersion(t *testing.T) {{"qwen", "0.20.0", false},{"qwen", "qwen 0.20.1", false},{"qwen", "0.19.9", true},+ {"mcode", "0.1.2", false},+ {"mcode", "mcode 0.1.1", true},{"unknown", "1.0.0", false},}for _, tt := range tests {