feat(acp): add Oh My Pi (omp) as a built-in ACP agent#963
Merged
Conversation
Integrate OMP via BitFun's existing ACP client subsystem instead of a bespoke
runtime — OMP speaks the Agent Client Protocol natively through `omp acp`, so it
reuses the entire battle-tested ACP path (subprocess spawn, JSON-RPC, tool
routing, permissions, session persistence, model selection, PATH probing).
- builtin_clients.rs: new preset { id: "omp", command: "omp", args: ["acp"] }.
Native ACP, no adapter (like opencode). Makes OMP appear automatically in the
per-workspace ACP session menu (which lists clients dynamically).
- OMP is user-managed: it targets the bun runtime and ships via its own
installer (`bun install -g @oh-my-pi/pi-coding-agent` or
`curl -fsSL https://omp.sh/install | sh`), which BitFun's npm-based installer
cannot provide. So `install_package` becomes Option and is None for omp;
BitFun only detects `omp` on PATH and launches it. The other presets keep
their npm installers (now Some(...)).
- AcpAgentsConfig.tsx: add OMP to the settings catalog; treat it as native ACP
(NATIVE_ACP_PRESET_IDS, no adapter) and as self-managed
(SELF_MANAGED_INSTALL_PRESET_IDS) so the one-click "Install CLI" action is
hidden — the row just reflects PATH-detected install state.
Verified: cargo test -p bitfun-acp (45 passed, incl. omp_is_a_native_acp_preset
asserting no adapter + no installer); vitest AcpAgentsConfig +
workspaceAcpMenuClients (10 passed); tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
把 Oh My Pi (omp) 作为内置 ACP agent 接入 FlowChat —— 复用 BitFun 已有的 ACP client 子系统,而不是为它新造一套运行时。
OMP 原生支持
omp acp(Agent Client Protocol over JSON-RPC),因此可以直接走现有 ACP 通道,免费获得:子进程拉起、JSON-RPC、工具路由(bash→terminal/create、read→fs/read_text_file、edit→session/request_permission走 BitFun 权限)、会话持久化、模型选择、PATH 探测等全部能力。改动
builtin_clients.rs:新增 preset{ id:"omp", command:"omp", args:["acp"] }。Native ACP、无 adapter(同 opencode)。per-workspace 的 ACP 会话菜单是动态从get_acp_clients读的,所以 OMP 会自动出现。bun运行时、通过自身安装器分发(bun install -g @oh-my-pi/pi-coding-agent或curl -fsSL https://omp.sh/install | sh),BitFun 的 npm 安装器无法提供。因此把install_package改为Option并对 omp 设None(其余 preset 保持Some(...));BitFun 只检测 PATH 上的omp并启动它。AcpAgentsConfig.tsx:设置目录新增 OMP;按 native ACP 处理(NATIVE_ACP_PRESET_IDS,无 adapter),并标为自管安装(SELF_MANAGED_INSTALL_PRESET_IDS),隐藏"一键安装 CLI"按钮——该行仅反映 PATH 检测到的安装状态。前置条件
用户需自行安装
omp(bun install -g @oh-my-pi/pi-coding-agent或curl -fsSL https://omp.sh/install | sh),使其在 PATH 上可用。BitFun 只提供接入,不负责安装。测试
cargo test -p bitfun-acp—— 45 passed(含新增omp_is_a_native_acp_preset,断言无 adapter、无 installer)。vitest AcpAgentsConfig + workspaceAcpMenuClients—— 10 passed。tsc --noEmit—— clean。🤖 Generated with Claude Code