github coder/acp-go-sdk v0.11.7
v0.11.7: Schema 0.11.7 — list_sessions stabilized, AuthMethod union, terminal/kill rename

latest releases: v0.13.5, v0.13.4, v0.13.0...
3 months ago

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.ListSessions is now stable (#29 by @ThomasK33). The previously unstable session/list method is now part of the stable Agent interface, with stable ListSessionsRequest / ListSessionsResponse types and a stable ClientSideConnection.ListSessions caller.

    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 in AgentSideConnection.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.
  • New unstable client method for agent-driven UI prompts: Client.UnstableCreateElicitation (request) and Client.UnstableCompleteElicitation (notification). The request is a form/url union; the response is an accept/decline/cancel union with helper constructors (NewUnstableCreateElicitationResponseAccept, etc.).

  • New capability descriptors advertised in InitializeResponse / ClientCapabilities: AgentAuthCapabilities, LogoutCapabilities, ProvidersCapabilities, NesCapabilities and the full Nes*Capabilities family, ClientNesCapabilities, ElicitationCapabilities, plus a client-side AuthCapabilities (with a terminal flag).

  • 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}, and ClientMethodElicitation{Create,Complete}.

Changed

  • KillTerminalCommandKillTerminal on the Client interface, 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)
  • FileSystemCapabilityFileSystemCapabilities to align with the rest of the *Capabilities types. ClientCapabilities.Fs now uses the new type.

  • AuthMethod is now a discriminated union. The previous flat struct is replaced with a wrapper that holds exactly one variant, discriminated by the type field on the wire (defaulting to agent when 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. ClientCapabilities and AgentCapabilities now emit and accept their unstable auth field by default — "auth":{"terminal":false} for clients and "auth":{} for agents — and ClientCapabilities.Fs defaults 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, and example/gemini were ported to the new method names, the AuthMethod union, and the renamed FileSystemCapabilities. Use them as a reference when migrating.

Removed

  • UnstableListSessionsRequest, UnstableListSessionsResponse, and AgentExperimental.UnstableListSessions. Migrate to the stable Agent.ListSessions and 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 Agent implementation must now provide ListSessions. Returning acp.NewMethodNotFound(acp.AgentMethodSessionList) is fine for agents that don't advertise the capability — see example/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 return MethodNotFound automatically.
  • Any code that constructs or pattern-matches AuthMethod directly (including hand-rolled JSON) must move to the union shape. Wire JSON without a type field is interpreted as the agent variant.

Full Changelog: v0.10.8...v0.11.7

Don't miss a new acp-go-sdk release

NewReleases is sending notifications on new releases.