Consolidate Go initialism casing#1527
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 standardizes Go identifier casing to follow Go initialism conventions (e.g., MCP, RPC, SDK, GitHub, URL, FS) across the code generator, generated RPC bindings, SDK types, and tests.
Changes:
- Updated Go codegen casing rules (initialisms + explicit overrides like
GitHub) and regenerated code accordingly. - Renamed many exported Go SDK/RPC symbols to initialism-correct forms (e.g.,
SessionFS,ServerRPC,UIInputOptions,SDKProtocolVersion). - Updated unit and E2E tests plus documentation to match the new exported names.
Show a summary per file
| File | Description |
|---|---|
| scripts/codegen/go.ts | Enhances identifier casing logic (initialisms + overrides) to drive consistent Go symbol generation. |
| go/types.go | Renames exported SDK types/fields to initialism-correct forms (e.g., SessionFS, MIMEType, UIInputOptions). |
| go/client.go | Updates client wiring to new RPC/type names and new Session FS registration types. |
| go/session_fs_provider.go | Renames FS provider interfaces/types to SessionFS* and updates RPC handler adapter signatures. |
| go/rpc/z*.go | Regenerates RPC types/encoding to match new casing (MCP*, GitHub*, URLs, etc.). |
| go/.go tests + go/internal/e2e/ | Renames tests/usages to match new exported symbols and RPC shape changes. |
| go/README.md + docs/setup/multi-tenancy.md | Updates docs to reflect renamed exported API surfaces. |
Copilot's findings
Comments suppressed due to low confidence (3)
go/types.go:1
- Renaming exported fields/types (e.g.,
ClientOptions.SessionFs→SessionFS) is a breaking change for SDK consumers. If backward compatibility is required, consider providing a compatibility shim (mandatory if the Go SDK API is expected to be stable): keep the oldSessionFsfield as deprecated and map it internally toSessionFS, and add type aliases for renamed exported types where possible (e.g.,type SessionFsConfig = SessionFSConfig).
go/types.go:1 - Renaming exported fields/types (e.g.,
ClientOptions.SessionFs→SessionFS) is a breaking change for SDK consumers. If backward compatibility is required, consider providing a compatibility shim (mandatory if the Go SDK API is expected to be stable): keep the oldSessionFsfield as deprecated and map it internally toSessionFS, and add type aliases for renamed exported types where possible (e.g.,type SessionFsConfig = SessionFSConfig).
go/sdk_protocol_version.go:1 - Renaming exported symbols
SdkProtocolVersion/GetSdkProtocolVersiontoSDKProtocolVersion/GetSDKProtocolVersionis a breaking API change. To preserve source compatibility, consider adding deprecated wrappers/aliases (e.g., an exportedconst SdkProtocolVersion = SDKProtocolVersionandfunc GetSdkProtocolVersion() int { return GetSDKProtocolVersion() }) while keeping the new names as the preferred API.
- Files reviewed: 46/47 changed files
- Comments generated: 2
stephentoub
approved these changes
Jun 1, 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
Consolidates Go identifier initialism casing across the Go code generator, generated RPC/session types, public Go SDK APIs, docs, and tests so the SDK uses one idiomatic naming path. The generator now routes Go identifier words through a shared helper, adds plural casing overrides, and aligns hand-written connection APIs with the same casing.
Initialism changes
Api->APIfor generated API wrapper types, fields, and registration helpers.Rpc->RPCfor generated RPC wrapper types, constructors, and session fields.Mcp->MCPfor MCP-related generated types, events, hooks, config fields, permissions, and tool helpers.Sse->SSEfor SSE transport enum names.Ado->ADOfor ADO working-directory host type enum names.Sdk->SDKfor SDK protocol version and extension SDK path symbols.Fs->FSfor session filesystem provider/config/adapter/error/RPC types.Url/Urls->URL/URLsfor URL-bearing generated identifiers.Uri/Uris->URI/URIs, includingUriConnection->URIConnection.Id/Ids->ID/IDsthrough the shared helper and plural override.Tcp->TCP, includingTcpConnection->TCPConnection.CLI,HMAC, andUTCso future generated names use idiomatic Go casing.Validation
Ran
npm run generate:goandgit diff --check. Tests not run, per request.