Skip to content

ACP connectors and the run's human port - #55

Merged
endrix merged 4 commits into
mainfrom
feat/acp-connector-and-human-port
Sep 15, 2026
Merged

endrix merged 4 commits into
mainfrom
feat/acp-connector-and-human-port

Conversation

@endrix

@endrix endrix commented Sep 15, 2026

Copy link
Copy Markdown
Owner

What

The ACP connector, for every product. A product declares one setting on its chat config, chat.acpConnector = { settingKey } (<namespace>.<key>, user level with a workspace override). The platform reads the connectors the way wfpy does, without wfpy: the four known agents (opencode acp, claude-agent-acp, codex-acp, gemini --experimental-acp), available when on the PATH with the agents' usual install dirs; ~/.config/wfpy/connectors.toml; the workspace's .wfpy/connectors.toml at the project root. From that it resolves the chat's agent when the chat connects and offers the connectors on an agent node's connector in the property panel (posted to the webview as dialogram.clientBehavior.merge once the editor is up).

The chat talks to any connector. The ACP client spawns the connector's command (with its env); opencode's HTTP-only capabilities (revert, message ids) apply only where the connector has that API. The connection status names the connector: "Connected · claude".

The run's human port. The run driver forwards the profile's ACP connector and permission settings to wfpy run and listens for the run's questions on a Unix socket it names with --elicit-socket. A running agent's question goes to the chat panel open on the diagram (driver → run host → chat runtime → panel, chat.runQuestion / chat.runAnswer), with a VS Code prompt as the fallback; the panel also renders the running agents' stream (text, reasoning, tool calls) as the run's viewer.

Property panel. Transport acp, a connector select from the listed connectors, a session mode; all serialize as @agent arguments.

Products

wfpy-ide, streamblocks-ide and mlir-viewer each declare their setting in their own PR; they build against this branch.

Checked

Typecheck on all five packages; the full suite (new tests: the TOML reader, the native connector reading with real files and a real PATH dir, the connector resolution, the driver's socket, the runtime's question round trip, the panel's question item and connected label, a second agent spawned without the HTTP port). Not exercised in a live VS Code session.

The run driver forwards the profile's ACP connector and permission
settings to the CLI (--acp-connector, --agent-cli-acp-permissions) and
listens for the run's questions on a Unix socket it names with
--elicit-socket (one JSON object a line; answer or decline back).

The property panel offers `acp` as a transport, a `connector` select
filled from what the runtime lists (`wfpy connectors --json`, per
document through the profile's new clientBehaviorFor hook, posted to
the webview as dialogram.clientBehavior.merge) and a session mode; both
serialize as @agent arguments.

The chat client spawns any ACP connector, not only opencode: the chat
config's acpAgent hook resolves the connector setting in the runtime's
listing; opencode's HTTP-only capabilities (revert, message ids) apply
only where the connector has that API.

The chat is the run's viewer: it renders the running agents' stream
(text, reasoning, tool calls) from the same live state as the bar, and a
running agent's question goes to the chat panel open on the diagram
(driver -> run host -> chat runtime -> panel, chat.runQuestion /
chat.runAnswer), falling back to a VS Code prompt when no panel is there.
A product declares `chat.acpConnector = { settingKey }` (the setting under
its namespace naming the connector, user level with a workspace override,
and optionally how to list the connectors); the platform resolves the
chat's agent from it when the chat connects and lists the connectors for
the property panel per document. The service moved from the sidecar
toolkit into extension-core so a profile built without the toolkit
(mlir-viewer) declares the same thing; the toolkit's profile declares it
from `acpConnectorSettingKey`, listing with the product CLI when that is
wfpy and with the wfpy beside the CLI otherwise, and `runAcpFlags: false`
keeps the run driver from forwarding wfpy's flags to another CLI. The
`clientBehaviorFor` and `acpAgent` hooks of the previous commit are gone.
…nnector

No product needs wfpy on the PATH to know the connectors: extension-core
reads what wfpy reads (the four known agents, available when their
command is on the PATH with the agents' usual install dirs;
~/.config/wfpy/connectors.toml; the workspace's .wfpy/connectors.toml at
the first directory up with a pyproject.toml or a .git), through a small
TOML reader of its own. A connector's `env` table reaches the spawned
process. The listing-command plumbing of the previous commit is gone.

The chat's connection status carries the connector's name, and the panel
shows "Connected · claude" rather than a bare "Connected".
…neutral

The neutrality gate refuses a product's name in the platform and the
toolkit, comments included. The two connectors files are part of the
product's declaration now (`chat.acpConnector.files`, relative to
~/.config and to the project root), the sidecar profile takes them as
`acpConnectorFiles`, and the elicitation socket is `acp-elicit-*`.
@endrix
endrix merged commit 1c48664 into main Sep 15, 2026
1 check 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