Skip to content

Run ACP agents as custom CLIs, and let editors drive Solenta over ACP (#272) - #1699

Merged
currentbits merged 6 commits into
mainfrom
coder/support-the-agent-client-protocol-acp-fo-34efb3
Oct 19, 2026
Merged

currentbits merged 6 commits into
mainfrom
coder/support-the-agent-client-protocol-acp-fo-34efb3

Conversation

@currentbits

@currentbits currentbits commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Any agent that speaks the Agent Client Protocol now plugs into Solenta without a per-vendor adapter. Pick Agent Client Protocol (ACP) as the Output of a custom CLI in Settings › Agents. In the other direction, Zed, JetBrains and other ACP editors can launch and follow Solenta tasks through a pairing token. Closes the work in #272.

Changes

  • ACP agents as custom CLIs:
    • The reply streams in as the agent writes it, and each tool call shows as a work-log step.
    • In Default mode, each permission request shows as the thread's normal Allow / Allow always / Deny card. Full access approves requests automatically.
    • If an agent can reload its sessions, the thread resumes the agent's own session instead of replaying the transcript. If a reload fails, the run fails once and the next send falls back to replaying the transcript.
    • A command that never answers the opening handshake fails after 60s. Sign-in errors repeat the agent's own instruction, e.g. "run kimi login in a terminal".
  • Solenta as an ACP agent: new electron/acp-server.js, a stdio bridge that editors start.
    • It only calls the existing pairing tools from External MCP integration: scoped pairing so outside agents can launch and track Solenta tasks #157, so the pairing's project scope, capabilities, launch approval and rate limits all still apply.
    • Each editor session becomes one task. The reply streams into the editor, cancel stops the task, and a launch that needs approval says it is waiting.
    • Creating a pairing now offers a Copy editor (ACP) config button, which gives a ready agent_servers entry.
  • The pairing tools' task_status result gains an additive reply field {id, text} holding the full latest reply. It's what the bridge streams from.

Verification

  • custom-cli-provider.test.js (14 tests) uses a fake ACP agent. It covers streaming, tool steps, approve and deny on the card, Full access, Stop clearing an open card, resume (ignoring the history the agent replays while reloading), the failed-resume fallback, the handshake timeout and the sign-in hint.
  • acp-server.test.js (6 tests) runs against a real orch server, a real store and a real pairing token, with only the agent run faked. It covers launch, streaming and follow-up, cancel, waiting for approval, a read-only pairing's error, project picking, and the script refusing to start without its env.
  • npm run typecheck is clean. settingsModal.test.tsx passes 97/97.
  • Full test:electron run with the inherited CODER_* variables removed: 5010 pass, 1 fail. The failure was site-llms.test.js, which was also red on main: Mark dev servers live only once a declared readiness probe passes #1689 changed docs.html without regenerating site/llms-full.txt. This PR now includes the regenerated file (only that one paragraph), and the test passes locally.
  • Live run on this machine:
    • The client connected to opencode acp (1.17.12) and kimi acp (0.39.1) and started a session; both say they can reload sessions.
    • Neither finished a prompt, for account reasons unrelated to the protocol: OpenCode's version is below its free-tier minimum, and Kimi isn't logged in. With Kimi, the new sign-in hint appeared as intended.
  • Not tested: the editor side against a real Zed or JetBrains install.
  • macOS CI hit a flake in replay-scenarios.test.js: the helper parsed replay.log while the fake CLI was still writing it ("Unexpected end of JSON input"). electron/test/support/replay.js now treats an empty file or a half-written line as not done yet. Passed 5/5 on three local runs.

Notes for reviewers

  • Read order: electron/acp.js, electron/acp-server.js, then runner-provider-generic.js and runner-permissions.js.
  • On a custom CLI thread, sessionId is now only set for ACP agents that can reload sessions. The existing code paths that clear it (provider switch, rewind, fork) already set transcript replay, which is the right fallback.
  • The bridge polls task_status once a second, about 60 of the pairing's default 120 reads per minute. Two concurrent editor sessions can hit HTTP 429; it then waits 5s and retries.
  • Left out deliberately:
    • Mirroring the Solenta thread's tool calls and permission cards into the editor; they stay in the app.
    • Calling ACP authenticate; users sign agents in from a terminal once.

claude-opus-5-5 via Claude Code

Solenta and others added 3 commits October 19, 2026 10:20
Solenta-Message-Id: 11966517-c619-42ad-a3b4-d2b5bfe76d8b
Solenta-Message-Id: adc9fdbc-6b99-4514-a298-2ac7372c41fb
…nt-client-protocol-acp-fo-34efb3

# Conflicts:
#	electron/runner-provider-generic.js
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T10:21:11.771953Z 6cb349a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cb349a3cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/pairing.js
Comment on lines +268 to +270
agent_servers: {
Solenta: {
command: process.execPath,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the custom-agent type to the Zed configuration

When this generated JSON is pasted into Zed, the Solenta entry has no type discriminator. Zed's documented custom-agent format requires "type": "custom", so the advertised Zed configuration is rejected or ignored rather than launching Solenta; generate a Zed-compatible entry or separate editor-specific configurations. Zed custom-agent configuration

Useful? React with 👍 / 👎.

Comment thread electron/pairing.js
Comment on lines +265 to +266
const acpJson = url
? JSON.stringify(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require steer capability before offering ACP configuration

The Integrations UI leaves the steer checkbox off by default, producing a pairing with only read and launch, but this ACP server uses task_send for every follow-up and task_stop for cancellation, and both handlers require steer. Consequently, the default copied configuration can complete only its first prompt: later prompts fail authorization, and cancellation cannot stop the task. Only emit this configuration for steer-enabled pairings or otherwise ensure the ACP flow has the required capability.

Useful? React with 👍 / 👎.

Comment on lines +484 to +488
const handle = acp
? runAcpAgent({
...callbacks,
command: spawn.binary,
args: spawn.args,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the prompt out of remote ACP command arguments

For an SSH or WSL project, spawn.args was constructed above with the user prompt appended for the legacy generic runner, and this ACP branch now passes those same arguments to runAcpAgent before also sending the prompt through session/prompt. ACP agents expect their configured arguments merely to start the stdio server, so remote ACP commands receive an unexpected prompt argument and commonly exit before the handshake; construct the crossing spawn without the appended prompt when acp is selected. ACP transport documentation

Useful? React with 👍 / 👎.

Willem and others added 3 commits October 19, 2026 12:27
docs.html gained the readiness-probe paragraph in #1689 without a rebuild,
so site-llms.test.js failed on main and on every PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
replay.js polls replay.log while the fake CLI appends to it. An empty file or
a half-written last line threw "Unexpected end of JSON input" on macOS CI
instead of reading as not-done-yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nt-client-protocol-acp-fo-34efb3

# Conflicts:
#	electron/runner-permissions.js
@currentbits
currentbits merged commit d3e4e54 into main Oct 19, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant