[go] Honor ClientOptions.UseStdio = false#296
Merged
friggeri merged 3 commits intogithub:mainfrom Jan 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Go SDK client initialization so ClientOptions.UseStdio = false is explicitly representable and results in spawning the CLI server and communicating over TCP (instead of stdio).
Changes:
- Change
ClientOptions.UseStdiofromboolto*boolto distinguish “unset” from an explicitfalse. - Add
Client.useStdioas the resolved transport mode and use it when starting/connecting to the CLI server. - Update unit/e2e tests to use
Bool(true/false)and validate the resolved transport mode.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| go/types.go | Makes UseStdio tri-state (*bool) to allow honoring explicit false without breaking defaults. |
| go/client.go | Resolves transport mode into Client.useStdio and switches startup/connection logic to use it. |
| go/client_test.go | Updates URL parsing / option resolution assertions to use client.useStdio and adds new cases. |
| go/e2e/client_test.go | Updates e2e client construction to use Bool(...) for UseStdio. |
Comments suppressed due to low confidence (1)
go/client.go:153
- Option precedence changed:
options.Port > 0forces TCP (client.useStdio = false), but a lateroptions.UseStdio != nilassignment can flip it back to stdio, leavingPortset but unused. Either validate this as an invalid combination (Port with UseStdio=true) or enforce a deterministic precedence (e.g., Port always implies TCP).
if options.Port > 0 {
opts.Port = options.Port
// If port is specified, switch to TCP mode
client.useStdio = false
}
if options.LogLevel != "" {
opts.LogLevel = options.LogLevel
}
if len(options.Env) > 0 {
opts.Env = options.Env
}
if options.UseStdio != nil {
client.useStdio = *options.UseStdio
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
friggeri
approved these changes
Jan 30, 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.
copilot.ClientOptions{UseStdio: false}should create a client that starts a CLI server and talks to it via TCP instead of stdio.