Skip to content

[go] Honor ClientOptions.UseStdio = false#296

Merged
friggeri merged 3 commits intogithub:mainfrom
qmuntal:dev/qmuntal/usestdio
Jan 30, 2026
Merged

[go] Honor ClientOptions.UseStdio = false#296
friggeri merged 3 commits intogithub:mainfrom
qmuntal:dev/qmuntal/usestdio

Conversation

@qmuntal
Copy link
Contributor

@qmuntal qmuntal commented Jan 30, 2026

copilot.ClientOptions{UseStdio: false} should create a client that starts a CLI server and talks to it via TCP instead of stdio.

@qmuntal qmuntal requested a review from a team as a code owner January 30, 2026 14:36
Copilot AI review requested due to automatic review settings January 30, 2026 14:36
Copy link
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

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.UseStdio from bool to *bool to distinguish “unset” from an explicit false.
  • Add Client.useStdio as 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 > 0 forces TCP (client.useStdio = false), but a later options.UseStdio != nil assignment can flip it back to stdio, leaving Port set 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.

qmuntal and others added 2 commits January 30, 2026 16:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@friggeri friggeri added this pull request to the merge queue Jan 30, 2026
Merged via the queue into github:main with commit 82dbb15 Jan 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants