Releases: coder/acp-go-sdk
v0.13.0: MCP-over-ACP and named string-enum constants
Tracks ACP schema 0.13.0. The headline additions are the unstable MCP-over-ACP transport (mcp/connect, mcp/message, mcp/disconnect) and a code-generation improvement that turns "open" string enums into named Go constants — which means two existing types change shape.
Added
Unstable MCP-over-ACP surface (#39 by @ThomasK33)
Agents can now host MCP servers over the ACP channel itself instead of (or alongside) stdio/http/sse. The regenerated bindings expose:
-
A new
McpServervariantAcp *McpServerAcpInlineplusMcpServerAcp/McpServerAcpId, gated by a newMcpCapabilities.Acpboolean. -
Request/response/notification types
UnstableConnectMcp{Request,Response},UnstableDisconnectMcp{Request,Response},UnstableMessageMcp{Request,Notification,Response}, and a newUnstableMcpConnectionIdopaque identifier. -
AgentSideConnection.UnstableConnectMcp(ctx, params)andAgentSideConnection.UnstableDisconnectMcp(ctx, params)for the agent to open and close MCP-over-ACP connections against the client. -
Client-side dispatch for
mcp/connectandmcp/disconnect. Implement these on yourClientto handle them — they are detected via optional interfaces, so existing clients continue to compile and simply returnMethodNotFound:type Client interface { // ... existing methods ... // Optional, both sides: UnstableConnectMcp(ctx context.Context, p acp.UnstableConnectMcpRequest) (acp.UnstableConnectMcpResponse, error) UnstableDisconnectMcp(ctx context.Context, p acp.UnstableDisconnectMcpRequest) (acp.UnstableDisconnectMcpResponse, error) }
-
New method-name constants:
ClientMethodMcpConnect,ClientMethodMcpDisconnect,ClientMethodMcpMessage, andAgentMethodMcpMessage.
Everything above is marked UNSTABLE in the schema and may change in future releases.
Named constants for open string enums (#37 by @agentcooper)
The code generator now recognizes schemas that describe a string with a recommended set of values plus a free-form fallback, and emits them as a named string type with const declarations. Two existing types switch to this form:
type SessionConfigOptionCategory string
const (
SessionConfigOptionCategoryMode SessionConfigOptionCategory = "mode"
SessionConfigOptionCategoryModel SessionConfigOptionCategory = "model"
SessionConfigOptionCategoryThoughtLevel SessionConfigOptionCategory = "thought_level"
)
type UnstableLlmProtocol string
const (
UnstableLlmProtocolAnthropic UnstableLlmProtocol = "anthropic"
UnstableLlmProtocolOpenai UnstableLlmProtocol = "openai"
UnstableLlmProtocolAzure UnstableLlmProtocol = "azure"
UnstableLlmProtocolVertex UnstableLlmProtocol = "vertex"
UnstableLlmProtocolBedrock UnstableLlmProtocol = "bedrock"
)Unknown values remain representable — just assign a string literal — so the schema's extensibility is preserved.
Changed
McpCapabilitiesand theInitializeResponse.AgentCapabilitiesdefault now include"acp": false. Existing initialization payloads round-trip unchanged.schema/versionis now0.13.0; install withgo get github.com/coder/acp-go-sdk@v0.13.0.
Breaking Changes
SessionConfigOptionCategory and UnstableLlmProtocol are no longer wrapper structs with an Other field. Migrate as follows:
| Before | After |
|---|---|
SessionConfigOptionCategoryOther("model") wrapped in SessionConfigOptionCategory{Other: &v} |
SessionConfigOptionCategoryModel (or SessionConfigOptionCategory("model")) |
cat.Other != nil && *cat.Other == "mode" |
cat == SessionConfigOptionCategoryMode |
UnstableLlmProtocol{Other: &v} |
UnstableLlmProtocolAnthropic, etc., or a plain UnstableLlmProtocol("custom") for unknown values |
Fields holding these types remain *SessionConfigOptionCategory / *UnstableLlmProtocol, so you generally take the address of a constant when populating optional fields — see the updated unstable_types_test.go for an example.
Full Changelog: v0.12.2...v0.13.0
v0.12.2: Stable session/close and session/resume
Tracks ACP schema 0.12.2, which promotes session/close and session/resume from unstable to the stable surface. Agent implementations must now provide CloseSession and ResumeSession, and the corresponding unstable types and AgentExperimental methods have been removed.
Added
Agentinterface gained two new required methods backed by stable schema entries (#35):CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error)
SessionCapabilitiesnow advertises support via stableClose *SessionCloseCapabilitiesandResume *SessionResumeCapabilitiesfields.ResumeSessionRequestcarriesAdditionalDirectoriesandMcpServers;ResumeSessionResponsereturnsConfigOptionsandModes(with an unstableModelsfield still gated).
Changed
- Schema version bumped to 0.12.2; the
session/closeandsession/resumerequest/response types and capability descriptors no longer carry the UNSTABLE marker in their godoc (#35). ClientSideConnection.UnstableCloseSession/UnstableResumeSessionwere renamed toCloseSession/ResumeSession. Callers must update method names and parameter/return types.ResumeSessionResponse.ConfigOptionsswitched element type fromUnstableSessionConfigOptionto the stableSessionConfigOption.UnstableProviderInfo.Currentis now optional (json:"current,omitempty") and removed from the JSON-required field list — both omission andnullindicate a disabled provider.
Removed
AgentExperimental.UnstableCloseSessionandAgentExperimental.UnstableResumeSession, plus theUnstableCloseSessionRequest/ResponseandUnstableResumeSessionRequest/Responsetypes. Migrate to the stableAgent.CloseSession/Agent.ResumeSessionmethods and the unprefixed types (#35).
Breaking Changes
All Agent implementors must add CloseSession and ResumeSession methods (returning MethodNotFound is fine if the agent doesn't advertise the capability — see the updated example/agent/main.go). Code referencing the unstable types or ClientSideConnection.Unstable{Close,Resume}Session must be renamed:
| Before | After |
|---|---|
AgentExperimental.UnstableCloseSession |
Agent.CloseSession |
AgentExperimental.UnstableResumeSession |
Agent.ResumeSession |
UnstableCloseSessionRequest / Response |
CloseSessionRequest / Response |
UnstableResumeSessionRequest / Response |
ResumeSessionRequest / Response |
ClientSideConnection.UnstableCloseSession |
ClientSideConnection.CloseSession |
ClientSideConnection.UnstableResumeSession |
ClientSideConnection.ResumeSession |
Consumers of UnstableProviderInfo that relied on current always being present should treat a missing or null value as "provider disabled".
Full Changelog: v0.12.0...v0.12.2
v0.12.0: Response-scoped notification barrier
A focused bug-fix release that hardens Connection's notification synchronization. No schema changes, no generated API changes, no migration required.
Fixed
-
WaitGroup reuse panic under concurrent requests (#30 by @ThomasK33).
SendRequest[T]/SendRequestNoResultpreviously calledWait()on a sharedsync.WaitGroupafter every response. With overlapping requests — most reproduciblyClientSideConnection.LoadSessionreplayingsession/updatenotifications on a resumed session — two waiters could race the counter's reuse and triggersync: WaitGroup is reused before previous Wait has returned.The shared barrier has been replaced with a response-scoped, monotonic notification-sequence barrier:
- Each accepted notification is assigned a sequence number when it is queued.
- When a response is observed, the receive goroutine snapshots the current notification watermark and attaches it to the response envelope.
- The waiting request blocks (via
sync.Cond) only until completed notifications reach that snapshotted watermark — so it waits for notifications that arrived before the response, but not for any that arrived after.
Notification ordering is still preserved by the single-consumer
processNotificationsgoroutine, and shutdown still drains through the final queued notification with the existing 5s timeout. The public API is unchanged.
Changed
- Cancellation while waiting for pre-response notifications no longer deadlocks. If the connection context is canceled while a request is blocked on its notification barrier, the call now returns a connection error promptly. Previously the shared
WaitGroupcould keep the caller blocked indefinitely in this case.
Full Changelog: v0.11.7...v0.12.0
v0.11.7: Schema 0.11.7 — list_sessions stabilized, AuthMethod union, terminal/kill rename
Tracks ACP schema 0.11.7. The big-ticket items are: session/list is promoted from unstable to the stable Agent surface, terminal/kill types are renamed to drop the Command suffix, AuthMethod is now a discriminated union, and a large batch of unstable methods (NES, document events, providers, logout, close-session, elicitation) is now wired through the generated handlers. Implementors of Agent and Client will need source changes — see Breaking Changes for the full list.
Added
-
Agent.ListSessionsis now stable (#29 by @ThomasK33). The previously unstablesession/listmethod is now part of the stableAgentinterface, with stableListSessionsRequest/ListSessionsResponsetypes and a stableClientSideConnection.ListSessionscaller.func (a *myAgent) ListSessions(ctx context.Context, params acp.ListSessionsRequest) (acp.ListSessionsResponse, error) { return acp.ListSessionsResponse{Sessions: []acp.SessionInfo{...}}, nil }
-
New unstable agent methods on
AgentExperimental, each with generated request/response types, validators, and routing inAgentSideConnection.handle:- Document lifecycle:
UnstableDidOpenDocument,UnstableDidChangeDocument,UnstableDidCloseDocument,UnstableDidFocusDocument,UnstableDidSaveDocument. - Next Edit Suggestions (NES):
UnstableStartNes,UnstableSuggestNes,UnstableAcceptNes,UnstableRejectNes,UnstableCloseNes. - Providers:
UnstableListProviders,UnstableSetProviders,UnstableDisableProviders. - Sessions/auth:
UnstableCloseSession,UnstableLogout.
- Document lifecycle:
-
New unstable client method for agent-driven UI prompts:
Client.UnstableCreateElicitation(request) andClient.UnstableCompleteElicitation(notification). The request is aform/urlunion; the response is anaccept/decline/cancelunion with helper constructors (NewUnstableCreateElicitationResponseAccept, etc.). -
New capability descriptors advertised in
InitializeResponse/ClientCapabilities:AgentAuthCapabilities,LogoutCapabilities,ProvidersCapabilities,NesCapabilitiesand the fullNes*Capabilitiesfamily,ClientNesCapabilities,ElicitationCapabilities, plus a client-sideAuthCapabilities(with aterminalflag). -
New method-name constants in
constants_gen.go:AgentMethodSessionClose,AgentMethodLogout,AgentMethodNes{Start,Suggest,Accept,Reject,Close},AgentMethodProviders{List,Set,Disable},AgentMethodDocumentDid{Open,Change,Close,Focus,Save}, andClientMethodElicitation{Create,Complete}.
Changed
-
KillTerminalCommand→KillTerminalon theClientinterface, plus the request/response type renames. The wire method is unchanged (terminal/kill).// Before func (c *myClient) KillTerminalCommand(ctx context.Context, p acp.KillTerminalCommandRequest) (acp.KillTerminalCommandResponse, error) // After func (c *myClient) KillTerminal(ctx context.Context, p acp.KillTerminalRequest) (acp.KillTerminalResponse, error)
-
FileSystemCapability→FileSystemCapabilitiesto align with the rest of the*Capabilitiestypes.ClientCapabilities.Fsnow uses the new type. -
AuthMethodis now a discriminated union. The previous flat struct is replaced with a wrapper that holds exactly one variant, discriminated by thetypefield on the wire (defaulting toagentwhen absent):// Before AuthMethod{Id: "oauth", Name: "OAuth", Description: acp.Ptr("...")} // After AuthMethod{Agent: &AuthMethodAgent{Id: "oauth", Name: "OAuth", Description: acp.Ptr("...")}}
The other variants (
EnvVar *AuthMethodEnvVarInline,Terminal *AuthMethodTerminalInline) are unstable and let agents advertise env-var or terminal-based authentication flows. -
Capability defaults serialize differently.
ClientCapabilitiesandAgentCapabilitiesnow emit and accept their unstableauthfield by default —"auth":{"terminal":false}for clients and"auth":{}for agents — andClientCapabilities.Fsdefaults to{"readTextFile":false,"writeTextFile":false}. Older peers ignore unknown fields, but anything that does strict JSON schema validation against the previous shape will need to relax it. -
Examples updated.
example/agent,example/client,example/claude-code, andexample/geminiwere ported to the new method names, theAuthMethodunion, and the renamedFileSystemCapabilities. Use them as a reference when migrating.
Removed
UnstableListSessionsRequest,UnstableListSessionsResponse, andAgentExperimental.UnstableListSessions. Migrate to the stableAgent.ListSessionsand unprefixed types.
Breaking Changes
All Agent and Client implementors require source updates:
| Before | After |
|---|---|
Client.KillTerminalCommand |
Client.KillTerminal |
KillTerminalCommandRequest / Response |
KillTerminalRequest / Response |
FileSystemCapability |
FileSystemCapabilities |
AuthMethod{Id, Name, Description} |
AuthMethod{Agent: &AuthMethodAgent{Id, Name, Description}} |
AgentExperimental.UnstableListSessions |
Agent.ListSessions (now required on the stable interface) |
UnstableListSessionsRequest / Response |
ListSessionsRequest / Response |
Additional notes:
- Every
Agentimplementation must now provideListSessions. Returningacp.NewMethodNotFound(acp.AgentMethodSessionList)is fine for agents that don't advertise the capability — seeexample/agent/main.go. - The new unstable methods are dispatched via Go interface assertions in
AgentSideConnection.handle/ClientSideConnection.handle, so you only need to implement the ones you advertise; unimplemented ones returnMethodNotFoundautomatically. - Any code that constructs or pattern-matches
AuthMethoddirectly (including hand-rolled JSON) must move to the union shape. Wire JSON without atypefield is interpreted as theagentvariant.
Full Changelog: v0.10.8...v0.11.7
v0.10.8: Schema 0.10.8, extension methods, and cancellation
Catches the SDK up to ACP schema 0.10.8 (from 0.6.3), adds first-class ACP extension methods, full $/cancel_request cancellation, and an opt-in unstable surface for in-development RPCs. A trio of fixes around notification ordering and request/handler synchronization makes streaming sessions behave correctly under load.
Highlights
- ACP schema 0.10.8 with regenerated types — including typed unstable session selector and capability metadata for clients.
- New extensibility surface:
ExtensionMethodHandlerplusCallExtension/NotifyExtension, andUnstable*types for in-development methods. - Protocol-level cancellation via
$/cancel_request, with per-request contexts and a-32800error mapping. - Notification handling overhauled: in-order delivery, no early returns from
Prompt(), and no nested-request deadlocks.
Added
-
Extension methods (#11 by @ThomasK33). Implement the new optional interface to receive any
_-prefixed JSON-RPC method, and use the helper methods to send them:type ExtensionMethodHandler interface { HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error) } // Outbound (available on both AgentSideConnection and ClientSideConnection): resp, err := acp.CallExtension[MyResp](conn, ctx, "_vendor.example/echo", req) err = conn.NotifyExtension(ctx, "_vendor.example/event", payload)
Unhandled extension requests automatically return
MethodNotFoundper spec; unhandled extension notifications are silently ignored (no more noisy log line). -
Unstable schema support (#17 by @ThomasK33). The generator now also consumes
schema.unstable.json/meta.unstable.jsonand emits unstable-only RPCs and types behind anUnstable*prefix, exposed via the existingAgentExperimental/ClientExperimentalinterfaces. Stable types and method signatures are untouched. -
$/cancel_requestcancellation (#17 by @ThomasK33). Inbound requests now run with a per-requestcontext.Context; receiving$/cancel_requestcancels that context. When an outbound caller'sctxis canceled while waiting for a response, the SDK best-effort sends$/cancel_requestto the peer. Canceled handlers map to JSON-RPC error-32800. -
Typed unstable session metadata (#26 by @carsonfarmer). Clients can now distinguish session config selectors by identity instead of treating them as opaque selects:
SessionConfigOptionSelectexposesid,name, optionaldescription/category,type,currentValue, andoptions.SessionCapabilitiescarries typed unstable markers (fork,list,resume).NewSessionResponseincludes optional typedconfigOptionsandmodels.UnstableResumeSessionResponseincludes typedconfigOptions,models, andmodes.
Changed
- ACP schema bumped 0.6.3 → 0.10.8 (#15, #26 by @ThomasK33, @carsonfarmer). All
*_gen.gofiles are regenerated; expect new methods/types on the stable surface (e.g.SetSessionConfigOption) and updated request/response shapes. Theexample/agent and tests have been updated accordingly — seeexample/agent/main.gofor the minimal stub pattern (return ..., acp.NewMethodNotFound(...)for unsupported optional methods). - Code generator hardening (#15, #17, #26). Handles JSON Schema
allOfwrappers, preserves union variants that wrap$refinallOf, deterministically avoids nested type-name collisions, fixes unionUnmarshalJSONfor unions whose variants can be primitives (notablyRequestId), and propagates shared parent-object fields onto generated union variant structs.
Fixed
Prompt()returning beforeSessionUpdatehandlers complete (#5 by @midsbie).SendRequest/SendRequestNoResultnow wait for in-flight notification handlers before returning, so callers consistently observe all session updates that arrived before the response.- Out-of-order notifications (#8 by @krulsaidme0w). Notifications are queued and processed by a single goroutine, preserving wire order for streaming
session/updatetraffic. Public API unchanged. - Deadlock on nested requests from a handler (#10 by @agentcooper, fixes #9). The notification
WaitGroupno longer tracks request messages, so a handler can issue requests back to its peer without blocking forever.
Breaking Changes
The schema jump from 0.6.3 to 0.10.8 changes generated APIs. Most notably, the stable Agent interface gained methods such as SetSessionConfigOption, and a number of request/response struct shapes evolved with the protocol. Implementors of Agent / Client should regenerate against this release and add stubs (returning acp.NewMethodNotFound(...) is fine for optional methods, as shown in example/agent/main.go). Direct field-by-field migration guidance is best derived from the regenerated *_gen.go diffs.
New Contributors
- @midsbie made their first contribution in #5
- @agentcooper made their first contribution in #10
- @krulsaidme0w made their first contribution in #8
- @carsonfarmer made their first contribution in #26
Full Changelog: v0.6.3...v0.10.8
v0.6.3: Schema 0.6.3 alignment and friendlier generated types
Tracks ACP schema 0.6.3 (up from 0.4.9). The code generator gains JSON Schema discriminator support, smarter nested-type naming, and multi-line doc comments — which together rename a handful of generated types and reshape how callers build RequestPermissionRequest and McpServer values.
Added
Implementationmetadata on initialize.InitializeRequestgained an optionalClientInfo *ImplementationandInitializeResponsegained an optionalAgentInfo *Implementation, carryingname, optionaltitle, andversion. The schema notes these will become required in a future protocol revision, so populating them now is recommended (#3 by @ThomasK33):resp, err := conn.Initialize(ctx, acp.InitializeRequest{ ProtocolVersion: acp.ProtocolVersionNumber, ClientInfo: &acp.Implementation{ Name: "my-editor", Title: acp.Ptr("My Editor"), Version: "1.2.3", }, })
- JSON-RPC envelope and error types. New generated
AgentOutgoingMessage/ClientOutgoingMessage(withRequest/Response/Notificationvariants) and anErrorstruct mirroring the JSON-RPC 2.0 error object (#3). - Discriminator-aware codegen. The generator now honors explicit
discriminator: { propertyName: "type" }annotations on schema unions likeContentBlockandMcpServer, falling back to the previous const-property scan only when none is declared. Inline variants are also given idiomatic names via word-boundary heuristics — e.g.RequestPermissionRequest+toolCall→RequestPermissionToolCallinstead ofRequestPermissionRequestToolCall(#3).
Changed
- Schema bumped to 0.6.3.
schema/versionand the SDKversionare now0.6.3. - Doc comments preserve formatting.
cmd/generatereplaces the oldSanitizeCommentcollapser withFormatDocComment, which keeps newlines and paragraph breaks from JSON Schema descriptions. Generated godoc on types likeContentBlock,Agent, andClientis now multi-line and noticeably easier to read. - Generated type renames. A few inline-variant types now have shorter, more idiomatic names (see Breaking Changes below).
ResourceBlockhelper signature.ResourceBlock(EmbeddedResource)→ResourceBlock(EmbeddedResourceResource). Callers no longer need to wrap the resource:// Before acp.ResourceBlock(acp.EmbeddedResource{Resource: res}) // After acp.ResourceBlock(res)
ContentBlockTextdoc clarifies that text content may be Markdown and clients SHOULD render it as such.
Breaking Changes
Code that referenced the old generated names or constructed RequestPermissionRequest / McpServer literals must be updated:
| Before | After |
|---|---|
RequestPermissionRequest{ ToolCall: ToolCallUpdate{...} } |
RequestPermissionRequest{ ToolCall: RequestPermissionToolCall{...} } |
SessionUpdate{ ToolCallUpdate: &SessionUpdateToolCallUpdate{...} } |
SessionUpdate{ ToolCallUpdate: &SessionToolCallUpdate{...} } |
McpServer{ Stdio: &Stdio{...} } |
McpServer{ Stdio: &McpServerStdio{...} } |
ResourceBlock(EmbeddedResource{Resource: res}) |
ResourceBlock(res) (where res is EmbeddedResourceResource) |
The custom ToolCallUpdateOpt callbacks now receive *SessionToolCallUpdate; recompiling against the new types is sufficient if you used the provided WithUpdate* helpers.
Full Changelog: v0.4.9...v0.6.3
v0.4.9: Schema 0.4.9 with documented generated APIs
Tracks ACP schema 0.4.9. The Go protocol surface is unchanged — this release is a documentation refresh of the generated bindings and a schema-source switch to upstream release artifacts. No code changes are required to upgrade.
Changed
-
Generated APIs are now documented from the schema (#2 by @ThomasK33). The code generator now emits godoc comments derived from
schema.jsondescriptions onto:- methods of the
Agent,AgentLoader,AgentExperimental, andClientinterfaces, and - variant fields of union wrappers such as
AgentRequest,ClientRequest,AgentNotification,ClientNotification,ContentBlock,McpServer,SessionUpdate,ToolCallContent,RequestPermissionOutcome, andAvailableCommandInput.
These comments include links to the protocol docs (e.g. Initialization, Prompt Turn, Terminals, Session Modes) and surface capability gating notes (e.g. that
terminal/*requires theterminalclient capability, thatLoadSessionrequires theloadSessionagent capability, or thatSetSessionModelis UNSTABLE) directly in IDE hovers andgo docoutput. Example:type Agent interface { // Request parameters for the initialize method. Sent by the client to // establish connection and negotiate capabilities. // See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization) Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error) // ... }
- methods of the
-
Schema artifacts fetched from GitHub Releases. The
Makefilenow downloadsschema/meta.jsonandschema/schema.jsonfrom the upstreamagent-client-protocolGitHub Releases assets instead of the raw tag URLs. This only affects contributors regenerating bindings locally; SDK consumers are unaffected. -
Schema and module version bumped from
0.4.5to0.4.9. There are no breaking changes — theAgent,AgentLoader,AgentExperimental, andClientinterface signatures, and all generated request/response types, are identical to v0.4.5.
Full Changelog: v0.4.5...v0.4.9
v0.4.5: ACP schema 0.4.5 alignment
Tracks ACP schema 0.4.5. The only Go-visible change is a rename of the session/set_model method constant to align with the schema's naming; the wire protocol is unchanged.
Changed
- Schema bumped to 0.4.5 with regenerated bindings (#1 by @ThomasK33).
- The generated agent method constant was renamed from
AgentMethodModelSelecttoAgentMethodSessionSetModelso its identifier matches thesession_set_modelschema key. The underlying JSON-RPC method string is still"session/set_model", so peers on the wire are unaffected. - Schema source and documentation links now point at the protocol's new home,
agentclientprotocol/agent-client-protocol(previouslyzed-industries/agent-client-protocol). This affects theMakefilefetch URLs andREADME.md/RELEASING.mdreferences.
AgentExperimental.SetSessionModel and ClientSideConnection.SetSessionModel continue to work as before — only the constant identifier changed.
Breaking Changes
Callers that referenced the constant directly need a one-line rename:
// before
conn.SendRequest(ctx, acp.AgentMethodModelSelect, params)
// after
conn.SendRequest(ctx, acp.AgentMethodSessionSetModel, params)No changes are required for code that calls SetSessionModel through the typed client/agent interfaces.
New Contributors
- @ThomasK33 made their first contribution in #1
Full Changelog: v0.4.4...v0.4.5
v0.4.4: Schema 0.4.4 alignment
A version-only release that aligns the SDK with ACP schema tag 0.4.4. There are no generated API changes, no behavior changes, and no migration steps for SDK users.
Changed
- Updated
schema/versionandversionto0.4.4and refreshed the README install command togo get github.com/coder/acp-go-sdk@v0.4.4(4959964).
Full Changelog: v0.4.3...v0.4.4
v0.4.3: Initial release
First public release of github.com/coder/acp-go-sdk, the Go SDK for the Agent Client Protocol. This release tracks ACP schema v0.4.3 and provides everything needed to build ACP agents and clients in Go over stdio.
go get github.com/coder/acp-go-sdk@v0.4.3Added
Core API
- Agent side: implement
acp.Agent(and optionallyacp.AgentLoaderforsession/load), then wire it up withacp.NewAgentSideConnection(agent, os.Stdout, os.Stdin). - Client side: implement
acp.Client(and optionallyacp.ClientTerminalfor terminal features), then callacp.NewClientSideConnection(client, stdin, stdout)and drive a turn viaInitialize→NewSession→Prompt. - Both connection types expose
Done()for peer-disconnect signalling andSetLogger(*slog.Logger)for diagnostics. RequestErrorand JSON-RPC error helpers inerrors.gofor returning structured failures from handlers.
Generated protocol bindings
Generated from ACP schema v0.4.3 into agent_gen.go, client_gen.go, types_gen.go, constants_gen.go, and helpers_gen.go. These cover the full request/response/notification surface — Initialize, NewSession, LoadSession, Authenticate, Prompt, Cancel, WriteTextFile, ReadTextFile, RequestPermission, SessionUpdate, and the terminal methods (CreateTerminal, KillTerminalCommand, ReleaseTerminal, TerminalOutput, WaitForTerminalExit).
Helper constructors
Reduce the boilerplate of building ACP union types by hand:
- Content blocks:
TextBlock,ImageBlock,AudioBlock,ResourceLinkBlock,ResourceBlock. - Tool-call content:
ToolContent,ToolDiffContent,ToolTerminalRef. - Session updates:
UpdateUserMessageText,UpdateAgentMessageText,UpdateAgentThoughtText,UpdatePlan,StartToolCall/UpdateToolCall(withWithStart*/WithUpdate*option funcs), and the convenience wrappersStartReadToolCall/StartEditToolCall. - Generic
Ptr[T](v T) *Tfor optional fields.
update := acp.StartReadToolCall("tool-1", "Read file", "/etc/hosts")
_ = conn.SessionUpdate(ctx, acp.SessionNotification{SessionId: id, Update: update})Examples
Runnable examples under example/ that double as integration smoke tests:
go run ./example/agent— a minimal ACP agent over stdio.go run ./example/client— drives a sample turn against a running agent.go run ./example/claude-code— bridges to Claude Code.go run ./example/gemini— bridges to the Gemini CLI in ACP mode (-model,-sandbox,-debug,-gemini /path/to/gemini).
Tooling
cmd/generateregenerates the_gen.gobindings fromschema/schema.jsonandschema/meta.json.- JSON golden fixtures in
testdata/json_golden/and a parity test (json_parity_test.go) that locks wire-format compatibility with the reference TypeScript implementation. - Nix flake plus
maketargets for reproducible work:make version(bump and regenerate fromschema/version),make test,make fmt,make check, andmake release VERSION=X.Y.Zfor a guided release flow.
Full Changelog: https://github.com/coder/acp-go-sdk/commits/v0.4.3