[Feature]: Support generic ACP (Agent Client Protocol) executors (e.g., Gemini CLI without API Key)
Problem
LoopForge currently only supports 10 built-in CLI executors (claude-code, codebuddy, codex, opencode, cursor, agy, kimi, pi, dsh, zcode, defined in internal/domain/agent.go#L28 and internal/managedcli/providers.go#L30-L70). There is neither support for Google's official Gemini CLI (gemini) nor a generic ACP (Agent Client Protocol) executor integration.
For users who do not have a Gemini API Key and rely on a local/runner CLI that already handles authentication itself and exposes ACP (for example gemini --experimental-acp using Google account login, or other ACP-compatible coding CLIs):
- No Gemini CLI or ACP executor option: On
main(7625b9ce),agy(Antigravity CLI) is the only built-in executor for Gemini models. As noted in#1107, Gemini CLI and Antigravity (agy) are two separate CLI tools, so users without a Gemini API Key and withoutagycannot run Gemini via their existing ACP-capable CLI. - Existing ACP implementation is Cursor-internal only: LoopForge already contains a working JSON-RPC 2.0 ACP client (
assistantACPininternal/httpapi/assistant_engine_acp.go#L70-L293), supportinginitialize,session/new,session/load,session/prompt, andsession/update. However,agentCLIPromptInput(internal/runtime/provider_agentcli.go#L333-L338) restricts ACP solely tocursor(AgentCLICursor) for long prompts or resumed ACP chats, hardcodesmcpServers: []any{}(assistant_engine_acp.go#L214), and immediately repliescancelledtosession/request_permission(assistant_engine_acp.go#L175-L176).
Proposed behavior
Add support for generic ACP (Agent Client Protocol) CLI executors (with Google Gemini CLI as a first-class supported case / preset), so users can connect an ACP-capable CLI without requiring a separate API Key in LoopForge personal settings:
- Configurable ACP Executor / Preset:
- Allow registering or selecting an ACP-based CLI executor (such as
geminivia ACP, or a configurable ACP command/binary + args) in Runner / Personal Settings / Chat / SOP role configuration. - Support an execution-machine / local CLI auth mode (similar in spirit to
runnerLoginSpecininternal/runtime/conversation_runner_login.go#L23-L34), where the CLI relies on its own local login state instead of forcing an API Key in personal settings.
- Allow registering or selecting an ACP-based CLI executor (such as
- Generalize
assistantACPinto a Reusable Runtime Transport:- Decouple
assistantACP(internal/httpapi/assistant_engine_acp.go) from the Cursor-only long-prompt branch ininternal/runtime/provider_agentcli.go#L333-L338andinternal/httpapi/assistant_engine_agentcli.go, so both interactive chats and SOP nodes can run over ACP. - Forward configured MCP servers in
session/new/session/load(mcpServers) instead of hardcoding[]any{}. - Bridge
session/request_permissionwith LoopForge's existing read-only chat guardrails and SOP approval / permission policies instead of unconditionally cancelling every permission request.
- Decouple
- Session Persistence & Model Selection:
- Persist and resume native ACP
sessionIdviasession/loadwhenagentCapabilities.loadSessionis true, and allow specifying or discovering models supported by the ACP agent.
- Persist and resume native ACP
Scope
Platform — UI / integrations
Alternatives considered
- Using
agy(Antigravity) local account login (#1107): Works only if the user installs and logs intoagy, which is a different product/CLI from Google Gemini CLI and does not help users whose CLI only exposes ACP. - Adding one-off adapters for every new CLI: Integrating each new CLI's bespoke stream-json format separately (as done for
agy,kimi,zcode, etc.) increases maintenance overhead, whereas generalizing LoopForge's existing ACP client covers Gemini CLI and other ACP-compliant CLIs at once.
Checks
- [x] This proposal does not require organization-specific infrastructure or credentials.
- [x] I searched existing issues and discussions for similar proposals (
#1107covered Runner login reuse forcodex/claude-code/agyonly;#125targets ZCode and Reasonix specifically; no existing issue covers generic ACP or Gemini CLI integration).
中文说明
问题背景
LoopForge 目前仅内置支持 10 个 CLI 执行器(claude-code、codebuddy、codex、opencode、cursor、agy、kimi、pi、dsh、zcode,定义于 internal/domain/agent.go#L28 与 internal/managedcli/providers.go#L30-L70),既不支持 Google 官方 Gemini CLI(gemini),也没有提供通用的 ACP(Agent Client Protocol) 执行器接入能力。
对于没有 Gemini API Key、仅在本地或执行机器上拥有自带认证且支持 ACP 协议的 CLI(例如通过 Google 账号登录的 gemini --experimental-acp 或其他兼容 ACP 的编码 CLI)的用户:
- 缺少 Gemini CLI 与通用 ACP 执行器入口:在最新
main(7625b9ce)上,agy(Antigravity CLI)是唯一可用于 Gemini 模型的内置执行器。正如#1107评论所指出的,Gemini CLI 与 Antigravity(agy)是两个完全不同的 CLI 工具,没有 Gemini API Key 且未使用agy的用户目前无法通过现有 ACP CLI 接入。 - 仓库内已有 ACP 实现但被写死为 Cursor 内部专用:LoopForge 其实已经实现了一套基于 JSON-RPC 2.0 的 ACP 客户端(
internal/httpapi/assistant_engine_acp.go#L70-L293的assistantACP),支持initialize、session/new、session/load、session/prompt与session/update。但agentCLIPromptInput(internal/runtime/provider_agentcli.go#L333-L338)将其严格限制为仅cursor(AgentCLICursor)在超长提示词或恢复原 ACP 会话时触发,且mcpServers硬编码为空切片[]any{}(assistant_engine_acp.go#L214),收到session/request_permission时直接返回cancelled(assistant_engine_acp.go#L175-L176)。
期望行为
增加通用 ACP(Agent Client Protocol)CLI 执行器接入能力(并将 Google Gemini CLI 作为首选支持/内置预设之一),使用户无需在 LoopForge 个人配置中填写独立 API Key 即可接入兼容 ACP 的 CLI:
- 可配置的 ACP 执行器 / 预设:
- 支持在执行机器、个人配置、AI 对话与 SOP 角色中选择或注册基于 ACP 的 CLI 执行器(例如基于 ACP 的
geminiCLI,或可自定义 ACP 命令与启动参数)。 - 支持复用执行机器 / 本机 CLI 登录态的无 Key 运行模式(参考
internal/runtime/conversation_runner_login.go#L23-L34中runnerLoginSpec的思路),由 CLI 自身复用本机登录态,不强制要求在个人设置中填写 API Key。
- 支持在执行机器、个人配置、AI 对话与 SOP 角色中选择或注册基于 ACP 的 CLI 执行器(例如基于 ACP 的
- 将
assistantACP抽象为通用运行时传输层:- 将
assistantACP(internal/httpapi/assistant_engine_acp.go)从internal/runtime/provider_agentcli.go#L333-L338和internal/httpapi/assistant_engine_agentcli.go的 Cursor 专用分支中解耦,同时服务于 AI 对话与 SOP 节点执行。 - 在
session/new/session/load中透传已配置的mcpServers,不再硬编码为[]any{}。 - 将
session/request_permission接入 LoopForge 现有的只读对话限制与 SOP 审批机制,而不是无条件全部拒绝。
- 将
- 会话续跑与模型选择:
- 当 Agent 返回
agentCapabilities.loadSession == true时持久化并复用 ACPsessionId,并支持指定或拉取该 ACP Agent 可用的模型列表。
- 当 Agent 返回
影响范围
Platform — UI / integrations
备选方案
- 使用
agy(Antigravity)本机账号登录(#1107):仅在用户安装并登录了agy时可用,它与 Google Gemini CLI 并非同一工具,无法解决仅有 ACP 接入 CLI 的用户诉求。 - 为每个新 CLI 单独编写定制解析器:像
agy、kimi、zcode一样为每个 CLI 单独适配私有stream-json格式维护成本高;复用并泛化仓库内现有的 ACP 客户端可一次性覆盖 Gemini CLI 及其他支持 ACP 的工具。
检查项
- [x] 本提案不依赖特定组织的私有基础设施或凭据。
- [x] 已检索现有 Issue 与讨论(
#1107仅覆盖了codex/claude-code/agy的执行机器登录态复用;#125仅针对 ZCode 与 Reasonix;目前尚无针对通用 ACP 执行器或 Gemini CLI 接入的 Issue)。
Thank you for the proposal. We understand you'd like LoopForge to support generic ACP executors, so an ACP-capable CLI such as Gemini CLI can run with its own local login instead of requiring a separate API key in personal settings, and so the existing ACP client is not limited to the Cursor-only path.
This has been noted and will be reviewed with the current issue queue.