Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(agent): add oh-my-pi (omp) as a supported agent runtime (#6514)

feig3dd128532c0c
diff --git a/apps/docs/content/docs/install-agent-runtime.ja.mdx b/apps/docs/content/docs/install-agent-runtime.ja.mdx
index 224ef00a16..becf4b21de 100644
--- a/apps/docs/content/docs/install-agent-runtime.ja.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ja.mdx
@@ -29,6 +29,7 @@ Multica は現在、次のコマンドを検出します。
| 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) |
+| Oh-My-Pi | `omp` | [Oh-My-Pi インストール](https://omp.sh) |
| Qoder CLI | `qodercli` | [Qoder CLI クイックスタート](https://docs.qoder.com/en/cli/quick-start) |
| Qoder CN CLI | `qoderclicn` | [Qoder CN CLI クイックスタート](https://help.aliyun.com/en/lingma/qodercli-cn/user-guide/qoder-cli-cn-get-started-quickly) |
| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
diff --git a/apps/docs/content/docs/install-agent-runtime.ko.mdx b/apps/docs/content/docs/install-agent-runtime.ko.mdx
index e329e2fafd..871dcec9e6 100644
--- a/apps/docs/content/docs/install-agent-runtime.ko.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ko.mdx
@@ -29,6 +29,7 @@ Multica는 현재 다음 명령을 감지합니다.
| 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) |
+| Oh-My-Pi | `omp` | [Oh-My-Pi 설치](https://omp.sh) |
| Qoder CLI | `qodercli` | [Qoder CLI 빠른 시작](https://docs.qoder.com/en/cli/quick-start) |
| Qoder CN CLI | `qoderclicn` | [Qoder CN CLI 빠른 시작](https://help.aliyun.com/en/lingma/qodercli-cn/user-guide/qoder-cli-cn-get-started-quickly) |
| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
diff --git a/apps/docs/content/docs/install-agent-runtime.mdx b/apps/docs/content/docs/install-agent-runtime.mdx
index bce57c7af8..2269aa9ab7 100644
--- a/apps/docs/content/docs/install-agent-runtime.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.mdx
@@ -29,6 +29,7 @@ Multica currently detects these commands:
| 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) |
+| Oh-My-Pi | `omp` | [Oh-My-Pi install](https://omp.sh) |
| Qoder CLI | `qodercli` | [Qoder CLI quickstart](https://docs.qoder.com/en/cli/quick-start) |
| Qoder CN CLI | `qoderclicn` | [Qoder CN CLI quickstart](https://help.aliyun.com/en/lingma/qodercli-cn/user-guide/qoder-cli-cn-get-started-quickly) |
| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
diff --git a/apps/docs/content/docs/install-agent-runtime.zh.mdx b/apps/docs/content/docs/install-agent-runtime.zh.mdx
index aeeb56d76d..1e78e6df89 100644
--- a/apps/docs/content/docs/install-agent-runtime.zh.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.zh.mdx
@@ -29,6 +29,7 @@ Multica 当前会检测以下命令:
| 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) |
+| Oh-My-Pi | `omp` | [Oh-My-Pi 安装](https://omp.sh) |
| Qoder CLI | `qodercli` | [Qoder CLI 快速开始](https://docs.qoder.com/en/cli/quick-start) |
| Qoder CN CLI | `qoderclicn` | [Qoder CN CLI 快速开始](https://help.aliyun.com/zh/lingma/qodercli-cn/user-guide/qoder-cli-cn-get-started-quickly) |
| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
diff --git a/apps/docs/content/docs/providers.ja.mdx b/apps/docs/content/docs/providers.ja.mdx
index 86cb19e742..c9a1b54581 100644
--- a/apps/docs/content/docs/providers.ja.mdx
+++ b/apps/docs/content/docs/providers.ja.mdx
@@ -34,6 +34,7 @@ Multica は、普段使っている AI コーディングツールの代わり
| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Oh-My-Pi | `omp` | ✓ | — | `.omp/skills/` |
| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
| Qoder CN CLI | `qoderclicn` | ✓ | ✓ | `.qoder/skills/` |
| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
diff --git a/apps/docs/content/docs/providers.ko.mdx b/apps/docs/content/docs/providers.ko.mdx
index 0a983b50f3..7d24b446cb 100644
--- a/apps/docs/content/docs/providers.ko.mdx
+++ b/apps/docs/content/docs/providers.ko.mdx
@@ -34,6 +34,7 @@ Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타
| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Oh-My-Pi | `omp` | ✓ | — | `.omp/skills/` |
| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
| Qoder CN CLI | `qoderclicn` | ✓ | ✓ | `.qoder/skills/` |
| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdx
index 191e1b5c25..166a6b6071 100644
--- a/apps/docs/content/docs/providers.mdx
+++ b/apps/docs/content/docs/providers.mdx
@@ -34,6 +34,7 @@ Install steps are in [Install AI coding tools](/install-agent-runtime).
| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Oh-My-Pi | `omp` | ✓ | — | `.omp/skills/` |
| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
| Qoder CN CLI | `qoderclicn` | ✓ | ✓ | `.qoder/skills/` |
| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdx
index bb65d94705..484e5faea2 100644
--- a/apps/docs/content/docs/providers.zh.mdx
+++ b/apps/docs/content/docs/providers.zh.mdx
@@ -34,6 +34,7 @@ Multica 不会替代你使用的 AI 编程工具。运行时会调用电脑上
| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Oh-My-Pi | `omp` | ✓ | — | `.omp/skills/` |
| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
| Qoder CN CLI | `qoderclicn` | ✓ | ✓ | `.qoder/skills/` |
| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
diff --git a/apps/web/features/landing/i18n/en.ts b/apps/web/features/landing/i18n/en.ts
index 47bd13f6a5..8e2431e81d 100644
--- a/apps/web/features/landing/i18n/en.ts
+++ b/apps/web/features/landing/i18n/en.ts
@@ -116,7 +116,7 @@ export function createEnDict(allowSignup: boolean): LandingDict {
{
title: "Auto-detection on first run",
description:
- "Multica scans for 20 supported coding tools \u2014 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, and Trae CLI \u2014 and registers a runtime for each one it finds.",
+ "Multica scans for 21 supported coding tools \u2014 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, and Trae CLI \u2014 and registers a runtime for each one it finds.",
},
],
},
@@ -136,7 +136,7 @@ export function createEnDict(allowSignup: boolean): LandingDict {
{
title: "Install the CLI & connect your machine",
description:
- "Run multica setup \u2014 it walks you through OAuth, starts the daemon, and scans for the 20 supported coding tools (Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI). 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 21 supported coding tools (Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI). Whichever ones you already have installed get registered as runtimes automatically.",
},
{
title: "Create your first agent",
@@ -192,7 +192,7 @@ export function createEnDict(allowSignup: boolean): LandingDict {
{
question: "What coding agents does Multica support?",
answer:
- "Multica supports 20 coding tools out of the box: Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, and Trae CLI. The daemon auto-detects whichever CLIs you already have installed and registers a runtime for each one. Since it's open source, you can also add your own backends.",
+ "Multica supports 21 coding tools out of the box: Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, and Trae CLI. The daemon auto-detects whichever CLIs you already have installed and registers a runtime for each one. Since it's open source, you can also add your own backends.",
},
{
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.ts
index d88e097f94..8274c17043 100644
--- a/apps/web/features/landing/i18n/ja.ts
+++ b/apps/web/features/landing/i18n/ja.ts
@@ -118,7 +118,7 @@ export function createJaDict(allowSignup: boolean): LandingDict {
{
title: "初回起動時に自動検出",
description:
- "Multica は Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI という20種類の対応ツールをスキャンし、見つかったものをそれぞれランタイムとして登録します。",
+ "Multica は Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI という21種類の対応ツールをスキャンし、見つかったものをそれぞれランタイムとして登録します。",
},
],
},
@@ -139,7 +139,7 @@ export function createJaDict(allowSignup: boolean): LandingDict {
{
title: "CLI をインストールしてマシンを接続",
description:
- "multica setup を実行すると、OAuth の手順を案内し、デーモンを起動し、20種類の対応コーディングツール(Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI)をスキャンします。すでにインストール済みのものは、自動的にランタイムとして登録されます。",
+ "multica setup を実行すると、OAuth の手順を案内し、デーモンを起動し、21種類の対応コーディングツール(Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI)をスキャンします。すでにインストール済みのものは、自動的にランタイムとして登録されます。",
},
{
title: "最初のエージェントを作成",
@@ -193,7 +193,7 @@ export function createJaDict(allowSignup: boolean): LandingDict {
{
question: "Multica はどのコーディングエージェントに対応していますか?",
answer:
- "Multica は、Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI の20種類のコーディングツールに標準対応しています。デーモンが、すでにインストール済みの CLI を自動検出し、それぞれをランタイムとして登録します。オープンソースなので、独自のバックエンドを追加することもできます。",
+ "Multica は、Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI の21種類のコーディングツールに標準対応しています。デーモンが、すでにインストール済みの CLI を自動検出し、それぞれをランタイムとして登録します。オープンソースなので、独自のバックエンドを追加することもできます。",
},
{
question: "セルフホストが必須ですか、それともクラウド版もありますか?",
diff --git a/apps/web/features/landing/i18n/ko.ts b/apps/web/features/landing/i18n/ko.ts
index 329d8b0bd1..0a80bf800a 100644
--- a/apps/web/features/landing/i18n/ko.ts
+++ b/apps/web/features/landing/i18n/ko.ts
@@ -118,7 +118,7 @@ export function createKoDict(allowSignup: boolean): LandingDict {
{
title: "처음 실행할 때 자동 등록",
description:
- "Multica는 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI 등 20개 지원 도구를 스캔해 이미 설치된 것을 런타임으로 자동 등록합니다.",
+ "Multica는 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI 등 21개 지원 도구를 스캔해 이미 설치된 것을 런타임으로 자동 등록합니다.",
},
],
},
@@ -193,7 +193,7 @@ export function createKoDict(allowSignup: boolean): LandingDict {
{
question: "Multica는 어떤 코딩 에이전트를 지원하나요?",
answer:
- "Multica는 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI 등 20개 코딩 도구를 기본 지원합니다. 데몬이 이미 설치된 CLI를 자동으로 찾아 각각 런타임으로 등록합니다. 오픈소스이므로 직접 백엔드를 추가할 수도 있습니다.",
+ "Multica는 Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, DevEco Code, Grok, Hermes, Kimi, Kiro CLI, Oh-My-Pi, OpenClaw, OpenCode, Pi, Qoder, Qoder CN, Qwen Code, QwenPaw, Reasonix, Trae CLI 등 21개 코딩 도구를 기본 지원합니다. 데몬이 이미 설치된 CLI를 자동으로 찾아 각각 런타임으로 등록합니다. 오픈소스이므로 직접 백엔드를 추가할 수도 있습니다.",
},
{
question: "셀프 호스팅만 가능한가요, 클라우드 버전도 있나요?",
diff --git a/apps/web/features/landing/i18n/zh.ts b/apps/web/features/landing/i18n/zh.ts
index 606c423b21..24f7bebc65 100644
--- a/apps/web/features/landing/i18n/zh.ts
+++ b/apps/web/features/landing/i18n/zh.ts
@@ -116,7 +116,7 @@ export function createZhDict(allowSignup: boolean): LandingDict {
{
title: "\u9996\u6b21\u542f\u52a8\u81ea\u52a8\u6ce8\u518c",
description:
- "Multica \u626b\u63cf\u672c\u673a\u7684 20 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u2014\u2014Antigravity\u3001Claude Code\u3001CodeBuddy\u3001Codex\u3001Copilot\u3001Cursor\u3001DevEco Code\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\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 21 \u6b3e\u652f\u6301\u7684 AI \u7f16\u7a0b\u5de5\u5177\u2014\u2014Antigravity\u3001Claude Code\u3001CodeBuddy\u3001Codex\u3001Copilot\u3001Cursor\u3001DevEco Code\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\u2014\u2014\u5e76\u4e3a\u6bcf\u6b3e\u5df2\u5b89\u88c5\u7684\u5de5\u5177\u6ce8\u518c\u4e00\u4e2a\u8fd0\u884c\u65f6\u3002",
},
],
},
@@ -136,7 +136,7 @@ export function createZhDict(allowSignup: boolean): LandingDict {
{
title: "\u5b89\u88c5 CLI \u5e76\u8fde\u63a5\u4f60\u7684\u673a\u5668",
description:
- "运行 multica setup——它会引导你完成 OAuth 登录、启动守护进程、并扫描 20 款支持的 AI 编程工具(Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI)。本机已安装的工具会被自动注册成运行时。",
+ "运行 multica setup——它会引导你完成 OAuth 登录、启动守护进程、并扫描 21 款支持的 AI 编程工具(Antigravity、Claude Code、CodeBuddy、Codex、Copilot、Cursor、DevEco Code、Grok、Hermes、Kimi、Kiro CLI、Oh-My-Pi、OpenClaw、OpenCode、Pi、Qoder、Qoder CN、Qwen Code、QwenPaw、Reasonix、Trae CLI)。本机已安装的工具会被自动注册成运行时。",
},
{
title: "\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2a 智能体",
@@ -192,7 +192,7 @@ export function createZhDict(allowSignup: boolean): LandingDict {
{
question: "Multica \u652f\u6301\u54ea\u4e9b\u7f16\u7801 智能体\uff1f",
answer:
- "Multica \u5f00\u7bb1\u5373\u7528\u652f\u6301 20 \u6b3e AI \u7f16\u7a0b\u5de5\u5177\uff1aAntigravity\u3001Claude Code\u3001CodeBuddy\u3001Codex\u3001Copilot\u3001Cursor\u3001DevEco Code\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\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\u56e0\u4e3a\u5f00\u6e90\uff0c\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u6dfb\u52a0\u540e\u7aef\u3002",
+ "Multica \u5f00\u7bb1\u5373\u7528\u652f\u6301 21 \u6b3e AI \u7f16\u7a0b\u5de5\u5177\uff1aAntigravity\u3001Claude Code\u3001CodeBuddy\u3001Codex\u3001Copilot\u3001Cursor\u3001DevEco Code\u3001Grok\u3001Hermes\u3001Kimi\u3001Kiro CLI\u3001Oh-My-Pi\u3001OpenClaw\u3001OpenCode\u3001Pi\u3001Qoder\u3001Qoder CN\u3001Qwen Code\u3001QwenPaw\u3001Reasonix\u3001Trae CLI\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\u56e0\u4e3a\u5f00\u6e90\uff0c\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u6dfb\u52a0\u540e\u7aef\u3002",
},
{
question: "\u9700\u8981\u81ea\u6258\u7ba1\u5417\uff0c\u8fd8\u662f\u6709\u4e91\u7248\u672c\uff1f",
diff --git a/packages/core/runtimes/display.ts b/packages/core/runtimes/display.ts
index 273ba6fbc2..d86ee910cd 100644
--- a/packages/core/runtimes/display.ts
+++ b/packages/core/runtimes/display.ts
@@ -45,6 +45,7 @@ const PROVIDER_DISPLAY_NAMES: Record<string, string> = {
traecli: "Trae",
qwen: "Qwen Code",
qwenpaw: "QwenPaw",
+ omp: "Oh-My-Pi",
};
/**
diff --git a/packages/views/common/task-transcript/agent-transcript-dialog.test.tsx b/packages/views/common/task-transcript/agent-transcript-dialog.test.tsx
index d2924486fb..76cedb3ab6 100644
--- a/packages/views/common/task-transcript/agent-transcript-dialog.test.tsx
+++ b/packages/views/common/task-transcript/agent-transcript-dialog.test.tsx
@@ -2,6 +2,7 @@
import { readFileSync } from "node:fs";
import { cleanup, fireEvent, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { ButtonHTMLAttributes, ReactNode } from "react";
import { api } from "@multica/core/api";
@@ -586,4 +587,25 @@ describe("AgentTranscriptDialog", () => {
expect(screen.queryByRole("button", { name: "Show all" })).not.toBeInTheDocument();
});
+
+ // The run-details provider row used to carry its own name map. Pointing it at
+ // the shared runtime formatter is right for every provider except Claude,
+ // whose runtime-list name is "Claude" while this diagnostic row has always
+ // said "Claude Code" — and whose legacy `claude-code` slug title-cases into
+ // "Claude-code". Both aliases are pinned here so the next cleanup keeps them.
+ it.each([
+ ["claude", "Claude Code"],
+ ["claude-code", "Claude Code"],
+ // Everything outside the alias table defers to the shared runtime
+ // formatter, so a new provider needs no edit here.
+ ["omp", "Oh-My-Pi"],
+ ])("names a %s run %s in the run details", async (provider, expected) => {
+ const user = userEvent.setup();
+ vi.mocked(api.listRuntimes).mockResolvedValue([runtimeFor(provider)]);
+
+ renderDialog(items, { task: { ...baseTask, runtime_id: "runtime-1" } });
+
+ await user.click(await screen.findByRole("button", { name: "Run details" }));
+ expect(await screen.findByText(expected)).toBeInTheDocument();
+ });
});
diff --git a/packages/views/common/task-transcript/agent-transcript-dialog.tsx b/packages/views/common/task-transcript/agent-transcript-dialog.tsx
index 08cbd2b1bd..deb192d374 100644
--- a/packages/views/common/task-transcript/agent-transcript-dialog.tsx
+++ b/packages/views/common/task-transcript/agent-transcript-dialog.tsx
@@ -48,7 +48,7 @@ import {
type TranscriptSortDirection,
} from "@multica/core/agents/stores";
import type { AgentTask, Agent, AgentRuntime } from "@multica/core/types/agent";
-import { runtimeDisplayName } from "@multica/core/runtimes";
+import { runtimeDisplayName, providerDisplayName } from "@multica/core/runtimes";
import { useCustomPricingStore } from "@multica/core/runtimes/custom-pricing-store";
import { redactSecrets } from "./redact";
import {
@@ -606,7 +606,7 @@ export function AgentTranscriptDialog({
// Diagnostic detail for the ⓘ popover: everything a reader needs only when
// debugging this specific run, kept off the always-visible surface.
- const providerLabel = runtimeInfo?.provider ? formatProvider(runtimeInfo.provider) : null;
+ const providerLabel = runtimeInfo?.provider ? transcriptProviderLabel(runtimeInfo.provider) : null;
const createdLabel = task.created_at ? formatRunTime(task.created_at) : null;
const startedLabel = task.started_at ? formatRunTime(task.started_at) : null;
const completedLabel = task.completed_at ? formatRunTime(task.completed_at) : null;
@@ -1062,6 +1062,22 @@ function SortDirectionToggle({ value, onChange, labels }: SortDirectionTogglePro
);
}
+// Provider slugs this view names differently from the runtime list. The daemon
+// has no display-name override for Claude, so the shared formatter answers
+// "Claude" — but a run's diagnostics have always named the tool "Claude Code",
+// and `claude-code` is a legacy provider value still present on older tasks
+// (title-casing it alone would read as "Claude-code"). Every other provider
+// defers to the shared formatter so this row cannot drift from the runtime
+// list the way it did before (#5260).
+const TRANSCRIPT_PROVIDER_LABELS: Record<string, string> = {
+ claude: "Claude Code",
+ "claude-code": "Claude Code",
+};
+
+function transcriptProviderLabel(provider: string): string {
+ return TRANSCRIPT_PROVIDER_LABELS[provider.toLowerCase()] ?? providerDisplayName(provider);
+}
+
// ─── Facts line separator ───────────────────────────────────────────────────
function FactDot() {
@@ -1072,16 +1088,6 @@ function FactDot() {
);
}
-function formatProvider(provider: string): string {
- const map: Record<string, string> = {
- claude: "Claude Code",
- "claude-code": "Claude Code",
- codex: "Codex",
- pi: "Pi",
- };
- return map[provider.toLowerCase()] ?? provider;
-}
-
// ─── Timeline bar (colored segments) ────────────────────────────────────────
function TimelineBar({
diff --git a/packages/views/runtimes/components/provider-logo.tsx b/packages/views/runtimes/components/provider-logo.tsx
index 15837333e7..19c12f84b8 100644
--- a/packages/views/runtimes/components/provider-logo.tsx
+++ b/packages/views/runtimes/components/provider-logo.tsx
@@ -335,6 +335,8 @@ export function ProviderLogo({
return <HermesLogo className={className} />;
case "pi":
return <PiLogo className={className} />;
+ case "omp":
+ return <PiLogo className={className} />;
case "copilot":
return <CopilotLogo className={className} />;
case "cursor":
diff --git a/scripts/agent-cli-command-names.txt b/scripts/agent-cli-command-names.txt
index ae3e753faf..8d21fc0e07 100644
--- a/scripts/agent-cli-command-names.txt
+++ b/scripts/agent-cli-command-names.txt
@@ -9,6 +9,7 @@ grok
hermes
kimi
kiro-cli
+omp
openclaw
opencode
pi
diff --git a/server/internal/daemon/agent_command_names_test.go b/server/internal/daemon/agent_command_names_test.go
index 103a126c09..b326a399b3 100644
--- a/server/internal/daemon/agent_command_names_test.go
+++ b/server/internal/daemon/agent_command_names_test.go
@@ -11,6 +11,8 @@ import (
"sort"
"strings"
"testing"
+
+ "github.com/multica-ai/multica/server/pkg/agent"
)
// TestDefaultAgentCommandNamesCoversAllProbes guards the invariant documented
@@ -74,11 +76,22 @@ func TestDefaultAgentCommandNamesCoversAllProbes(t *testing.T) {
// Without this the whole test passes vacuously the moment probeAgentCLIs
// moves to another file, which is exactly how this guard failed before.
- if probeCalls < len(defaultAgentCommandNames) {
- t.Fatalf("found only %d probe() call(s) with a literal command name in %s, "+
+ // Built-in runtime identities (from agent.BuiltinRuntimes) are probed in
+ // a loop, not with literal probe() calls, so their command names are
+ // counted from the descriptor, not the AST.
+ descriptorProbes := len(agent.BuiltinRuntimes)
+ if probeCalls+descriptorProbes < len(defaultAgentCommandNames) {
+ t.Fatalf("found only %d probe() call(s) (%d literal + %d from descriptor) in %s, "+
"expected at least %d (one per default agent command); "+
"did the probe loop move, or is a provider probed without probe()?",
- probeCalls, probeSourceFile, len(defaultAgentCommandNames))
+ probeCalls+descriptorProbes, probeCalls, descriptorProbes, probeSourceFile, len(defaultAgentCommandNames))
+ }
+
+ // Also verify that built-in runtime descriptor commands are covered.
+ for _, desc := range agent.BuiltinRuntimes {
+ if !known[desc.DefaultCommand] {
+ missing = append(missing, desc.DefaultCommand)
+ }
}
if len(missing) > 0 {
diff --git a/server/internal/daemon/agents_probe.go b/server/internal/daemon/agents_probe.go
index 53e9aad6ec..c325891b1a 100644
--- a/server/internal/daemon/agents_probe.go
+++ b/server/internal/daemon/agents_probe.go
@@ -5,6 +5,8 @@ import (
"strings"
"sync"
"time"
+
+ "github.com/multica-ai/multica/server/pkg/agent"
)
// shellResolveTTL bounds how long one login-shell PATH resolution is reused
@@ -168,6 +170,18 @@ var probeAgentCLIs = func() map[string]AgentEntry {
if e, ok := probe("MULTICA_PI_PATH", "pi", "MULTICA_PI_MODEL"); ok {
agents["pi"] = e
}
+ // Built-in runtime identities (e.g. omp) are derived from the descriptor
+ // registry in server/pkg/agent/builtin_runtimes.go. Each one probes a
+ // separate CLI independently so a host with both pi and omp installed gets
+ // two runtimes. The env prefix and default command come from the
+ // descriptor, so adding a new fork is a descriptor entry, not a probe edit.
+ for _, desc := range agent.BuiltinRuntimes {
+ pathEnv := desc.EnvPrefix + "_PATH"
+ modelEnv := desc.EnvPrefix + "_MODEL"
+ if e, ok := probe(pathEnv, desc.DefaultCommand, modelEnv); ok {
+ agents[desc.ID] = e
+ }
+ }
if e, ok := probe("MULTICA_CURSOR_PATH", "cursor-agent", "MULTICA_CURSOR_MODEL"); ok {
agents["cursor"] = e
}
diff --git a/server/internal/daemon/agents_probe_omp_test.go b/server/internal/daemon/agents_probe_omp_test.go
new file mode 100644
index 0000000000..c5ee6555d3
--- /dev/null
+++ b/server/internal/daemon/agents_probe_omp_test.go
@@ -0,0 +1,157 @@
+package daemon
+
+import (
+ "context"
+ "os"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ "github.com/multica-ai/multica/server/pkg/agent"
+)
+
+// TestProbeAgentCLIs_DiscoversPiAndOmpSeparately covers discovery only: it
+// places fake `pi` and `omp` binaries on PATH, runs the real probeAgentCLIs(),
+// and asserts the descriptor-driven probe loop in agents_probe.go finds two
+// separate entries with the right commands.
+//
+// Discovery is not registration — whether the server is actually told about
+// both runtimes is covered by TestRegisterRuntimes_PiAndOmpBothReachTheServer.
+func TestProbeAgentCLIs_DiscoversPiAndOmpSeparately(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ fakeDir := t.TempDir()
+ for _, name := range []string{"pi", "omp"} {
+ fakePath := filepath.Join(fakeDir, name)
+ writeDaemonTestExecutable(t, fakePath, []byte("#!/bin/sh\nexit 0\n"))
+ }
+
+ // Stub the login-shell resolver so it doesn't try to fork a shell.
+ orig := resolveAgentsViaLoginShell
+ t.Cleanup(func() { resolveAgentsViaLoginShell = orig })
+ resolveAgentsViaLoginShell = func([]string) map[string]string {
+ return map[string]string{}
+ }
+ resetShellResolveCacheForTest(t)
+
+ t.Setenv("PATH", fakeDir)
+ t.Setenv("MULTICA_PI_PATH", "")
+ t.Setenv("MULTICA_OMP_PATH", "")
+
+ agents := probeAgentCLIs()
+
+ // Both pi and omp should be discovered as separate entries.
+ piEntry, piOk := agents["pi"]
+ if !piOk {
+ t.Fatal("pi was not discovered by probeAgentCLIs; expected both pi and omp")
+ }
+ ompEntry, ompOk := agents["omp"]
+ if !ompOk {
+ t.Fatal("omp was not discovered by probeAgentCLIs; expected both pi and omp")
+ }
+
+ if piEntry.Command != "pi" {
+ t.Errorf("pi command = %q, want %q", piEntry.Command, "pi")
+ }
+ if ompEntry.Command != "omp" {
+ t.Errorf("omp command = %q, want %q", ompEntry.Command, "omp")
+ }
+
+ // Verify the omp descriptor's display name is what the daemon would
+ // surface in the registration payload (detectBuiltinRuntimes calls
+ // providerDisplayName for each agent).
+ ompDisplayName := providerDisplayName("omp")
+ if ompDisplayName != "Oh-My-Pi" {
+ t.Errorf("omp display name = %q, want %q", ompDisplayName, "Oh-My-Pi")
+ }
+
+ // Verify the pi descriptor is NOT a built-in runtime (it's a protocol
+ // family), while omp IS a built-in runtime identity.
+ if agent.IsBuiltinRuntime("pi") {
+ t.Error("pi should not be a built-in runtime (it is a protocol family)")
+ }
+ if !agent.IsBuiltinRuntime("omp") {
+ t.Error("omp should be a built-in runtime identity")
+ }
+}
+
+// writeDaemonTestExecutable is a helper for the daemon package's test files.
+func writeDaemonTestExecutable(t *testing.T, path string, content []byte) {
+ t.Helper()
+ if err := os.WriteFile(path, content, 0o755); err != nil {
+ t.Fatalf("write %s: %v", path, err)
+ }
+}
+
+// TestRegisterRuntimes_PiAndOmpBothReachTheServer takes the pair the whole
+// feature exists for all the way to the wire: real discovery off PATH, then
+// the daemon's own registration round, asserting the payload the server
+// receives carries both `pi` and `omp` as separate runtimes with their own
+// display names.
+//
+// Discovery finding two entries (TestProbeAgentCLIs_DiscoversPiAndOmpSeparately)
+// and New() building two backends both stop short of this: neither runs version
+// detection, builds a registration payload, or proves the server ends up with
+// two rows. A runtime identity that never reaches Register is invisible to the
+// user no matter how correct its descriptor is.
+func TestRegisterRuntimes_PiAndOmpBothReachTheServer(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ fakeDir := t.TempDir()
+ for _, name := range []string{"pi", "omp"} {
+ writeDaemonTestExecutable(t, filepath.Join(fakeDir, name), []byte("#!/bin/sh\nexit 0\n"))
+ }
+
+ origResolve := resolveAgentsViaLoginShell
+ t.Cleanup(func() { resolveAgentsViaLoginShell = origResolve })
+ resolveAgentsViaLoginShell = func([]string) map[string]string { return map[string]string{} }
+ resetShellResolveCacheForTest(t)
+
+ t.Setenv("PATH", fakeDir)
+ t.Setenv("MULTICA_PI_PATH", "")
+ t.Setenv("MULTICA_OMP_PATH", "")
+
+ agents := probeAgentCLIs()
+ piEntry, ok := agents["pi"]
+ if !ok {
+ t.Fatal("pi not discovered; the registration assertion below would be vacuous")
+ }
+ ompEntry, ok := agents["omp"]
+ if !ok {
+ t.Fatal("omp not discovered; the registration assertion below would be vacuous")
+ }
+
+ fx := newBatchFixture(t)
+ d := fx.daemon
+ d.cfg.Agents = map[string]AgentEntry{"pi": piEntry, "omp": ompEntry}
+ fx.setWorkspaces(WorkspaceInfo{ID: "ws-1", Name: "one"})
+
+ if err := d.syncWorkspacesFromAPI(context.Background(), false); err != nil {
+ t.Fatalf("syncWorkspacesFromAPI: %v", err)
+ }
+
+ types, calls := fx.registrationFor("ws-1")
+ if calls == 0 {
+ t.Fatal("no Register call reached the server")
+ }
+ registered := make(map[string]bool, len(types))
+ for _, ty := range types {
+ registered[ty] = true
+ }
+ if !registered["pi"] || !registered["omp"] {
+ t.Fatalf("registered runtime types = %v, want both pi and omp", types)
+ }
+
+ // The point of a separate runtime identity is that the user can tell the
+ // two apart, so the payload has to carry omp's own name — not Pi's.
+ if got := fx.registeredNameFor("ws-1", "omp"); got != "Oh-My-Pi" {
+ t.Errorf("registered omp name = %q, want %q", got, "Oh-My-Pi")
+ }
+ if got := fx.registeredNameFor("ws-1", "pi"); got != "Pi" {
+ t.Errorf("registered pi name = %q, want %q", got, "Pi")
+ }
+}
diff --git a/server/internal/daemon/config.go b/server/internal/daemon/config.go
index cea2df9030..59e6b9128b 100644
--- a/server/internal/daemon/config.go
+++ b/server/internal/daemon/config.go
@@ -14,6 +14,7 @@ import (
"github.com/mattn/go-shellwords"
"github.com/multica-ai/multica/server/internal/cli"
+ "github.com/multica-ai/multica/server/pkg/agent"
)
const (
@@ -91,7 +92,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 standalone
Profile string // profile name (empty = default)
- Agents map[string]AgentEntry // keyed by provider: claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, kiro, antigravity, qoder, qoderclicn, traecli, grok, qwen, qwenpaw
+ Agents map[string]AgentEntry // keyed by provider: claude, codebuddy, codex, copilot, opencode, openclaw, hermes, pi, cursor, kimi, reasonix, kiro, antigravity, qoder, qoderclicn, traecli, grok, qwen, qwenpaw (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 debugging
HealthPort int // local HTTP port for health checks (default: 19514)
@@ -225,7 +226,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, cursor-agent, kimi, reasonix, 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, kiro-cli, agy, qodercli, qoderclicn, traecli, grok, qwen, or qwenpaw and ensure it is on PATH")
}
claudeArgs, err := shellArgsFromEnv("MULTICA_CLAUDE_ARGS")
@@ -759,10 +760,14 @@ func isExecutableFile(path string) bool {
// `probe(...)` calls in LoadConfig — the shell-fallback resolver uses this
// list to pre-fetch canonical paths for every known agent in a single shell
// invocation, instead of paying the cost-per-miss.
-var defaultAgentCommandNames = []string{
+//
+// Built-in runtime identity commands (e.g. "omp") are appended from the
+// descriptor registry (agent.BuiltinRuntimeCommands) so adding a new fork
+// doesn't require editing this list by hand.
+var defaultAgentCommandNames = append([]string{
"claude", "codex", "opencode", "deveco", "openclaw", "hermes",
"pi", "cursor-agent", "copilot", "kimi", "reasonix", "kiro-cli", "codebuddy", "agy", "qodercli", "qoderclicn", "traecli", "grok", "qwen", "qwenpaw",
-}
+}, agent.BuiltinRuntimeCommands()...)
// codexDesktopAppBundlePaths returns candidate macOS app-bundle locations for
// the bundled Codex CLI. OpenAI relocated the Desktop app from Codex.app to
diff --git a/server/internal/daemon/daemon.go b/server/internal/daemon/daemon.go
index 39e1848872..32f1d7d762 100644
--- a/server/internal/daemon/daemon.go
+++ b/server/internal/daemon/daemon.go
@@ -5130,6 +5130,9 @@ func gcMetaForTask(task Task) (execenv.GCMeta, bool) {
// runtimeDisplayNameOverrides maps a provider key to the human-facing runtime
// name when simple title-casing would read awkwardly. Providers not listed
// here fall back to capitalizing the key (claude → "Claude", codex → "Codex").
+// Built-in runtime identities (from agent.BuiltinRuntimes) are seeded into
+// this map at init so their display names stay in lockstep with the
+// descriptor.
var runtimeDisplayNameOverrides = map[string]string{
"traecli": "Trae",
"grok": "Grok",
@@ -5138,6 +5141,14 @@ var runtimeDisplayNameOverrides = map[string]string{
"qwenpaw": "QwenPaw",
}
+func init() {
+ // Seed built-in runtime identity display names from the descriptor so
+ // adding a new fork doesn't require editing this map by hand.
+ for _, desc := range agent.BuiltinRuntimes {
+ runtimeDisplayNameOverrides[desc.ID] = desc.DisplayName
+ }
+}
+
// providerDisplayName returns the human-facing runtime name for a provider key.
func providerDisplayName(name string) string {
if name == "" {
@@ -6096,7 +6107,12 @@ func (d *Daemon) runTask(ctx context.Context, task Task, provider string, slot i
if err := configureCodexTaskShellEnvironment(provider, env.CodexHome, os.Environ(), agentEnv, agentCustomEnv, d.logger); err != nil {
return TaskResult{}, err
}
- backend, err := agent.New(provider, agent.Config{
+ // Resolve the backend through the unified runtime resolver: built-in
+ // runtime identities (e.g. "omp") dispatch through NewRuntime, protocol
+ // families go through New. This is the single production boundary — the
+ // daemon never calls agent.New or agent.NewRuntime directly, so the two
+ // factories stay meaning exactly one thing each.
+ backend, err := agent.ResolveBackend(provider, agent.Config{
ExecutablePath: entry.Path,
CLIVersion: resolvedVersion,
Env: agentEnv,
diff --git a/server/internal/daemon/daemon_test.go b/server/internal/daemon/daemon_test.go
index e569f700e2..d2905d1db2 100644
--- a/server/internal/daemon/daemon_test.go
+++ b/server/internal/daemon/daemon_test.go
@@ -2690,7 +2690,7 @@ func TestShouldRetryWithFreshSession_CompatPathIsBackendScoped(t *testing.T) {
})
}
- detectable := []string{"claude", "codebuddy", "qwen", "codex", "grok", "hermes", "kimi", "reasonix", "kiro", "qoder", "qoderclicn", "traecli", "pi", "openclaw"}
+ detectable := []string{"claude", "codebuddy", "qwen", "codex", "grok", "hermes", "kimi", "reasonix", "kiro", "qoder", "qoderclicn", "traecli", "pi", "omp", "openclaw"}
for _, provider := range detectable {
t.Run(provider+" does not retry", func(t *testing.T) {
t.Parallel()
diff --git a/server/internal/daemon/execenv/context.go b/server/internal/daemon/execenv/context.go
index cc7a25b6ab..8987b43f2d 100644
--- a/server/internal/daemon/execenv/context.go
+++ b/server/internal/daemon/execenv/context.go
@@ -10,6 +10,7 @@ import (
"strings"
skillpkg "github.com/multica-ai/multica/server/internal/skill"
+ "github.com/multica-ai/multica/server/pkg/agent"
"gopkg.in/yaml.v3"
)
@@ -333,6 +334,11 @@ func resolveSkillsDir(workDir, provider string, manifest *sidecarManifest) (stri
// (removeReusedManagedSkillDirs) needs the bare path with no side effects so
// it can match the managed skill roots the prior manifest recorded.
func skillsDirPath(workDir, provider string) string {
+ // Built-in runtime identities (e.g. "omp") declare their skills dir in
+ // the descriptor; resolve generically before the protocol-family switch.
+ if desc, ok := agent.BuiltinRuntimeByID(provider); ok {
+ return filepath.Join(workDir, desc.SkillsDir)
+ }
switch provider {
case "claude":
// Claude Code natively discovers skills from .claude/skills/ in the workdir.
diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.go
index bd24dba200..bb5302e551 100644
--- a/server/internal/daemon/execenv/runtime_config.go
+++ b/server/internal/daemon/execenv/runtime_config.go
@@ -9,6 +9,8 @@ import (
"path/filepath"
"runtime"
"strings"
+
+ "github.com/multica-ai/multica/server/pkg/agent"
)
// runtimeMarkerBegin and runtimeMarkerEnd delimit the Multica-managed brief
@@ -165,6 +167,7 @@ func formatProjectResource(r ProjectResourceForEnv) string {
// For OpenClaw: writes {workDir}/AGENTS.md (skills discovered natively from {workDir}/skills/ via per-task openclaw-config.json that pins agents.defaults.workspace)
// For Hermes: writes {workDir}/AGENTS.md (skills discovered natively from a per-task HERMES_HOME/skills seeded by the daemon; see hermes_home.go)
// For Pi: writes {workDir}/AGENTS.md (skills discovered natively from .pi/skills/)
+// For Oh-My-Pi (omp): writes {workDir}/AGENTS.md (omp is a pi fork; skills discovered from .omp/skills/)
// For Cursor: writes {workDir}/AGENTS.md (skills discovered natively from .cursor/skills/)
// For Kimi: writes {workDir}/AGENTS.md (Kimi Code CLI reads AGENTS.md natively; skills auto-discovered from project skills dirs)
// For Reasonix: writes {workDir}/AGENTS.md (Reasonix reads AGENTS.md and .reasonix/skills/ natively)
@@ -190,6 +193,14 @@ func InjectRuntimeConfig(workDir, provider string, ctx TaskContextForEnv) (strin
// Cleanup in lockstep — both paths consult the same table so a new provider
// added to one side cannot drift past the other.
func runtimeConfigPath(workDir, provider string) string {
+ // Built-in runtime identities (e.g. "omp") inherit their config file
+ // from their protocol family — resolve the family from the descriptor
+ // and delegate to the family's switch case. This avoids hardcoding
+ // "AGENTS.md" for every descriptor; a compatible runtime on Claude,
+ // CodeBuddy, or Qwen would otherwise write the wrong file.
+ if desc, ok := agent.BuiltinRuntimeByID(provider); ok {
+ return runtimeConfigPath(workDir, desc.ProtocolFamily)
+ }
switch provider {
case "claude":
return filepath.Join(workDir, "CLAUDE.md")
diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.go
index 28f3534214..40995d346f 100644
--- a/server/internal/daemon/execenv/runtime_config_test.go
+++ b/server/internal/daemon/execenv/runtime_config_test.go
@@ -923,6 +923,7 @@ func TestInjectRuntimeConfigPreservesUserContent(t *testing.T) {
{"openclaw", "AGENTS.md"},
{"hermes", "AGENTS.md"},
{"pi", "AGENTS.md"},
+ {"omp", "AGENTS.md"},
{"cursor", "AGENTS.md"},
{"kimi", "AGENTS.md"},
{"reasonix", "AGENTS.md"},
@@ -1298,6 +1299,7 @@ func TestCleanupRuntimeConfigByProvider(t *testing.T) {
{"openclaw", "AGENTS.md"},
{"hermes", "AGENTS.md"},
{"pi", "AGENTS.md"},
+ {"omp", "AGENTS.md"},
{"cursor", "AGENTS.md"},
{"kimi", "AGENTS.md"},
{"reasonix", "AGENTS.md"},
diff --git a/server/internal/daemon/execenv/sidecar_manifest_test.go b/server/internal/daemon/execenv/sidecar_manifest_test.go
index c7022d7f9b..c97cd22ac8 100644
--- a/server/internal/daemon/execenv/sidecar_manifest_test.go
+++ b/server/internal/daemon/execenv/sidecar_manifest_test.go
@@ -151,6 +151,7 @@ var allFileBasedProviders = []string{
"openclaw",
"hermes",
"pi",
+ "omp",
"cursor",
"kimi",
"reasonix",
@@ -232,6 +233,7 @@ func TestPrepareThenCleanupSidecarsPreservesUserSkillSibling(t *testing.T) {
{"opencode", filepath.Join(".opencode", "skills", "my-own"), "SKILL.md"},
{"openclaw", filepath.Join("skills", "my-own"), "SKILL.md"},
{"pi", filepath.Join(".pi", "skills", "my-own"), "SKILL.md"},
+ {"omp", filepath.Join(".omp", "skills", "my-own"), "SKILL.md"},
{"cursor", filepath.Join(".cursor", "skills", "my-own"), "SKILL.md"},
{"kimi", filepath.Join(".kimi", "skills", "my-own"), "SKILL.md"},
{"reasonix", filepath.Join(".reasonix", "skills", "my-own"), "SKILL.md"},
@@ -298,6 +300,7 @@ func TestPrepareThenCleanupSidecarsPreservesUnrelatedUserFiles(t *testing.T) {
{"copilot", filepath.Join(".github", "CODEOWNERS")},
{"opencode", filepath.Join(".opencode", "config.json")},
{"pi", filepath.Join(".pi", "config.toml")},
+ {"omp", filepath.Join(".omp", "config.toml")},
{"cursor", filepath.Join(".cursor", "settings.json")},
{"kimi", filepath.Join(".kimi", "config.json")},
{"reasonix", filepath.Join(".reasonix", "config.toml")},
@@ -628,6 +631,7 @@ var sameSlugSkillProviderCases = []struct {
{"opencode", filepath.Join(".opencode", "skills", "issue-review")},
{"openclaw", filepath.Join("skills", "issue-review")},
{"pi", filepath.Join(".pi", "skills", "issue-review")},
+ {"omp", filepath.Join(".omp", "skills", "issue-review")},
{"cursor", filepath.Join(".cursor", "skills", "issue-review")},
{"kimi", filepath.Join(".kimi", "skills", "issue-review")},
{"reasonix", filepath.Join(".reasonix", "skills", "issue-review")},
diff --git a/server/internal/daemon/local_skills.go b/server/internal/daemon/local_skills.go
index 3ab7a8ca90..e9a91a5ee7 100644
--- a/server/internal/daemon/local_skills.go
+++ b/server/internal/daemon/local_skills.go
@@ -9,6 +9,7 @@ import (
"strings"
"github.com/multica-ai/multica/server/internal/skill"
+ "github.com/multica-ai/multica/server/pkg/agent"
)
const (
@@ -125,100 +126,108 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)
}
var providerRoot string
- switch provider {
- case "claude":
- providerRoot = filepath.Join(home, ".claude", "skills")
- case "codebuddy":
- // CodeBuddy Code is a Claude Code fork but ships its own native
- // config directory; it does NOT read ~/.claude/skills unless the
- // user manually symlinks it in (the vendor's documented Claude
- // Code migration path). See
- // https://www.codebuddy.ai/docs/cli/codebuddy-dir ("Global
- // directory ~/.codebuddy/") and
- // https://www.codebuddy.ai/docs/cli/skills ("User-level Skills:
- // ~/.codebuddy/skills/").
- providerRoot = filepath.Join(home, ".codebuddy", "skills")
- case "codex":
- codexHome := strings.TrimSpace(os.Getenv("CODEX_HOME"))
- if codexHome == "" {
- codexHome = filepath.Join(home, ".codex")
- }
- providerRoot = filepath.Join(codexHome, "skills")
- case "copilot":
- providerRoot = filepath.Join(home, ".copilot", "skills")
- case "opencode":
- providerRoot = filepath.Join(home, ".config", "opencode", "skills")
- case "deveco":
- providerRoot = filepath.Join(home, ".config", "deveco", "skills")
- case "openclaw":
- providerRoot = filepath.Join(home, ".openclaw", "skills")
- case "pi":
- providerRoot = filepath.Join(home, ".pi", "agent", "skills")
- case "cursor":
- providerRoot = filepath.Join(home, ".cursor", "skills")
- case "hermes":
- providerRoot = filepath.Join(home, ".hermes", "skills")
- case "kimi":
- providerRoot = filepath.Join(home, ".kimi", "skills")
- case "reasonix":
- reasonixHome := strings.TrimSpace(os.Getenv("REASONIX_HOME"))
- if reasonixHome == "" {
- reasonixHome = filepath.Join(home, ".reasonix")
- }
- providerRoot = filepath.Join(reasonixHome, "skills")
- case "kiro":
- providerRoot = filepath.Join(home, ".kiro", "skills")
- case "qoder":
- providerRoot = filepath.Join(home, ".qoder", "skills")
- case "qoderclicn":
- providerRoot = filepath.Join(home, ".qoder-cn", "skills")
- case "traecli":
- // Official TRAE CLI global skills live in ~/.traecli/skills.
- // See https://docs.trae.cn/cli_skills
- providerRoot = filepath.Join(home, ".traecli", "skills")
- case "antigravity":
- // agy inherits Gemini CLI's global skill root; see
- // https://antigravity.google/docs/gcli-migration ("Global skills").
- providerRoot = filepath.Join(home, ".gemini", "antigravity-cli", "skills")
- case "grok":
- // GROK_HOME replaces the default ~/.grok home for settings, sessions,
- // and user-level skills.
- grokHome := strings.TrimSpace(os.Getenv("GROK_HOME"))
- if grokHome == "" {
- grokHome = filepath.Join(home, ".grok")
- }
- providerRoot = filepath.Join(grokHome, "skills")
- case "qwen":
- // QWEN_HOME replaces Qwen Code's global ~/.qwen directory. It owns
- // settings, sessions, credentials and personal skills; project
- // .qwen/skills remains rooted in the task workdir.
- qwenHome := strings.TrimSpace(os.Getenv("QWEN_HOME"))
- if qwenHome == "" {
- qwenHome = filepath.Join(home, ".qwen")
- }
- providerRoot = filepath.Join(qwenHome, "skills")
- case "qwenpaw":
- // QWENPAW_WORKING_DIR (or legacy COPAW_WORKING_DIR) overrides
- // QwenPaw's global ~/.qwenpaw directory, which owns settings,
- // sessions, credentials and personal skills. The runtime
- // resolves its root from QWENPAW_WORKING_DIR → COPAW_WORKING_DIR
- // → ~/.copaw (legacy) → ~/.qwenpaw (default).
- // See constant.py in the QwenPaw source.
- qwenpawHome := strings.TrimSpace(os.Getenv("QWENPAW_WORKING_DIR"))
- if qwenpawHome == "" {
- qwenpawHome = strings.TrimSpace(os.Getenv("COPAW_WORKING_DIR"))
- }
- if qwenpawHome == "" {
- legacyCopaw := filepath.Join(home, ".copaw")
- if _, err := os.Stat(legacyCopaw); err == nil {
- qwenpawHome = legacyCopaw
- } else {
- qwenpawHome = filepath.Join(home, ".qwenpaw")
+ // 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
+ // import all still apply — same as every protocol-family provider.
+ if desc, ok := agent.BuiltinRuntimeByID(provider); ok {
+ providerRoot = filepath.Join(home, desc.UserSkillsDir)
+ } else {
+ switch provider {
+ case "claude":
+ providerRoot = filepath.Join(home, ".claude", "skills")
+ case "codebuddy":
+ // CodeBuddy Code is a Claude Code fork but ships its own native
+ // config directory; it does NOT read ~/.claude/skills unless the
+ // user manually symlinks it in (the vendor's documented Claude
+ // Code migration path). See
+ // https://www.codebuddy.ai/docs/cli/codebuddy-dir ("Global
+ // directory ~/.codebuddy/") and
+ // https://www.codebuddy.ai/docs/cli/skills ("User-level Skills:
+ // ~/.codebuddy/skills/").
+ providerRoot = filepath.Join(home, ".codebuddy", "skills")
+ case "codex":
+ codexHome := strings.TrimSpace(os.Getenv("CODEX_HOME"))
+ if codexHome == "" {
+ codexHome = filepath.Join(home, ".codex")
+ }
+ providerRoot = filepath.Join(codexHome, "skills")
+ case "copilot":
+ providerRoot = filepath.Join(home, ".copilot", "skills")
+ case "opencode":
+ providerRoot = filepath.Join(home, ".config", "opencode", "skills")
+ case "deveco":
+ providerRoot = filepath.Join(home, ".config", "deveco", "skills")
+ case "openclaw":
+ providerRoot = filepath.Join(home, ".openclaw", "skills")
+ case "pi":
+ providerRoot = filepath.Join(home, ".pi", "agent", "skills")
+ case "cursor":
+ providerRoot = filepath.Join(home, ".cursor", "skills")
+ case "hermes":
+ providerRoot = filepath.Join(home, ".hermes", "skills")
+ case "kimi":
+ providerRoot = filepath.Join(home, ".kimi", "skills")
+ case "reasonix":
+ reasonixHome := strings.TrimSpace(os.Getenv("REASONIX_HOME"))
+ if reasonixHome == "" {
+ reasonixHome = filepath.Join(home, ".reasonix")
}
+ providerRoot = filepath.Join(reasonixHome, "skills")
+ case "kiro":
+ providerRoot = filepath.Join(home, ".kiro", "skills")
+ case "qoder":
+ providerRoot = filepath.Join(home, ".qoder", "skills")
+ case "qoderclicn":
+ providerRoot = filepath.Join(home, ".qoder-cn", "skills")
+ case "traecli":
+ // Official TRAE CLI global skills live in ~/.traecli/skills.
+ // See https://docs.trae.cn/cli_skills
+ providerRoot = filepath.Join(home, ".traecli", "skills")
+ case "antigravity":
+ // agy inherits Gemini CLI's global skill root; see
+ // https://antigravity.google/docs/gcli-migration ("Global skills").
+ providerRoot = filepath.Join(home, ".gemini", "antigravity-cli", "skills")
+ case "grok":
+ // GROK_HOME replaces the default ~/.grok home for settings, sessions,
+ // and user-level skills.
+ grokHome := strings.TrimSpace(os.Getenv("GROK_HOME"))
+ if grokHome == "" {
+ grokHome = filepath.Join(home, ".grok")
+ }
+ providerRoot = filepath.Join(grokHome, "skills")
+ case "qwen":
+ // QWEN_HOME replaces Qwen Code's global ~/.qwen directory. It owns
+ // settings, sessions, credentials and personal skills; project
+ // .qwen/skills remains rooted in the task workdir.
+ qwenHome := strings.TrimSpace(os.Getenv("QWEN_HOME"))
+ if qwenHome == "" {
+ qwenHome = filepath.Join(home, ".qwen")
+ }
+ providerRoot = filepath.Join(qwenHome, "skills")
+ case "qwenpaw":
+ // QWENPAW_WORKING_DIR (or legacy COPAW_WORKING_DIR) overrides
+ // QwenPaw's global ~/.qwenpaw directory, which owns settings,
+ // sessions, credentials and personal skills. The runtime
+ // resolves its root from QWENPAW_WORKING_DIR → COPAW_WORKING_DIR
+ // → ~/.copaw (legacy) → ~/.qwenpaw (default).
+ // See constant.py in the QwenPaw source.
+ qwenpawHome := strings.TrimSpace(os.Getenv("QWENPAW_WORKING_DIR"))
+ if qwenpawHome == "" {
+ qwenpawHome = strings.TrimSpace(os.Getenv("COPAW_WORKING_DIR"))
+ }
+ if qwenpawHome == "" {
+ legacyCopaw := filepath.Join(home, ".copaw")
+ if _, err := os.Stat(legacyCopaw); err == nil {
+ qwenpawHome = legacyCopaw
+ } else {
+ qwenpawHome = filepath.Join(home, ".qwenpaw")
+ }
+ }
+ providerRoot = filepath.Join(qwenpawHome, "skill_pool")
+ default:
+ return nil, false, nil
}
- providerRoot = filepath.Join(qwenpawHome, "skill_pool")
- default:
- return nil, false, nil
}
roots := []localSkillRoot{
diff --git a/server/internal/daemon/runtime_probe_batch_test.go b/server/internal/daemon/runtime_probe_batch_test.go
index d7ec510c6d..129fde5c9d 100644
--- a/server/internal/daemon/runtime_probe_batch_test.go
+++ b/server/internal/daemon/runtime_probe_batch_test.go
@@ -168,6 +168,9 @@ type registeredCall struct {
// versions maps runtime type -> the version that call reported, so a test
// can assert the server was told about an in-place CLI upgrade.
versions map[string]string
+ // names maps runtime type -> the display name that call reported, so a
+ // test can assert the name a user will see for a runtime identity.
+ names map[string]string
}
func (fx *batchFixture) setWorkspaces(ws ...WorkspaceInfo) {
@@ -209,6 +212,20 @@ func (fx *batchFixture) setProbeErr(fn func(path string, attempt int) error) {
fx.probeErr = fn
}
+// registeredNameFor returns the display name the last Register call for a
+// workspace reported for a runtime type.
+func (fx *batchFixture) registeredNameFor(workspaceID, runtimeType string) string {
+ fx.mu.Lock()
+ defer fx.mu.Unlock()
+ var name string
+ for _, call := range fx.registered {
+ if call.workspaceID == workspaceID {
+ name = call.names[runtimeType]
+ }
+ }
+ return name
+}
+
// registrationFor returns the runtime types registered for a workspace, and
// how many Register calls that workspace received.
func (fx *batchFixture) registrationFor(workspaceID string) ([]string, int) {
@@ -339,12 +356,17 @@ func newBatchFixture(t *testing.T) *batchFixture {
_, _ = w.Write([]byte(`{"error":"injected register failure"}`))
return
}
- call := registeredCall{workspaceID: body.WorkspaceID, versions: map[string]string{}}
+ call := registeredCall{
+ workspaceID: body.WorkspaceID,
+ versions: map[string]string{},
+ names: map[string]string{},
+ }
var resp RegisterResponse
fx.mu.Lock()
for _, rt := range body.Runtimes {
call.types = append(call.types, rt["type"])
call.versions[rt["type"]] = rt["version"]
+ call.names[rt["type"]] = rt["name"]
// Mirror UpsertAgentRuntime: a re-register of a row that already
// exists returns that row's ID rather than minting a new one.
id := "rt-" + strconv.Itoa(int(runtimeSeq.Add(1)))
diff --git a/server/pkg/agent/agent.go b/server/pkg/agent/agent.go
index 33a4245adc..466e4f65e6 100644
--- a/server/pkg/agent/agent.go
+++ b/server/pkg/agent/agent.go
@@ -1,6 +1,6 @@
// Package agent provides a unified interface for executing prompts via
// coding agents (Claude Code, CodeBuddy, Codex, Copilot, OpenCode, DevEco Code,
-// OpenClaw, Hermes, Pi, Cursor, Kimi, Reasonix, Kiro, Antigravity, Qoder,
+// OpenClaw, Hermes, Pi, Oh-My-Pi, Cursor, Kimi, Reasonix, Kiro, Antigravity, Qoder,
// Trae, Grok, Qwen Code, QwenPaw). It
// mirrors the happy-cli AgentBackend pattern, translated to idiomatic Go.
package agent
@@ -252,7 +252,7 @@ type Config struct {
// runtime_profile.protocol_family CHECK constraint (migration 120, widened by
// 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, and
+// migration 242 to add qoderclicn, migration 253 to add qwenpaw,
// migration 254 to add reasonix): a
// custom runtime profile may only
// be based on a backend Multica officially supports.
@@ -412,5 +412,13 @@ var launchHeaders = map[string]string{
// empty string if the type is unknown. Callers render this as a preview so
// users understand which command their custom_args get appended to.
func LaunchHeader(agentType string) string {
- return launchHeaders[agentType]
+ if h := launchHeaders[agentType]; h != "" {
+ return h
+ }
+ // Built-in runtime identities derive their launch header from the
+ // descriptor, not the protocol-family map.
+ if desc, ok := BuiltinRuntimeByID(agentType); ok {
+ return desc.LaunchHeader
+ }
+ return ""
}
diff --git a/server/pkg/agent/builtin_runtimes.go b/server/pkg/agent/builtin_runtimes.go
new file mode 100644
index 0000000000..7c10add68d
--- /dev/null
+++ b/server/pkg/agent/builtin_runtimes.go
@@ -0,0 +1,185 @@
+package agent
+
+import (
+ "context"
+ "fmt"
+)
+
+// BuiltinRuntime describes a built-in runtime identity that the daemon probes
+// and registers automatically — independent of the custom runtime profile
+// protocol_family whitelist. Multiple runtime identities can share one
+// protocol family (e.g. both "pi" and "omp" use the "pi" protocol backend).
+//
+// The descriptor is the single declaration site for a runtime identity:
+// agents_probe.go, config.go, daemon.go display-name overrides, execenv
+// skill/config paths, local_skills.go, ListModels, and the frontend display
+// maps all derive from this. Adding a new compatible fork of an existing
+// runtime is a descriptor entry, not a cross-stack change.
+type BuiltinRuntime struct {
+ // ID is the provider key the daemon registers under (e.g. "omp").
+ // It is NOT a protocol_family — it does not appear in SupportedTypes or
+ // the runtime_profile.protocol_family CHECK constraint.
+ ID string
+
+ // ProtocolFamily is the execution backend this runtime dispatches to.
+ // It MUST be in SupportedTypes. NewRuntime builds that family's backend
+ // via New(), then applies this descriptor's ID-specific defaults
+ // (executable, label) to it.
+ ProtocolFamily string
+
+ // DefaultCommand is the bare CLI name the probe looks up on PATH
+ // when MULTICA_<ID>_PATH is not set (e.g. "omp").
+ DefaultCommand string
+
+ // EnvPrefix is the MULTICA_ prefix for *_PATH and *_MODEL env overrides
+ // (e.g. "MULTICA_OMP" → MULTICA_OMP_PATH / MULTICA_OMP_MODEL).
+ EnvPrefix string
+
+ // DisplayName is the human-facing runtime name. The daemon and frontend
+ // both use this so they never drift apart.
+ DisplayName string
+
+ // SkillsDir is the project-level skills directory relative to the
+ // workdir (e.g. ".omp/skills").
+ SkillsDir string
+
+ // UserSkillsDir is the user-level skills directory relative to $HOME
+ // (e.g. ".omp/agent/skills").
+ UserSkillsDir string
+
+ // LaunchHeader is the user-visible launch skeleton shown in the UI
+ // (e.g. "omp (json mode)").
+ LaunchHeader string
+
+ // DefaultExecutable is the binary name the backend falls back to when
+ // cfg.ExecutablePath is empty (passed to piBackend.defaultExecutable).
+ DefaultExecutable string
+
+ // ProviderLabel is the label used in log/error messages (passed to
+ // piBackend.providerLabel).
+ ProviderLabel string
+
+ // ModelDiscovery is the strategy for discovering available models.
+ // When set, it replaces the protocol family's discovery entirely — omp
+ // uses `omp models --json`, a different command and output shape from
+ // pi's `--list-models`. When nil, ListModels returns an empty catalog
+ // rather than falling back to the family's command: running a
+ // semantically incompatible one (omp exits non-zero on `--list-models`)
+ // is worse than degrading to manual entry.
+ ModelDiscovery ModelDiscoveryFunc
+}
+
+// ModelDiscoveryFunc discovers available models for a runtime identity.
+// It receives the context and the resolved executable path, and returns
+// a model catalog. When the binary is missing or too old, it returns an
+// empty slice (ListModels swallows the error and degrades to manual entry).
+type ModelDiscoveryFunc func(ctx context.Context, executablePath string) ([]Model, error)
+
+// BuiltinRuntimes is the registry of built-in runtime identities that are
+// NOT in SupportedTypes (they are protocol-family derivatives, not families
+// themselves). The daemon probes each one independently and dispatches it
+// to its protocol family's backend.
+//
+// A runtime identity appears here when it needs its own probe/display/skills
+// but reuses an existing backend's protocol. The first entry is omp (oh-my-pi):
+// a separate CLI that speaks the pi JSON event protocol.
+var BuiltinRuntimes = []BuiltinRuntime{
+ {
+ ID: "omp",
+ ProtocolFamily: "pi",
+ DefaultCommand: "omp",
+ EnvPrefix: "MULTICA_OMP",
+ DisplayName: "Oh-My-Pi",
+ SkillsDir: ".omp/skills",
+ UserSkillsDir: ".omp/agent/skills",
+ LaunchHeader: "omp (json mode)",
+ DefaultExecutable: "omp",
+ ProviderLabel: "omp",
+ ModelDiscovery: discoverOmpModels,
+ },
+}
+
+// BuiltinRuntimeByID returns the descriptor for the given runtime identity,
+// or false if no such built-in runtime exists.
+func BuiltinRuntimeByID(id string) (BuiltinRuntime, bool) {
+ for _, r := range BuiltinRuntimes {
+ if r.ID == id {
+ return r, true
+ }
+ }
+ return BuiltinRuntime{}, false
+}
+
+// IsBuiltinRuntime reports whether id is a registered built-in runtime
+// identity (as opposed to a protocol family in SupportedTypes).
+func IsBuiltinRuntime(id string) bool {
+ _, ok := BuiltinRuntimeByID(id)
+ return ok
+}
+
+// BuiltinRuntimeCommands returns the default CLI command names for all
+// built-in runtimes, for the daemon's defaultAgentCommandNames list.
+func BuiltinRuntimeCommands() []string {
+ cmds := make([]string, len(BuiltinRuntimes))
+ for i, r := range BuiltinRuntimes {
+ cmds[i] = r.DefaultCommand
+ }
+ return cmds
+}
+
+// backendOverrideApplicator is the interface that lets a descriptor apply
+// per-runtime overrides (executable, label) to the backend its protocol family
+// returned. A family whose backend does not implement it cannot host a runtime
+// identity at all: NewRuntime fails closed rather than handing back a backend
+// with the overrides silently dropped.
+type backendOverrideApplicator interface {
+ applyBuiltinRuntimeOverrides(desc BuiltinRuntime)
+}
+
+// piBackend already implements this via its defaultExecutable and
+// providerLabel fields. The method is defined here (not in pi.go) to keep
+// the descriptor→backend contract in one file.
+func (b *piBackend) applyBuiltinRuntimeOverrides(desc BuiltinRuntime) {
+ b.defaultExecutable = desc.DefaultExecutable
+ b.providerLabel = desc.ProviderLabel
+}
+
+// ResolveBackend is the single production entry point the daemon uses to
+// construct a backend from a provider key. It routes built-in runtime
+// identities (e.g. "omp") through NewRuntime, and protocol families (e.g.
+// "pi", "claude") through New. This keeps both factories meaning exactly one
+// thing: New() is family-only, NewRuntime() is runtime-identity-only, and
+// the daemon never has to know which is which.
+func ResolveBackend(provider string, cfg Config) (Backend, error) {
+ if IsBuiltinRuntime(provider) {
+ return NewRuntime(provider, cfg)
+ }
+ return New(provider, cfg)
+}
+
+// NewRuntime creates a Backend for a built-in runtime identity (e.g. "omp").
+// It builds the descriptor's protocol family backend via New(), then applies
+// the per-runtime overrides through the backendOverrideApplicator interface.
+// This is the production entry point for runtime identities; New() is
+// family-only and rejects runtime ids.
+//
+// Fails closed: if the protocol family backend does not implement
+// backendOverrideApplicator, the descriptor's overrides cannot be applied and
+// the runtime would launch under the wrong executable and label — so
+// NewRuntime returns an error rather than returning an unmodified backend.
+func NewRuntime(runtimeID string, cfg Config) (Backend, error) {
+ desc, ok := BuiltinRuntimeByID(runtimeID)
+ if !ok {
+ return nil, fmt.Errorf("unknown runtime identity: %q", runtimeID)
+ }
+ backend, err := New(desc.ProtocolFamily, cfg)
+ if err != nil {
+ return nil, fmt.Errorf("runtime %q (family %q): %w", runtimeID, desc.ProtocolFamily, err)
+ }
+ applicator, ok := backend.(backendOverrideApplicator)
+ if !ok {
+ return nil, fmt.Errorf("runtime %q: protocol family %q backend %T does not support runtime overrides", runtimeID, desc.ProtocolFamily, backend)
+ }
+ applicator.applyBuiltinRuntimeOverrides(desc)
+ return backend, nil
+}
diff --git a/server/pkg/agent/models.go b/server/pkg/agent/models.go
index c713f8e149..0b828065fb 100644
--- a/server/pkg/agent/models.go
+++ b/server/pkg/agent/models.go
@@ -130,6 +130,21 @@ const modelCacheTTL = 60 * time.Second
// executablePath lets the caller point at a non-default binary; pass
// "" to use the provider's default name on PATH.
func ListModels(ctx context.Context, providerType, executablePath string) (Catalog, error) {
+ // Built-in runtime identities (e.g. "omp") declare their model discovery
+ // strategy in the descriptor. Resolve generically before the protocol-
+ // family switch so no runtime-specific case is needed below. When the
+ // descriptor has no ModelDiscovery strategy, return an empty catalog
+ // (not the family's default) — running a semantically incompatible
+ // discovery command (e.g. omp rejecting --list-models) is worse than
+ // degrading to manual entry.
+ if desc, ok := BuiltinRuntimeByID(providerType); ok {
+ if desc.ModelDiscovery != nil {
+ return cachedDiscovery(discoveryCacheKey(providerType, executablePath), func() (Catalog, error) {
+ return discovered(desc.ModelDiscovery(ctx, executablePath))
+ })
+ }
+ return Catalog{Models: []Model{}}, nil
+ }
switch providerType {
case "claude":
models := claudeStaticModels()
@@ -1133,6 +1148,87 @@ func isPiDiscoveryNoise(line string) bool {
strings.Contains(lower, "unknown command")
}
+// discoverOmpModels runs `omp models --json` and parses the JSON catalog.
+// omp (oh-my-pi) rejects `--list-models` — a pi flag it never adopted, and it
+// exits non-zero on it — so its native discovery is `omp models --json`, which
+// prints a `{"models":[...]}` object; parseOmpModels documents the entry shape.
+// An empty catalog (an omp with no provider credentials configured prints
+// `{"models":[]}`) or a non-zero exit (binary missing, omp too old) falls back
+// to an empty list so the UI degrades to manual entry instead of erroring.
+func discoverOmpModels(ctx context.Context, executablePath string) ([]Model, error) {
+ if executablePath == "" {
+ executablePath = "omp"
+ }
+ if _, err := exec.LookPath(executablePath); err != nil {
+ return []Model{}, nil
+ }
+ runCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
+ defer cancel()
+ cmd := exec.CommandContext(runCtx, executablePath, "models", "--json")
+ hideAgentWindow(cmd)
+ stdout, err := cmd.Output()
+ if err != nil || len(stdout) == 0 {
+ return []Model{}, nil
+ }
+ return parseOmpModels(stdout)
+}
+
+// parseOmpModels parses the JSON output from `omp models --json`. omp emits
+// an object wrapper with a `models` array — NOT a bare top-level array:
+//
+// {"models":[{"provider":"anthropic","id":"claude-sonnet-5","selector":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5",...}]}
+//
+// The persistable Model.ID is the selector (provider/id), matching the
+// convention parsePiModels uses: buildPiArgs splits Model.ID on "/" and
+// emits --provider + --model. Using the bare id would drop --provider and
+// let omp's internal provider priority ranking pick a different backend
+// for the same model id. Provider is kept for UI grouping. The dedup key
+// is the selector when present, falling back to provider/id.
+func parseOmpModels(data []byte) ([]Model, error) {
+ var wrapper struct {
+ Models []struct {
+ ID string `json:"id"`
+ Provider string `json:"provider"`
+ Selector string `json:"selector"`
+ Name string `json:"name"`
+ } `json:"models"`
+ }
+ if err := json.Unmarshal(data, &wrapper); err != nil {
+ return []Model{}, nil
+ }
+ var models []Model
+ seen := map[string]bool{}
+ for _, e := range wrapper.Models {
+ bareID := strings.TrimSpace(e.ID)
+ if bareID == "" {
+ continue
+ }
+ provider := strings.TrimSpace(e.Provider)
+ // Model.ID is the qualified selector (provider/id) so buildPiArgs
+ // emits both --provider and --model. When selector is absent, fall
+ // back to provider/id; when provider is also absent, the bare id is
+ // the only form available.
+ selector := strings.TrimSpace(e.Selector)
+ if selector == "" {
+ if provider != "" {
+ selector = provider + "/" + bareID
+ } else {
+ selector = bareID
+ }
+ }
+ if seen[selector] {
+ continue
+ }
+ seen[selector] = true
+ label := strings.TrimSpace(e.Name)
+ if label == "" {
+ label = selector
+ }
+ models = append(models, Model{ID: selector, Label: label, Provider: provider})
+ }
+ return models, nil
+}
+
// discoverHermesModels spins up a throwaway `hermes acp` process,
// drives just enough of the protocol to receive the model list
// advertised in the `session/new` response, and shuts it down. The
diff --git a/server/pkg/agent/omp_test.go b/server/pkg/agent/omp_test.go
new file mode 100644
index 0000000000..7dce618f64
--- /dev/null
+++ b/server/pkg/agent/omp_test.go
@@ -0,0 +1,515 @@
+package agent
+
+import (
+ "context"
+ "log/slog"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "testing"
+ "time"
+)
+
+// TestOmpNewDispatchesToPiBackend asserts that ResolveBackend("omp") dispatches to the
+// pi backend via the descriptor registry — the core contract that omp is a
+// runtime identity on the pi protocol, not a separate protocol family.
+// IsSupportedType("omp") is false (it's not a protocol family), but New
+// resolves it through BuiltinRuntimes to the pi backend with the correct
+// executable and label overrides.
+func TestOmpNewDispatchesToPiBackend(t *testing.T) {
+ if IsSupportedType("omp") {
+ t.Errorf("omp must not be in SupportedTypes (it is a runtime identity, not a protocol family)")
+ }
+ b, err := ResolveBackend("omp", Config{Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp) returned error: %v", err)
+ }
+ pb, ok := b.(*piBackend)
+ if !ok {
+ t.Fatalf("New(omp) returned %T, want *piBackend", b)
+ }
+ if pb.defaultExecutable != "omp" {
+ t.Errorf("defaultExecutable = %q, want %q", pb.defaultExecutable, "omp")
+ }
+ if pb.providerLabel != "omp" {
+ t.Errorf("providerLabel = %q, want %q", pb.providerLabel, "omp")
+ }
+}
+
+// TestNewRuntimeIsSeparateEntryPoint verifies that NewRuntime (the typed
+// entry point for runtime identities) produces the same backend as New()
+// when called with "omp" — both should dispatch through the descriptor.
+func TestNewRuntimeIsSeparateEntryPoint(t *testing.T) {
+ b, err := NewRuntime("omp", Config{Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("NewRuntime(omp): %v", err)
+ }
+ pb, ok := b.(*piBackend)
+ if !ok {
+ t.Fatalf("NewRuntime(omp) returned %T, want *piBackend", b)
+ }
+ if pb.defaultExecutable != "omp" {
+ t.Errorf("defaultExecutable = %q, want %q", pb.defaultExecutable, "omp")
+ }
+ if pb.providerLabel != "omp" {
+ t.Errorf("providerLabel = %q, want %q", pb.providerLabel, "omp")
+ }
+}
+
+// TestNewRuntimeRejectsUnknownID verifies that NewRuntime fails for an
+// unregistered runtime identity.
+func TestNewRuntimeRejectsUnknownID(t *testing.T) {
+ if _, err := NewRuntime("definitely-not-a-runtime", Config{}); err == nil {
+ t.Fatal("expected error for unknown runtime identity")
+ }
+}
+
+// TestNewRejectsRuntimeID verifies that New() (the protocol-family factory)
+// rejects a runtime identity like "omp". This pins the contract that New()
+// means exactly one thing: family-only. The daemon calls ResolveBackend,
+// which routes runtime identities through NewRuntime.
+func TestNewRejectsRuntimeID(t *testing.T) {
+ if _, err := New("omp", Config{Logger: slog.Default()}); err == nil {
+ t.Fatal("New(\"omp\") should reject runtime identities (it is family-only)")
+ }
+}
+
+// TestOmpExecuteDefaultsToOmpBinary verifies that ResolveBackend("omp", Config{}) with
+// an empty ExecutablePath resolves to the "omp" binary name (not "pi") when
+// the daemon hasn't pinned a path. This is the contract the daemon relies on
+// when it constructs a backend from a probe result that carries no path.
+func TestOmpExecuteDefaultsToOmpBinary(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ fakeDir := t.TempDir()
+ fakePath := filepath.Join(fakeDir, "omp")
+ script := "#!/bin/sh\n" +
+ "cat > /dev/null\n" +
+ "printf '%s\\n' '{\"type\":\"agent_start\"}'\n" +
+ "printf '%s\\n' '{\"type\":\"turn_end\",\"message\":{\"role\":\"assistant\",\"model\":\"test\",\"usage\":{\"input\":1,\"output\":1}}}'\n" +
+ "exit 0\n"
+ writeTestExecutable(t, fakePath, []byte(script))
+
+ t.Setenv("PATH", fakeDir)
+
+ backend, err := ResolveBackend("omp", Config{Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp): %v", err)
+ }
+ sessionPath := filepath.Join(t.TempDir(), "session.jsonl")
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+ session, err := backend.Execute(ctx, "test prompt", ExecOptions{
+ Timeout: 5 * time.Second,
+ ResumeSessionID: sessionPath,
+ })
+ if err != nil {
+ t.Fatalf("Execute: %v", err)
+ }
+ go func() {
+ for range session.Messages {
+ }
+ }()
+ select {
+ case result := <-session.Result:
+ if result.Status != "completed" {
+ t.Fatalf("expected completed, got %q (error=%q)", result.Status, result.Error)
+ }
+ case <-time.After(10 * time.Second):
+ t.Fatal("timeout waiting for result")
+ }
+}
+
+// TestOmpExecuteRejectsEmptyPrompt verifies the error message uses the "omp"
+// label, not "pi". This is the user-facing contract: an omp agent that fails
+// must say "omp prompt must not be empty", not "pi prompt must not be empty".
+func TestOmpExecuteRejectsEmptyPrompt(t *testing.T) {
+ t.Parallel()
+
+ backend, err := ResolveBackend("omp", Config{ExecutablePath: "/does/not/need/to/exist", Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp): %v", err)
+ }
+ if _, err := backend.Execute(t.Context(), " \n\t ", ExecOptions{}); err == nil {
+ t.Fatalf("expected empty-prompt error")
+ } else {
+ if !strings.Contains(err.Error(), "omp prompt must not be empty") {
+ t.Fatalf("error = %q, want it to contain %q", err.Error(), "omp prompt must not be empty")
+ }
+ if strings.Contains(err.Error(), "pi prompt") {
+ t.Fatalf("error should not contain hardcoded 'pi prompt': %q", err.Error())
+ }
+ }
+}
+
+// TestOmpExecuteLabelsErrorsAsOmp verifies that a binary-not-found error uses
+// the "omp" label, not "pi".
+func TestOmpExecuteLabelsErrorsAsOmp(t *testing.T) {
+ t.Parallel()
+
+ backend, err := ResolveBackend("omp", Config{ExecutablePath: "/nonexistent/omp-binary", Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp): %v", err)
+ }
+ _, err = backend.Execute(t.Context(), "prompt", ExecOptions{})
+ if err == nil {
+ t.Fatal("expected error for nonexistent binary")
+ }
+ if !strings.Contains(err.Error(), "omp executable not found") {
+ t.Fatalf("error = %q, want it to contain %q", err.Error(), "omp executable not found")
+ }
+ if strings.Contains(err.Error(), "pi executable") {
+ t.Fatalf("error should not say 'pi executable': %q", err.Error())
+ }
+}
+
+// TestOmpExecuteCompletesFromEventStream verifies that an omp event stream
+// (same JSON protocol as pi) drives a task to completion through the pi
+// backend. This is the end-to-end protocol compatibility contract.
+func TestOmpExecuteCompletesFromEventStream(t *testing.T) {
+ t.Parallel()
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ events := []string{
+ `{"type":"agent_start"}`,
+ `{"type":"turn_start"}`,
+ `{"type":"message_update","assistantMessageEvent":{"type":"text_delta","delta":"hello from omp"}}`,
+ `{"type":"turn_end","message":{"role":"assistant","model":"omp-test","usage":{"input":10,"output":5}}}`,
+ }
+ fakePath := filepath.Join(t.TempDir(), "omp")
+ writeTestExecutable(t, fakePath, []byte(piEventStreamScript(events)))
+
+ backend, err := ResolveBackend("omp", Config{ExecutablePath: fakePath, Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp): %v", err)
+ }
+
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+ session, err := backend.Execute(ctx, "prompt-ignored", ExecOptions{Timeout: 5 * time.Second})
+ if err != nil {
+ t.Fatalf("execute: %v", err)
+ }
+ go func() {
+ for range session.Messages {
+ }
+ }()
+
+ select {
+ case result := <-session.Result:
+ if result.Status != "completed" {
+ t.Fatalf("expected completed, got %q (error=%q)", result.Status, result.Error)
+ }
+ if result.Output != "hello from omp" {
+ t.Fatalf("Output = %q, want %q", result.Output, "hello from omp")
+ }
+ if len(result.Usage) != 1 {
+ t.Fatalf("expected 1 usage entry, got %d", len(result.Usage))
+ }
+ u, ok := result.Usage["omp-test"]
+ if !ok {
+ t.Fatalf("expected usage for model %q, got %v", "omp-test", result.Usage)
+ }
+ if u.InputTokens != 10 || u.OutputTokens != 5 {
+ t.Fatalf("usage: input=%d output=%d, want input=10 output=5", u.InputTokens, u.OutputTokens)
+ }
+ case <-time.After(10 * time.Second):
+ t.Fatal("timeout waiting for result")
+ }
+}
+
+// TestParseOmpModels parses a real `omp models --json` output. omp emits
+// an object wrapper {"models":[...]} where each entry has separate `provider`,
+// `id`, `selector` (provider/id), and `name` fields. The persistable Model.ID
+// is the selector (provider/id), matching the convention parsePiModels uses
+// so buildPiArgs emits both --provider and --model.
+func TestParseOmpModels(t *testing.T) {
+ sample := `{"models":[` +
+ `{"provider":"anthropic","id":"claude-sonnet-5","selector":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5","contextWindow":200000,"maxTokens":64000,"reasoning":true},` +
+ `{"provider":"openai","id":"gpt-5","selector":"openai/gpt-5","name":"GPT-5"},` +
+ `{"provider":"","id":"local-model","selector":"local-model","name":"Local Model"}` +
+ `]}`
+ models, err := parseOmpModels([]byte(sample))
+ if err != nil {
+ t.Fatalf("parseOmpModels: %v", err)
+ }
+ if len(models) != 3 {
+ t.Fatalf("expected 3 models, got %d", len(models))
+ }
+ // Model.ID is the selector (provider/id), NOT the bare id.
+ if models[0].ID != "anthropic/claude-sonnet-5" || models[0].Provider != "anthropic" || models[0].Label != "Claude Sonnet 5" {
+ t.Errorf("models[0] = %+v", models[0])
+ }
+ if models[1].ID != "openai/gpt-5" || models[1].Provider != "openai" || models[1].Label != "GPT-5" {
+ t.Errorf("models[1] = %+v", models[1])
+ }
+ // Bare model id with empty provider: selector is the bare id.
+ if models[2].ID != "local-model" || models[2].Provider != "" || models[2].Label != "Local Model" {
+ t.Errorf("models[2] = %+v", models[2])
+ }
+}
+
+// TestParseOmpModelsEmptyCatalog verifies an empty {"models":[]} wrapper
+// degrades gracefully to an empty model list (not an error). Uses the real
+// wrapper shape, not a bare top-level array.
+func TestParseOmpModelsEmptyCatalog(t *testing.T) {
+ models, err := parseOmpModels([]byte(`{"models":[]}`))
+ if err != nil {
+ t.Fatalf("parseOmpModels({\"models\":[]}): %v", err)
+ }
+ if len(models) != 0 {
+ t.Fatalf("expected 0 models, got %d", len(models))
+ }
+}
+
+// TestParseOmpModelsInvalidJSON verifies a non-JSON output (e.g. usage text
+// from a flag mismatch or an old omp that doesn't support --json) degrades
+// to an empty list, not a panic.
+func TestParseOmpModelsInvalidJSON(t *testing.T) {
+ models, err := parseOmpModels([]byte("Error: unknown flag --json\nRun `omp --help` for usage."))
+ if err != nil {
+ t.Fatalf("parseOmpModels(invalid): %v", err)
+ }
+ if len(models) != 0 {
+ t.Fatalf("expected 0 models for invalid JSON, got %d", len(models))
+ }
+}
+
+// TestParseOmpModelsDeduplicates verifies that duplicate model selectors are
+// collapsed, matching the pi discovery behaviour.
+func TestParseOmpModelsDeduplicates(t *testing.T) {
+ sample := `{"models":[` +
+ `{"provider":"anthropic","id":"claude-sonnet-5","selector":"anthropic/claude-sonnet-5","name":"Sonnet"},` +
+ `{"provider":"anthropic","id":"claude-sonnet-5","selector":"anthropic/claude-sonnet-5","name":"Sonnet Dup"}` +
+ `]}`
+ models, _ := parseOmpModels([]byte(sample))
+ if len(models) != 1 {
+ t.Fatalf("expected 1 model (deduplicated), got %d", len(models))
+ }
+}
+
+// TestOmpModelsJSONShape verifies that parseOmpModels correctly parses the
+// real omp models --json output shape: {"models":[{...}]} with provider/id
+// as separate fields, and that Model.ID is the selector.
+func TestOmpModelsJSONShape(t *testing.T) {
+ raw := `{"models":[{"provider":"zai","id":"glm-4.6","selector":"zai/glm-4.6","name":"GLM 4.6","contextWindow":128000,"maxTokens":4096},{"provider":"xai","id":"grok-4-fast","selector":"xai/grok-4-fast","name":"Grok 4 Fast"}]}`
+ models, err := parseOmpModels([]byte(raw))
+ if err != nil {
+ t.Fatalf("parseOmpModels: %v", err)
+ }
+ if len(models) != 2 {
+ t.Fatalf("expected 2 models, got %d", len(models))
+ }
+ // Model.ID is the selector, not the bare id.
+ if models[0].ID != "zai/glm-4.6" || models[0].Provider != "zai" || models[0].Label != "GLM 4.6" {
+ t.Errorf("models[0] = %+v", models[0])
+ }
+ if models[1].ID != "xai/grok-4-fast" || models[1].Provider != "xai" || models[1].Label != "Grok 4 Fast" {
+ t.Errorf("models[1] = %+v", models[1])
+ }
+}
+
+// TestOmpSelectorSurvivesToBuildPiArgs is the regression test the review
+// asked for: a real `omp models --json` fixture → parseOmpModels →
+// buildPiArgs should emit both --provider and --model, not just --model.
+// This pins the contract that Model.ID is the selector (provider/id).
+func TestOmpSelectorSurvivesToBuildPiArgs(t *testing.T) {
+ raw := `{"models":[{"provider":"anthropic","id":"claude-sonnet-5","selector":"anthropic/claude-sonnet-5","name":"Claude Sonnet 5"}]}`
+ models, err := parseOmpModels([]byte(raw))
+ if err != nil {
+ t.Fatalf("parseOmpModels: %v", err)
+ }
+ if len(models) != 1 {
+ t.Fatalf("expected 1 model, got %d", len(models))
+ }
+ // The model ID is "anthropic/claude-sonnet-5" (the selector).
+ // buildPiArgs should split it into --provider anthropic --model claude-sonnet-5.
+ args := buildPiArgs("/tmp/session.jsonl", ExecOptions{Model: models[0].ID}, slog.Default())
+ joined := strings.Join(args, " ")
+ if !strings.Contains(joined, "--provider anthropic") {
+ t.Errorf("args missing --provider anthropic: %s", joined)
+ }
+ if !strings.Contains(joined, "--model claude-sonnet-5") {
+ t.Errorf("args missing --model claude-sonnet-5: %s", joined)
+ }
+}
+
+// TestOmpAndPiCanCoexist verifies that both "pi" and "omp" can be constructed
+// and used side by side — the core contract the issue (#3989) asks for.
+func TestOmpAndPiCanCoexist(t *testing.T) {
+ t.Parallel()
+
+ piBe, err := New("pi", Config{ExecutablePath: "/fake/pi", Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(pi): %v", err)
+ }
+ ompBe, err := ResolveBackend("omp", Config{ExecutablePath: "/fake/omp", Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(omp): %v", err)
+ }
+ if _, ok := piBe.(*piBackend); !ok {
+ t.Fatalf("pi backend is %T, want *piBackend", piBe)
+ }
+ if _, ok := ompBe.(*piBackend); !ok {
+ t.Fatalf("omp backend is %T, want *piBackend", ompBe)
+ }
+ pb := piBe.(*piBackend)
+ ob := ompBe.(*piBackend)
+ if pb.defaultExecutable != "" {
+ t.Errorf("pi defaultExecutable = %q, want empty", pb.defaultExecutable)
+ }
+ if ob.defaultExecutable != "omp" {
+ t.Errorf("omp defaultExecutable = %q, want %q", ob.defaultExecutable, "omp")
+ }
+ if pb.providerLabel != "" {
+ t.Errorf("pi providerLabel = %q, want empty", pb.providerLabel)
+ }
+ if ob.providerLabel != "omp" {
+ t.Errorf("omp providerLabel = %q, want %q", ob.providerLabel, "omp")
+ }
+}
+
+// TestDiscoverOmpModelsNonZeroExit verifies that discoverOmpModels returns
+// an empty catalog when the omp binary exits non-zero (e.g. an old omp that
+// doesn't support `models --json` and prints usage to stderr). This is the
+// fake-executable integration test the review asked for.
+func TestDiscoverOmpModelsNonZeroExit(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ fakePath := filepath.Join(t.TempDir(), "omp")
+ script := "#!/bin/sh\n" +
+ "echo 'Error: unknown command \"models\"' >&2\n" +
+ "echo 'Run `omp --help` for usage.' >&2\n" +
+ "exit 1\n"
+ writeTestExecutable(t, fakePath, []byte(script))
+
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+ models, err := discoverOmpModels(ctx, fakePath)
+ if err != nil {
+ t.Fatalf("discoverOmpModels: %v", err)
+ }
+ if len(models) != 0 {
+ t.Fatalf("expected 0 models for non-zero-exit omp, got %d", len(models))
+ }
+}
+
+// TestDiscoverOmpModelsMissingBinary verifies that a missing omp binary
+// degrades to an empty catalog, not an error.
+func TestDiscoverOmpModelsMissingBinary(t *testing.T) {
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
+ models, err := discoverOmpModels(ctx, "/nonexistent/omp-binary")
+ if err != nil {
+ t.Fatalf("discoverOmpModels: %v", err)
+ }
+ if len(models) != 0 {
+ t.Fatalf("expected 0 models for missing binary, got %d", len(models))
+ }
+}
+
+// TestOmpAndPiRegisterSideBySide is the daemon-level registration test the
+// review asked for: with both binaries present, probing should discover two
+// runtimes with the right commands. This exercises the probe path (not just
+// backend construction), verifying that the descriptor-driven probe loop in
+// agents_probe.go finds both "pi" and "omp" independently.
+func TestOmpAndPiRegisterSideBySide(t *testing.T) {
+ if runtime.GOOS == "windows" {
+ t.Skip("shell-script fixture is POSIX-only")
+ }
+
+ fakeDir := t.TempDir()
+ // Create fake pi and omp binaries.
+ for _, name := range []string{"pi", "omp"} {
+ fakePath := filepath.Join(fakeDir, name)
+ script := "#!/bin/sh\nexit 0\n"
+ writeTestExecutable(t, fakePath, []byte(script))
+ }
+ t.Setenv("PATH", fakeDir)
+
+ // Probe both CLIs the way the daemon would — using the same env vars
+ // the descriptor-driven probe loop uses.
+ for _, tc := range []struct {
+ envPath string
+ envModel string
+ cmd string
+ id string
+ }{
+ {"MULTICA_PI_PATH", "MULTICA_PI_MODEL", "pi", "pi"},
+ {"MULTICA_OMP_PATH", "MULTICA_OMP_MODEL", "omp", "omp"},
+ } {
+ t.Run(tc.id, func(t *testing.T) {
+ // Verify the descriptor's env prefix and command match what
+ // the probe loop would use.
+ desc, ok := BuiltinRuntimeByID(tc.id)
+ if tc.id == "omp" {
+ if !ok {
+ t.Fatalf("BuiltinRuntimeByID(%q) not found", tc.id)
+ }
+ if desc.EnvPrefix != tc.envPath[:len(tc.envPath)-5] {
+ t.Errorf("descriptor EnvPrefix = %q, want %q", desc.EnvPrefix, tc.envPath[:len(tc.envPath)-5])
+ }
+ if desc.DefaultCommand != tc.cmd {
+ t.Errorf("descriptor DefaultCommand = %q, want %q", desc.DefaultCommand, tc.cmd)
+ }
+ }
+ // The backend should construct successfully.
+ b, err := ResolveBackend(tc.id, Config{ExecutablePath: filepath.Join(fakeDir, tc.cmd), Logger: slog.Default()})
+ if err != nil {
+ t.Fatalf("New(%q): %v", tc.id, err)
+ }
+ pb, ok := b.(*piBackend)
+ if !ok {
+ t.Fatalf("New(%q) = %T, want *piBackend", tc.id, b)
+ }
+ if tc.id == "omp" {
+ if pb.defaultExecutable != "omp" {
+ t.Errorf("defaultExecutable = %q, want %q", pb.defaultExecutable, "omp")
+ }
+ if pb.providerLabel != "omp" {
+ t.Errorf("providerLabel = %q, want %q", pb.providerLabel, "omp")
+ }
+ }
+ })
+ }
+}
+
+// TestBuiltinRuntimeDescriptorFieldsAreConsumed guards against descriptor
+// fields going unused (the round-3 review caught this). Every field in
+// BuiltinRuntime must have at least one consumer outside the descriptor file
+// itself, or it's dead code.
+func TestBuiltinRuntimeDescriptorFieldsAreConsumed(t *testing.T) {
+ // The omp descriptor must have all fields populated.
+ desc, ok := BuiltinRuntimeByID("omp")
+ if !ok {
+ t.Fatal("omp descriptor not found")
+ }
+ // Every field must be non-empty (they're all consumed by daemon code).
+ checks := map[string]string{
+ "ID": desc.ID,
+ "ProtocolFamily": desc.ProtocolFamily,
+ "DefaultCommand": desc.DefaultCommand,
+ "EnvPrefix": desc.EnvPrefix,
+ "DisplayName": desc.DisplayName,
+ "SkillsDir": desc.SkillsDir,
+ "UserSkillsDir": desc.UserSkillsDir,
+ "LaunchHeader": desc.LaunchHeader,
+ "DefaultExecutable": desc.DefaultExecutable,
+ "ProviderLabel": desc.ProviderLabel,
+ }
+ for name, val := range checks {
+ if val == "" {
+ t.Errorf("descriptor field %s is empty", name)
+ }
+ }
+ // ModelDiscovery must be set (omp uses a different discovery command).
+ if desc.ModelDiscovery == nil {
+ t.Error("descriptor field ModelDiscovery is nil")
+ }
+}
diff --git a/server/pkg/agent/pi.go b/server/pkg/agent/pi.go
index c4c4e14c46..7e3d88f589 100644
--- a/server/pkg/agent/pi.go
+++ b/server/pkg/agent/pi.go
@@ -18,8 +18,20 @@ import (
// piBackend implements Backend by spawning the Pi CLI in non-interactive
// JSON mode (`pi -p --mode json --session <path>`) and parsing its event
// stream on stdout.
+//
+// It also backs the "omp" (oh-my-pi) provider — omp is a separate CLI
+// (https://omp.sh) that is a drop-in fork of pi and speaks the same JSON
+// event protocol. The daemon probes a separate `omp` binary and registers
+// it under the "omp" key; piBackend uses defaultExecutable so the fallback
+// binary name matches the provider key (pi → "pi", omp → "omp") when
+// cfg.ExecutablePath is empty.
type piBackend struct {
- cfg Config
+ cfg Config
+ defaultExecutable string
+ // providerLabel is the human-facing name used in log messages and error
+ // strings ("pi" or "omp"). Defaults to "pi" when empty so existing callers
+ // that construct piBackend directly (tests) keep their original output.
+ providerLabel string
}
var (
@@ -175,20 +187,27 @@ func isPiToolNameByte(b byte) bool {
}
func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions) (*Session, error) {
+ label := b.providerLabel
+ if label == "" {
+ label = "pi"
+ }
// Pi trims piped stdin before building its initial message. Reject an empty
// task here so whitespace-only input cannot turn into a successful process
// with no turn, no output, and an empty session.
if strings.TrimSpace(prompt) == "" {
- return nil, fmt.Errorf("pi prompt must not be empty")
+ return nil, fmt.Errorf("%s prompt must not be empty", label)
}
execName := b.cfg.ExecutablePath
+ if execName == "" {
+ execName = b.defaultExecutable
+ }
if execName == "" {
execName = "pi"
}
lookedUp, err := exec.LookPath(execName)
if err != nil {
- return nil, fmt.Errorf("pi executable not found at %q: %w", execName, err)
+ return nil, fmt.Errorf("%s executable not found at %q: %w", label, execName, err)
}
timeout := opts.Timeout
@@ -200,12 +219,12 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
if sessionPath == "" {
p, err := newPiSessionPath()
if err != nil {
- return nil, fmt.Errorf("pi session path: %w", err)
+ return nil, fmt.Errorf("%s session path: %w", label, err)
}
sessionPath = p
}
if err := ensurePiSessionFile(sessionPath); err != nil {
- return nil, fmt.Errorf("pi session file: %w", err)
+ return nil, fmt.Errorf("%s session file: %w", label, err)
}
runCtx, cancel := runContext(ctx, timeout)
@@ -225,7 +244,7 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
stdout, err := cmd.StdoutPipe()
if err != nil {
cancel()
- return nil, fmt.Errorf("pi stdout pipe: %w", err)
+ return nil, fmt.Errorf("%s stdout pipe: %w", label, err)
}
// Pi reads piped stdin to EOF as its initial prompt in print/JSON mode.
// Keeping user-controlled text off argv prevents the npm PowerShell shim
@@ -235,19 +254,19 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
stdin, err := cmd.StdinPipe()
if err != nil {
cancel()
- return nil, fmt.Errorf("pi stdin pipe: %w", err)
+ return nil, fmt.Errorf("%s stdin pipe: %w", label, err)
}
var closeStdinOnce sync.Once
closeStdin := func() { closeStdinOnce.Do(func() { _ = stdin.Close() }) }
- cmd.Stderr = newLogWriter(b.cfg.Logger, "[pi:stderr] ")
+ cmd.Stderr = newLogWriter(b.cfg.Logger, "["+label+":stderr] ")
if err := cmd.Start(); err != nil {
closeStdin()
cancel()
- return nil, fmt.Errorf("start pi: %w", err)
+ return nil, fmt.Errorf("start %s: %w", label, err)
}
- b.cfg.Logger.Info("pi started", "pid", cmd.Process.Pid, "cwd", opts.Cwd, "model", opts.Model)
+ b.cfg.Logger.Info(label+" started", "pid", cmd.Process.Pid, "cwd", opts.Cwd, "model", opts.Model)
msgCh := make(chan Message, 256)
resCh := make(chan Result, 1)
@@ -371,7 +390,7 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
if evt.FinalError != "" {
finalError = evt.FinalError
} else {
- finalError = "pi exhausted automatic retries"
+ finalError = label + " exhausted automatic retries"
}
}
}
@@ -390,19 +409,19 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
if runCtx.Err() == context.DeadlineExceeded {
finalStatus = "timeout"
- finalError = fmt.Sprintf("pi timed out after %s", timeout)
+ finalError = fmt.Sprintf("%s timed out after %s", label, timeout)
} else if runCtx.Err() == context.Canceled {
finalStatus = "aborted"
finalError = "execution cancelled"
} else if waitErr != nil && finalStatus == "completed" {
finalStatus = "failed"
- finalError = fmt.Sprintf("pi exited with error: %v", waitErr)
+ finalError = fmt.Sprintf("%s exited with error: %v", label, waitErr)
} else if writeErr != nil && finalStatus == "completed" {
finalStatus = "failed"
- finalError = fmt.Sprintf("pi prompt write failed: %v", writeErr)
+ finalError = fmt.Sprintf("%s prompt write failed: %v", label, writeErr)
}
- b.cfg.Logger.Info("pi finished", "pid", cmd.Process.Pid, "status", finalStatus, "duration", duration.Round(time.Millisecond).String())
+ b.cfg.Logger.Info(label+" finished", "pid", cmd.Process.Pid, "status", finalStatus, "duration", duration.Round(time.Millisecond).String())
resCh <- Result{
Status: finalStatus,