Skip to content

Add Agent Client Protocol v1 support to ds4-agent#354

Open
omercelik wants to merge 1 commit into
antirez:mainfrom
omercelik:agent-acp-v1-full
Open

Add Agent Client Protocol v1 support to ds4-agent#354
omercelik wants to merge 1 commit into
antirez:mainfrom
omercelik:agent-acp-v1-full

Conversation

@omercelik
Copy link
Copy Markdown

@omercelik omercelik commented Jun 8, 2026

Summary

This adds Agent Client Protocol v1 support to ds4-agent using ACP standard
stdio transport.

The implementation keeps --acp as a separate mode so the existing TUI and
--non-interactive paths keep their current behavior. In ACP mode, stdout is
reserved for protocol messages and diagnostics stay on stderr or trace output.
It covers all non-optional ACP v1 agent features for the standard stdio
transport, and only advertises optional capabilities backed by DS4 behavior.

Supported pieces include:

  • initialize
  • session/new, session/prompt, session/cancel
  • session/list, session/load, session/resume, session/close, session/delete
  • session/set_config_option for DS4 browser permission behavior
  • session/update notifications for user and assistant text, tool calls, tool results, and config updates
  • text and resource prompt blocks, with image and audio rejected because DS4 does not advertise those capabilities
  • stdio MCP server configs, MCP tool listing, and MCP tool calls
  • ACP permission requests for visible browser startup

ACP reference docs:

Notes

The advertised capabilities are limited to behavior this patch implements. It
does not advertise auth, image/audio support, Streamable HTTP, HTTP MCP, or SSE
MCP.

MCP subprocess writes handle closed pipes without changing the process-wide
SIGPIPE handler, so normal agent modes keep their existing signal behavior.

Testing

  • make ds4-agent ds4_test
  • ./ds4_test --acp
  • ./ds4_test --server
  • DS4_TEST_MODEL=<local gguf> make test
  • Manual ACP stdio smoke with a local GGUF: initialize, session/new, session/prompt, session/cancel, and session/close; verified JSON-RPC-only stdout and stopReason: "cancelled" for the cancelled prompt.

@omercelik omercelik marked this pull request as draft June 8, 2026 00:37
@omercelik omercelik changed the title Add Agent Client Protocol stdio support to ds4-agent Add Agent Client Protocol v1 support to ds4-agent Jun 8, 2026
@omercelik omercelik marked this pull request as ready for review June 8, 2026 00:46
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