Refine Go SDK pre-GA API surfaces#1549
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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. URL → url, not uRL).
Changes:
- Introduce
ElicitationAction,ElicitationSchema, andElicitationFieldValuetypes and use them across the SDK, tests, and docs. - Switch
MCPStdioServerConfig.Tools/Args/EnvandMCPHTTPServerConfig.Tools/Headersfrom pointer/omitemptyto value/omitzero, and makeModelLimits.MaxContextWindowTokensa*int. - Add
toGoUnexportedIdentifiercodegen 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
stephentoub
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaking changes
Validation