ACP connectors and the run's human port - #55
Merged
Merged
Conversation
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-*`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tomlat the project root. From that it resolves the chat's agent when the chat connects and offers the connectors on an agent node'sconnectorin the property panel (posted to the webview asdialogram.clientBehavior.mergeonce 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 runand 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, aconnectorselect from the listed connectors, a session mode; all serialize as@agentarguments.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.