Skip to content

Refine Go SDK pre-GA API surfaces#1549

Merged
SteveSandersonMS merged 2 commits into
github:mainfrom
qmuntal:go-api-pre-ga-cleanup
Jun 2, 2026
Merged

Refine Go SDK pre-GA API surfaces#1549
SteveSandersonMS merged 2 commits into
github:mainfrom
qmuntal:go-api-pre-ga-cleanup

Conversation

@qmuntal
Copy link
Copy Markdown
Contributor

@qmuntal qmuntal commented Jun 2, 2026

Summary

  • refine Go SDK public API shapes for MCP server config, elicitation callbacks, and BYOK model listing
  • update generated Go RPC marker casing for initialisms such as MCP/UI
  • refresh Go docs and tests for the adjusted surfaces

Breaking changes

  • Go: ModelLimits.MaxContextWindowTokens is now optional (*int). Use copilot.Int(value) when constructing ModelInfo values for custom model listing handlers.

Validation

  • go test . -run TestSession_ElicitationRequestSchema
  • go test ./... -run '^$'

Copilot AI review requested due to automatic review settings June 2, 2026 10:26
@qmuntal qmuntal requested a review from a team as a code owner June 2, 2026 10:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR strengthens the Go SDK's type model around elicitation and MCP server configuration, replacing loosely-typed map[string]any / string / *[]string shapes with named types and aliases. It also adds a codegen helper for producing Go unexported identifiers that correctly preserve initialism casing (e.g. URLurl, not uRL).

Changes:

  • Introduce ElicitationAction, ElicitationSchema, and ElicitationFieldValue types and use them across the SDK, tests, and docs.
  • Switch MCPStdioServerConfig.Tools / Args / Env and MCPHTTPServerConfig.Tools / Headers from pointer/omitempty to value/omitzero, and make ModelLimits.MaxContextWindowTokens a *int.
  • Add toGoUnexportedIdentifier codegen helper handling initialisms and casing overrides.
Show a summary per file
File Description
scripts/codegen/go.ts New helper for unexported identifiers; used for marker names in union emitters.
go/types.go New elicitation types/aliases; reshape MCP config and ModelLimits fields.
go/session.go Use new elicitation types; convert ElicitationSchema ↔ RPC schema; tighten toRPCContent nil handling.
go/types_test.go, go/session_test.go, go/client_test.go Update tests to new types and add schema-conversion test.
go/internal/e2e/*.go Update e2e tests to new Tools []string and ElicitationAction* constants.
go/README.md, docs/features/mcp.md, docs/auth/byok.md Update docs to new APIs.

Copilot's findings

Files not reviewed (1)
  • go/rpc/zrpc.go: Language not supported
  • Files reviewed: 14/15 changed files
  • Comments generated: 5

Comment thread go/session.go
Comment thread go/session.go
Comment thread go/types.go
Comment thread go/types.go
Comment thread go/types.go
@SteveSandersonMS SteveSandersonMS added this pull request to the merge queue Jun 2, 2026
Merged via the queue into github:main with commit 3eaccba Jun 2, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants