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