Add Agent Client Protocol v1 support to ds4-agent#354
Open
omercelik wants to merge 1 commit into
Open
Conversation
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.
Summary
This adds Agent Client Protocol v1 support to
ds4-agentusing ACP standardstdio transport.
The implementation keeps
--acpas a separate mode so the existing TUI and--non-interactivepaths keep their current behavior. In ACP mode, stdout isreserved 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:
initializesession/new,session/prompt,session/cancelsession/list,session/load,session/resume,session/close,session/deletesession/set_config_optionfor DS4 browser permission behaviorsession/updatenotifications for user and assistant text, tool calls, tool results, and config updatesACP 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
SIGPIPEhandler, so normal agent modes keep their existing signal behavior.Testing
make ds4-agent ds4_test./ds4_test --acp./ds4_test --serverDS4_TEST_MODEL=<local gguf> make testinitialize,session/new,session/prompt,session/cancel, andsession/close; verified JSON-RPC-only stdout andstopReason: "cancelled"for the cancelled prompt.