Skip to content

Support the Agent Client Protocol (ACP) for agent adapters #272

Closed

Description

@currentbits

Strategic, from the round-3 landscape survey: ACP is consolidating as the interop protocol (Zed registry of 60+ agents, JetBrains Air, Goose, Qwen Code, Devin Desktop all speak it), while vendor CLIs keep dying or being acquired (Gemini CLI sunset June 2026, Continue acqui-hired by Cursor, Roo Code dead, OpenCode renamed to Anomaly).

Solenta spawns CLIs over stdio today. Adding an ACP transport for agent adapters future-proofs against CLI churn and lets ACP-native agents plug in without per-vendor adapters. Also enables the inverse (Qwen's 'Claw' move): exposing Solenta itself over ACP/MCP so other agents can delegate into it, extending #157.

Activity

  1. added
    enhancement
    plan:todo
    on Aug 17, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Deep-dive urgency (harness roadmap round): both Grok Build and Kimi Code speak ACP natively (kimi acp, Grok's leader socket) — ONE ACP client integration gives Solenta deep control of two harnesses instead of PTY-scraping them. Highest-leverage integration available right now.

  3. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Research note (freshness scan): a second harness-protocol entrant appeared — HarnessRouter with its Unified Harness Protocol (UHP, 'LiteLLM but for harnesses': canonical API for running Codex/Claude Code/Hermes). Worth watching alongside ACP; the protocol race for the harness layer is officially on.

  4. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Deep-dive (ACP spec): the mechanics worth implementing. (1) session/new forwards the CLIENT's MCP servers to the agent; additionalDirectories bounds tool file ops beyond cwd. (2) session/load replays full history as session/update notifications; resume skips replay. (3) The cancellation contract, copy verbatim: on session/cancel the client marks unfinished tool calls cancelled, MUST answer pending permission requests with cancelled; the agent swallows aborts and resolves with stopReason cancelled, never an error. (4) tool_call has kind (read/edit/delete/execute/think...) and locations[] — that is what powers follow mode. (5) fs/read_text_file/write_text_file callbacks route agent edits THROUGH the client, so the client sees every write.

  5. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    From the kimi-code doc-mine: kimi acp is the structured path for the two things print mode cannot do — session/request_permission covers both approvals AND AskUserQuestion elicitation, fs/read|write_text_file reverse-RPC lets the client own file I/O, session/set_config_option exposes model/thinking/mode pickers, and orchestrator MCP servers forward via session/new. Another vote for ACP as the adapter transport.

  6. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Round 18 intel: ACP is consolidating as the orchestrator-to-agent protocol, which raises the priority of this issue:

    • JetBrains Air (air.dev, public preview since 2026-03, free, macOS with Win/Linux planned) is built entirely on ACP: Codex, Claude Agent, Gemini CLI, and Junie run as parallel ACP sessions, each isolated in its own Docker container or git worktree. Air is the closest funded analog to Solenta (define task -> delegate to N agents -> review with IDE-grade tooling), and JetBrains co-developed ACP with Zed, so the protocol has two major sponsors.
    • Zed Terminal Threads (2026-05): Zed hosts Claude Code, Amp, OpenCode as persistent sidebar threads over ACP, including a spawn_agent tool for sub-agent orchestration.
    • Devin Desktop speaks ACP for remote agents and hit the scaling edges we should note: large-file reads through ACP are now bounded and paginated instead of repeatedly rereading overflow files, and per-MCP-server log separation (MCP: <server> output channels) for debuggability (changelog 2026-08-10).
    • Also from round 21 adapter intel: kimi-code ships kimi acp natively, so a Solenta ACP adapter unlocks several providers at once.

    Implementation notes when this gets picked up: bound file reads (pagination), per-server log channels from day one, and treat permission prompts as first-class ACP session/request_permission events feeding #291.

  7. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Round 26 ACP implementation traps from Goose's tracker (they ship an ACP client): (1) "ACP/CLI providers drop system prompt + tools: recipes lose instructions, response.json_schema deadlocks" (aaif-goose/goose#10275): when an ACP session is created, the client's system prompt and tool set can be silently dropped by the agent side, so the orchestrator must verify what the session actually loaded, not assume; (2) "Enabling MCP disables tools (Zed)" (#11012): enabling MCP on the client can replace rather than extend the agent's tool set. Both are silent-degradation bugs of exactly the class #324 (provider capability self-checks) is meant to catch: after session init, diff requested vs effective capabilities and warn loudly.

  8. currentbits commented on Oct 4, 2026

    @currentbits
    OwnerAuthor

    Go for Grok, no-go for Cursor. That's the verdict of a code-level look at how T3 Code Orchestrator V2 uses ACP (T3 main eac52f0, 2026-10-04). Full notes: research_notes/T3 orchestrator ACP UX and repros/acp_adapter.md on branch coder/i-want-you-to-research-t3-codes-orchestr-fae77a.

    Why Grok first

    • Grok runs about 80% of Solenta's crew workers (399 of 493 historically). Headless grok -p has no prompt channel, so it is forced into always-approve, and questions only get answered on the next turn (runner.js:2702-2716).
    • Over ACP (grok agent stdio, present in the installed 1.0.46), Grok gets live approval, question and plan-exit requests.

    T3's Grok workarounds to copy

    • Identify as _meta.clientType: "extension". Otherwise Grok's auto mode silently denies blocked actions, the same as -p does.
    • Only ever answer "allow once". Grok's "always" persists a project-wide grant.
    • Handle Grok's own question and plan-exit requests, or the turn hangs.
    • Watch Grok's own completion notification alongside the session/prompt reply, which sometimes never arrives.
    • Map the non-standard rate_limit stop reason to the usage-limit state.
    • A user Stop kills and respawns the process, because Grok otherwise sticks in task_already_running.

    Not Cursor

    T3 deleted its Cursor ACP code on 2026-10-02 after reliability bugs and moved to @cursor/sdk. Cursor's ACP mode also ignores client-passed MCP servers and only reads .cursor/mcp.json. Keep Cursor on print mode.

    Other CLIs

    Kimi (kimi acp, 0.39.1) and OpenCode (opencode acp, 1.17.12) can follow cheaply. OpenCode gets no Solenta MCP servers today, and ACP's per-session mcpServers would fix that.

    Design

    • Protocol: speak ACP v1. v2 has been a draft since 2026-07-20 and drops session/load and the fs/terminal callbacks. Offer no fs/terminal client capabilities.
    • Phase 1: one ACP process per run, matching how runs work today.
      • New electron/acp.js, reusing the JSON-RPC client in codexJsonRpc.js and the event-translation pattern in codex-appserver.js:187-269.
      • Map approvals onto the Codex decision set.
      • Pass MCP servers per session/new; memory-sup.js:653-715 is already nearly that shape.
      • Add a provider kind to the permission routing, which only knows Claude and Codex today (runner.js:2324, 2610-2615).
      • Workers launch in Grok's auto mode, where only blocked actions ask; foreground threads use default. Keep headless as a per-provider fallback toggle, and add an idle watchdog. T3 still has Grok stuck "working" after its final answer (#15489).
    • Phase 2 (later): a process kept alive per thread, for soft steering (cancel plus re-prompt in the same session).
    • Size: about 1k lines for the first Grok slice; 1.6–2.5k including Kimi/OpenCode and tests/fixtures. T3's equivalent is about 12.6k.

    What it doesn't fix

    Check first

    Whether grok agent stdio honours the per-thread GROK_HOME and its guardrail hook the way grok -p does. Also sequence this after #1425 (bound per-thread MCP endpoint) and #1428 (replay fixtures; T3's ~300-line ACP replay peer is good prior art).

  9. currentbits commented on Oct 9, 2026

    @currentbits
    OwnerAuthor

    Re-ranked as the #2 feature gap in the 2026-10-09 gap pass. Solenta still has 7 hand-written adapters (electron/providers.js:242-1405), so every new agent (Gemini CLI, Pi, Antigravity #452, Kiro, DeepSeek…) needs a Solenta release. Suggested scope: (1) a generic ACP stdio provider driven by a user-entered command, (2) the public ACP registry as a picker, (3) map ACP permission requests onto the existing approval cards and ACP plans onto plan cards. This would also close #452 and most of #458.

  10. added
    plan:doing
    and removed
    plan:todo
    on Oct 19, 2026
  11. currentbits commented on Oct 19, 2026

    @currentbits
    OwnerAuthor

    First slice (client side) is ready on thread branch coder/support-the-agent-client-protocol-acp-fo-34efb3, not yet committed:

    • electron/acp.js: an ACP v1 client over stdio. One turn runs initialize → session/new → session/prompt and reuses the existing JSON-RPC stdio session from codexJsonRpc.js.
    • Custom CLI rows (Generic CLI provider: drop in any agent binary #458) get a third Output option, Agent Client Protocol (ACP). So any ACP-native agent plugs in from Settings › Agents with no per-vendor adapter.
    • Message chunks stream into the reply, and tool calls show up as work-log steps.
    • Permission requests are answered from the thread's mode: Full access approves them, and Default rejects them with a "Denied: …" step.
    • Tests: custom-cli-provider.test.js uses a fake ACP agent (10/10 pass). Typecheck is clean. A CI-comparable test:electron run gives 4952 pass, 0 fail.

    Not in this slice:

    • Interactive per-call approval in the permission UI.
    • session/load resume. Each turn currently replays the transcript tail, like other custom CLIs.
    • A handshake timeout.
    • The inverse direction: exposing Solenta itself over ACP.
  12. currentbits commented on Oct 19, 2026

    @currentbits
    OwnerAuthor

    Design: Solenta as an ACP agent (the inverse direction)

    This lets Zed, JetBrains or another ACP client spawn "Solenta" as its agent and hand work to a Solenta thread. It targets ACP v1 and extends #157.

    Transport

    • The editor spawns a thin CLI, node electron/acp-cli.js. It is a dumb pipe and contains no ACP logic:
      1. It reads <userData>/orch-server.json for { port, token }. That's the same file the coder-threads MCP server already writes.
      2. It opens GET /acp on 127.0.0.1:<port> with Authorization: Bearer <token> and Upgrade: solenta-acp.
      3. It pipes stdin and stdout over the upgraded socket, both ways.
    • All protocol logic lives in the main process (electron/acpServer.js), next to the store and runner. That keeps behaviour identical to the in-app view, and the app stays the single writer of coder-store.json.
    • Auth is the orch-server session token, loopback only. Pairing tokens are not accepted on /acp. The token rotates each launch, but the CLI re-reads the file on every spawn, so this costs nothing.
    • If the app isn't running, the CLI writes a one-line reason to stderr and exits 1. Auto-launching the app is a follow-up.
    • Why not reuse the MCP tools from a standalone process: thread_status only returns the first line of the last reply. Streaming would mean polling over HTTP. Inside main, the session simply observes the runner's existing thread:updated pushes.

    Session ↔ thread

    • initialize: returns protocolVersion: 1, agentCapabilities: { loadSession: false } and authMethods: [].
    • session/new { cwd }: resolves cwd to a registered local project using the same path matching as Add Project (findExistingProject). It then creates a fresh thread in that project, titled "ACP: …" so it is recognisable in the sidebar. The thread runs on the project's default provider.
      • No worktree: the thread works in the checkout the editor has open, so edits show up live in the editor. A worktree-backed session can be an opt-in later.
      • Unknown cwd is an error that tells the user to add the folder in Solenta first. Projects are not registered automatically.
    • sessionId is the thread id. The thread stays a normal Solenta thread, so the user can open it, steer it, archive it, or thread_fork from it.
    • session/prompt: joins the text content blocks and calls runner.startRun({ threadId, prompt }), which is the same entry point thread_send uses. It resolves when the run ends:
      • done → { stopReason: "end_turn" }
      • stopped after session/cancel → { stopReason: "cancelled" }
      • failed → a JSON-RPC error carrying lastError
      • quota-wait keeps the prompt open
    • session/cancel: calls runner.stopRun({ threadId }).
    • session/update is derived from the thread's own transcript on every push, so it works for every provider without per-adapter code:
      • The assistant message text grows in place. Each push sends the new characters, keyed by message id, as an agent_message_chunk.
      • Tool messages (role tool) send a tool_call the first time they appear. When they finish, they send a tool_call_update with completed or failed.
      • Work-log steps become an ACP plan, which is a full list each time. Each entry's status is completed when its step is done, otherwise in_progress.
    • Later: session/load (resuming an existing thread by id), and mapping thread_fork workers to ACP sub-sessions.

    Permission requests

    • Prompts are forwarded to the client. A thread blocked on a prompt already shows up as pendingPermission in the runner push, and the session watches for a new requestId there.
      • It sends session/request_permission with the tool call and the options allow_once, reject_once, and allow_always when the prompt allows always-accept.
      • The client's answer maps to runner.respondPermission({ threadId, requestId, decision }).
    • First answer wins. The card still appears in the Solenta UI. If the user answers there first, the late ACP reply for a requestId that is no longer pending is ignored. A cancelled outcome counts as a deny.
    • Permission mode stays per thread and is set in Solenta. ACP session/set_mode → permission mode is a follow-up.

    First slice (this thread)

    • initialize, session/new, session/prompt, session/cancel, message chunks, tool calls, plan, and request_permission.
    • A node:test that drives it with a fake store and runner, plus one that runs the real CLI over the /acp upgrade.
  13. currentbits commented on Oct 19, 2026

    @currentbits
    OwnerAuthor

    Second slice: everything listed as not done in the last comment is now done. Changes are uncommitted on this thread's branch.

    Client (custom CLI rows set to ACP)

    • In Default mode, each agent session/request_permission becomes the thread's normal permission card (Allow / Allow always / Deny). Stop answers any open requests with cancelled, as the spec requires.
    • session/load resume: if the agent advertises loadSession, the thread keeps the agent's session id and skips the transcript replay. History the agent replays while loading is ignored. If the load fails, the run fails once, the dead id is dropped, and the next send replays the transcript.
    • 60s handshake timeout for CLIs that never answer initialize.
    • Auth errors include the agent's own sign-in hint taken from authMethods, e.g. "run kimi login in a terminal".

    Solenta as an ACP agent (electron/acp-server.js)

    • A stdio ACP server that editors spawn. Each ACP session is one Solenta task, driven only through the External MCP integration: scoped pairing so outside agents can launch and track Solenta tasks #157 pairing tools (task_launch / task_send / task_status / task_stop). Pairing scope, capabilities, launch approval and rate limits therefore still apply.
    • The reply streams into the editor as it grows. session/cancel stops the task. A launch that needs approval tells the editor it is waiting.
    • task_status gains an additive reply field {id, text}.
    • Creating a pairing now offers a Copy editor (ACP) config button. It produces a Zed / JetBrains agent_servers entry that runs the script with the app's own binary (ELECTRON_RUN_AS_NODE).

    Tests

    • 14/14 in custom-cli-provider, 6/6 in the new acp-server, 95/95 in settingsModal.
    • Full test:electron with a CI-comparable env: 4961 pass, 0 fail. Typecheck is clean.
    • Live check: initialize and session/new work against opencode acp 1.17.12 and kimi acp 0.39.1, and both advertise loadSession. Neither completed a prompt on this machine, because of local account state (OpenCode free-tier version gate, Kimi not logged in) rather than the protocol.

    Known limits:

    • The Solenta thread's tool calls and permission prompts are not mirrored to the editor; they stay in the app.
    • We never call authenticate; the user signs the agent in from a terminal once.
  14. added
    plan:done
    and removed
    plan:doing
    on Oct 19, 2026
  15. currentbits commented on Oct 19, 2026

    @currentbits
    OwnerAuthor

    Landed from Solenta thread "Fork: Support the Agent Client Protocol (ACP) for agent adap". Closed on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions