[FEATURE]: ACP over WebSocket for remote/network access #9211

Open
opened 2026-02-16 18:11:55 -05:00 by yindo · 2 comments
Owner

Originally created by @doxycomp on GitHub (Feb 12, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

Expose the Agent Client Protocol (ACP) over WebSocket so editors and clients can use OpenCode from another host on the network (e.g. remote dev machine, browser), not only via stdio.

Proposed solution

  • Add a WebSocket endpoint at /acp on the existing OpenCode server (same port as REST API, e.g. 4096).
  • Use the server’s startup directory as context; allow override via query/header.
  • Add CLI command opencode acp-websocket to start the server and advertise the ACP WebSocket URL.

Protocol stays JSON-RPC 2.0 newline-delimited; only the transport changes from stdio to WebSocket.

Originally created by @doxycomp on GitHub (Feb 12, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ## Summary Expose the Agent Client Protocol (ACP) over WebSocket so editors and clients can use OpenCode from another host on the network (e.g. remote dev machine, browser), not only via stdio. ## Proposed solution - Add a WebSocket endpoint at `/acp` on the existing OpenCode server (same port as REST API, e.g. 4096). - Use the server’s startup directory as context; allow override via query/header. - Add CLI command `opencode acp-websocket` to start the server and advertise the ACP WebSocket URL. Protocol stays JSON-RPC 2.0 newline-delimited; only the transport changes from stdio to WebSocket.
yindo added the discussion label 2026-02-16 18:11:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 12, 2026):

This issue might be a duplicate of or closely related to existing issues. Please check:

  • #12853: ACP can call a specified opencode server — addresses multi-editor contexts where ACP connects to a single instance
  • #8890: Better support remote/server-client use-cases from the CLI — includes distributed architecture goals with ACP
  • #11997: Auto-start web server mirror for remote access — addresses remote access needs via TCP proxy and web UI (different approach than WebSocket ACP)

Please review these issues to understand any overlapping goals or dependencies before proceeding.

@github-actions[bot] commented on GitHub (Feb 12, 2026): This issue might be a duplicate of or closely related to existing issues. Please check: - #12853: ACP can call a specified opencode server — addresses multi-editor contexts where ACP connects to a single instance - #8890: Better support remote/server-client use-cases from the CLI — includes distributed architecture goals with ACP - #11997: Auto-start web server mirror for remote access — addresses remote access needs via TCP proxy and web UI (different approach than WebSocket ACP) Please review these issues to understand any overlapping goals or dependencies before proceeding.
Author
Owner

@doxycomp commented on GitHub (Feb 12, 2026):

This issue might be a duplicate of or closely related to existing issues. Please check:

Please review these issues to understand any overlapping goals or dependencies before proceeding.

Thanks for flagging these. I’ve checked the related issues:
#12853 (ACP call specified server) and #8890 (remote/server–client CLI) are about the client side: the ACP client (e.g. opencode acp) connecting to an existing OpenCode server (e.g. via --attach or a server URL).
#11997 is about remote web UI via a TCP proxy for the app, not ACP.
This PR adds the server side: a WebSocket endpoint at /acp so that an already-running OpenCode server exposes ACP over the network. That enables:
Any ACP client (editor, script, or a future opencode acp --url ws://host:4096/acp) to connect to that server.
The use case in #12853 (e.g. “single opencode instance, multi-editor”) once clients support connecting to a WebSocket URL.
So this is the missing piece for “ACP can call a specified opencode server”: the server must first expose ACP over WebSocket, which is what this PR does.

@doxycomp commented on GitHub (Feb 12, 2026): > This issue might be a duplicate of or closely related to existing issues. Please check: > > * [[FEATURE]: ACP can call a specified opencode server #12853](https://github.com/anomalyco/opencode/issues/12853): ACP can call a specified opencode server — addresses multi-editor contexts where ACP connects to a single instance > * [[FEATURE]: Better support remote/server-client use-cases from the CLI #8890](https://github.com/anomalyco/opencode/issues/8890): Better support remote/server-client use-cases from the CLI — includes distributed architecture goals with ACP > * [feat(desktop): Auto-start web server mirror for remote access #11997](https://github.com/anomalyco/opencode/issues/11997): Auto-start web server mirror for remote access — addresses remote access needs via TCP proxy and web UI (different approach than WebSocket ACP) > > Please review these issues to understand any overlapping goals or dependencies before proceeding. Thanks for flagging these. I’ve checked the related issues: #12853 (ACP call specified server) and #8890 (remote/server–client CLI) are about the client side: the ACP client (e.g. opencode acp) connecting to an existing OpenCode server (e.g. via --attach or a server URL). #11997 is about remote web UI via a TCP proxy for the app, not ACP. This PR adds the server side: a WebSocket endpoint at /acp so that an already-running OpenCode server exposes ACP over the network. That enables: Any ACP client (editor, script, or a future opencode acp --url ws://host:4096/acp) to connect to that server. The use case in #12853 (e.g. “single opencode instance, multi-editor”) once clients support connecting to a WebSocket URL. So this is the missing piece for “ACP can call a specified opencode server”: the server must first expose ACP over WebSocket, which is what this PR does.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9211