github coder/acp-go-sdk v0.13.5
v0.13.5: Session config options take over model selection

14 days ago

Tracks ACP schema 0.13.5. The never-stabilized session/set_model API is gone — model selection now flows through the existing stable session/set_config_option framework — and additionalDirectories graduates to the stable surface across the session lifecycle.

Added

Stable additionalDirectories on session requests (#47 by @ThomasK33)

Sessions can now declare extra workspace roots alongside cwd. The field is present (and stable) on NewSessionRequest, LoadSessionRequest, ResumeSessionRequest, UnstableForkSessionRequest, and is reported back on SessionInfo from session/list:

req := acp.NewSessionRequest{
    Cwd:                   "/home/me/project",
    AdditionalDirectories: []string{"/home/me/shared-libs"},
    McpServers:            []acp.McpServer{ /* ... */ },
}

Agents advertise support via a new capability — supplying {} is enough:

caps := acp.SessionCapabilities{
    AdditionalDirectories: &acp.SessionAdditionalDirectoriesCapabilities{},
}

Previously this field existed only on the unstable fork-session path; it is now on the stable surface and reported on listed sessions.

Removed

Unstable session/set_model API (#47 by @ThomasK33)

The experimental model-selection API has been removed from the schema and the SDK. Gone:

  • UnstableSetSessionModelRequest / UnstableSetSessionModelResponse
  • ClientSideConnection.UnstableSetSessionModel
  • AgentExperimental.UnstableSetSessionModel
  • AgentMethodSessionSetModel ("session/set_model")
  • ModelId, ModelInfo, SessionModelState, and the models field on NewSessionResponse / LoadSessionResponse / UnstableForkSessionResponse

Because this surface was only ever in schema.unstable.json, no stable types break. Anything implementing or calling UnstableSetSessionModel* will need to migrate.

Migration: use session config options. Model selection is now expressed as a SessionConfigOption with category == SessionConfigOptionCategoryModel (introduced in 0.13.4 and unchanged here):

  1. Read agent-advertised configOptions from the session response and pick the one whose category is "model".
  2. Switch models by calling the stable session/set_config_option:
    _, err := client.SetSessionConfigOption(ctx, acp.SetSessionConfigOptionRequest{
        SessionId: sid,
        ConfigId:  modelOption.Id,
        Value:     acp.NewSessionConfigOptionValueSelect("gpt-5"),
    })
  3. Updated options arrive back in the response and through session/update config_option_update notifications.

The same uniform API now covers model, mode, and thought_level selection. Calls to session/set_model on the wire return -32601 Method not found.

Changed

More tolerant deserialization in generated types (#47 by @ThomasK33)

Regenerated bindings pick up the schema's new x-deserialize-default-on-error and x-deserialize-skip-invalid-items hints across many optional fields and arrays (auth methods, available commands, session lists, plan entries, tool-call content/locations, NES context, and more). In practice, unrecognized enum values or malformed individual items in these spots fall back to defaults / get skipped instead of failing the entire UnmarshalJSON, making peers more forgiving across protocol drift.

Example and test fixtures updated

example/agent/main.go and acp_test.go had their UnstableSetSessionModel implementations removed to match the regenerated AgentExperimental surface.

Breaking Changes

  • The unstable UnstableSetSessionModel* symbols and AgentMethodSessionSetModel have been removed. Implementations of AgentExperimental that defined UnstableSetSessionModel should delete that method; callers of ClientSideConnection.UnstableSetSessionModel should migrate to SetSessionConfigOption with SessionConfigOptionCategoryModel. No stable APIs are affected.

Full Changelog: v0.13.4...v0.13.5

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

NewReleases is sending notifications on new releases.