LoopForge icon indicating copy to clipboard operation
LoopForge copied to clipboard

[Feature]: Support generic ACP (Agent Client Protocol) executors (e.g., Gemini CLI without API Key)

Open wycocoyu opened this issue 2 days ago • 1 comments

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):

  1. 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 without agy cannot run Gemini via their existing ACP-capable CLI.
  2. Existing ACP implementation is Cursor-internal only: LoopForge already contains a working JSON-RPC 2.0 ACP client (assistantACP in internal/httpapi/assistant_engine_acp.go#L70-L293), supporting initialize, session/new, session/load, session/prompt, and session/update. However, agentCLIPromptInput (internal/runtime/provider_agentcli.go#L333-L338) restricts ACP solely to cursor (AgentCLICursor) for long prompts or resumed ACP chats, hardcodes mcpServers: []any{} (assistant_engine_acp.go#L214), and immediately replies cancelled to session/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:

  1. Configurable ACP Executor / Preset:
    • Allow registering or selecting an ACP-based CLI executor (such as gemini via 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 runnerLoginSpec in internal/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.
  2. Generalize assistantACP into a Reusable Runtime Transport:
    • Decouple assistantACP (internal/httpapi/assistant_engine_acp.go) from the Cursor-only long-prompt branch in internal/runtime/provider_agentcli.go#L333-L338 and internal/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_permission with LoopForge's existing read-only chat guardrails and SOP approval / permission policies instead of unconditionally cancelling every permission request.
  3. Session Persistence & Model Selection:
    • Persist and resume native ACP sessionId via session/load when agentCapabilities.loadSession is true, and allow specifying or discovering models supported by the ACP agent.

Scope

Platform — UI / integrations

Alternatives considered

  • Using agy (Antigravity) local account login (#1107): Works only if the user installs and logs into agy, 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 (#1107 covered Runner login reuse for codex/claude-code/agy only; #125 targets 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)的用户:

  1. 缺少 Gemini CLI 与通用 ACP 执行器入口:在最新 main(7625b9ce)上,agy(Antigravity CLI)是唯一可用于 Gemini 模型的内置执行器。正如 #1107 评论所指出的,Gemini CLI 与 Antigravity(agy)是两个完全不同的 CLI 工具,没有 Gemini API Key 且未使用 agy 的用户目前无法通过现有 ACP CLI 接入。
  2. 仓库内已有 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:

  1. 可配置的 ACP 执行器 / 预设:
    • 支持在执行机器、个人配置、AI 对话与 SOP 角色中选择或注册基于 ACP 的 CLI 执行器(例如基于 ACP 的 gemini CLI,或可自定义 ACP 命令与启动参数)。
    • 支持复用执行机器 / 本机 CLI 登录态的无 Key 运行模式(参考 internal/runtime/conversation_runner_login.go#L23-L34 中 runnerLoginSpec 的思路),由 CLI 自身复用本机登录态,不强制要求在个人设置中填写 API Key。
  2. 将 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 审批机制,而不是无条件全部拒绝。
  3. 会话续跑与模型选择:
    • 当 Agent 返回 agentCapabilities.loadSession == true 时持久化并复用 ACP sessionId,并支持指定或拉取该 ACP 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)。

wycocoyu avatar Dec 01 '26 16:12 wycocoyu

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.

cocofhu00 avatar Dec 01 '26 17:12 cocofhu00