Skip to content

Redesign process transport options for v2 - #2536

Draft
SteveSandersonMS wants to merge 1 commit into
mainfrom
copilot-sdk-2523-process-transport
Draft

Redesign process transport options for v2#2536
SteveSandersonMS wants to merge 1 commit into
mainfrom
copilot-sdk-2523-process-transport

Conversation

@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Summary

Closes #2523.

This PR implements the v2 process/transport configuration boundary across SDKs by moving SDK-managed process launch settings off shared client options and onto the out-of-process runtime connection/transport APIs that actually spawn a runtime process.

Current-main findings

Before editing, I refreshed and inspected the latest origin/main and the issue context from #2523, parent #2522, superseded tracker #1934, and linked historical issues/PRs. Current main already contains the compatible in-process groundwork from #1930/#1976 for many first-class options, but the client-wide process launch APIs remained present and could still be configured for transports where they are inapplicable. This PR carries forward the remaining maintainer-intended v2 cleanup from #1934/#2523 rather than treating it as optional design exploration.

Breaking changes and migration

  • .NET: removed CopilotClientOptions.WorkingDirectory and CopilotClientOptions.Environment; moved them to stdio/TCP out-of-process runtime connections. Renamed ChildProcessRuntimeConnection to OutOfProcessRuntimeConnection.
  • Go: removed ClientOptions.WorkingDirectory and ClientOptions.Env; moved them to StdioConnection and TCPConnection. The unexported child-process helper is renamed to out-of-process terminology.
  • Java: removed CopilotClientOptions.cwd/setCwd and CopilotClientOptions.environment/setEnvironment; moved them to StdioRuntimeConnection and TcpRuntimeConnection as workingDirectory and environment. Java has no shared child-process base class, so this intentionally uses the two concrete out-of-process connection types.
  • Node.js: removed client-wide workingDirectory and env; moved them to the renamed OutOfProcessRuntimeConnection base used by stdio/TCP connections. Renamed ChildProcessRuntimeConnection accordingly.
  • Python: removed client-wide working_directory and env; moved them to the renamed OutOfProcessRuntimeConnection base used by stdio/TCP connections. Renamed ChildProcessRuntimeConnection accordingly.
  • Rust: moved program, prefix/raw args, extra_args, working_directory, env, and env_remove from ClientOptions to OutOfProcessOptions carried by the process-spawning transport variants. Transport::External does not expose process launch options because the SDK does not own that process.

The changelog and SDK READMEs include before/after examples for the migration path.

Runtime follow-up

The SDK-side API cleanup is implemented here. Runtime-side per-client host environment consumption remains tracked separately in #2533, the consolidated follow-up for runtime work required by #2523. This PR does not embed or acquire runtime artifacts and does not take lifecycle/SQLite work from #2524/#2525.

Validation

  • Refreshed latest origin/main before final rebase.
  • Confirmed there are no remaining cross-SDK source references to the removed client-level cwd/environment APIs (getCwd, setCwd, .cwd, CopilotClientOptions.environment, getEnvironment, setEnvironment) after the migration.
  • Earlier Java validation during implementation completed ./mvnw test-compile jar:jar, ./mvnw -pl sdk verify -Dskip.test.harness=true, and ./mvnw -pl sdk spotless:check for the environment-only phase. The follow-up cwd/full cross-SDK validation is intentionally left to CI because local E2E/Maven runs were prohibitively expensive in this sandbox.

@SteveSandersonMS SteveSandersonMS added the sdk-v2 Work planned for Copilot SDK v2 label Sep 4, 2026
@SteveSandersonMS
SteveSandersonMS force-pushed the copilot-sdk-2523-process-transport branch from d37b73a to e16c5cd Compare September 4, 2026 16:33
Move process-scoped launch settings from shared client options onto the out-of-process runtime connections across SDKs. Update docs, changelog migration notes, tests, and snapshots for the new v2 API boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SteveSandersonMS
SteveSandersonMS force-pushed the copilot-sdk-2523-process-transport branch from e16c5cd to 2d358e0 Compare September 4, 2026 16:39
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review — PR #2536

Summary: This PR extends the "process-scoped options moved onto out-of-process connections" refactor (originally landed for Node.js and Java in #2523) to the remaining four SDKs: .NET, Go, Python, and Rust. I compared the changes against the existing Node.js/Java implementations and found the migration to be consistent and well-executed.

What was checked

  • dotnet/src/Client.cs, dotnet/src/Types.cs: ChildProcessRuntimeConnectionOutOfProcessRuntimeConnection, WorkingDirectory/Environment moved off CopilotClientOptions onto the connection types. Matches the naming and shape already used in Node.js (OutOfProcessRuntimeConnection in nodejs/src/types.ts) and Java (StdioRuntimeConnection/TcpRuntimeConnection).
  • go/client.go: unexported childProcessConnectionoutOfProcessConnection, WorkingDirectory/Env moved from ClientOptions onto StdioConnection/TCPConnection. Consistent with the pattern (Go uses exported struct fields per convention).
  • python/copilot/client.py + e2e harness: working_directory/env moved from CopilotClient(...) kwargs onto RuntimeConnection.for_stdio()/for_tcp(), renamed base to OutOfProcessRuntimeConnection. Matches Python's snake_case convention and the Node.js/.NET semantics.
  • rust/src/lib.rs: new OutOfProcessOptions struct carried by Transport::Stdio/Transport::Tcp variants, replacing scattered fields (program, prefix_args, working_directory, env, env_remove, extra_args) on the shared ClientOptions. This is Rust's idiomatic equivalent (per-transport-variant options) of the same concept, and also fixes a genuine pre-existing bug (env now replaces instead of merging into the inherited environment, matching every other SDK's semantics) — a good non-scope-creep fix bundled with the mechanical rename.
  • Validation logic (ValidateTransportOptions/validateTransportOptions) was simplified consistently in .NET and Go now that in-process transport structurally cannot receive process-scoped settings (they no longer exist on the shared options type), removing now-impossible-to-hit checks in both.
  • E2E tests, test harnesses, and CHANGELOG entries were updated in lockstep across all four languages, including a new snapshot (should_use_outofprocess_connection_workingdirectory.yaml) replacing the older should_use_client_cwd_for_default_workingdirectory.yaml, plus a new snapshot for MCP sampling error reporting (should_report_failure_or_implemented_error_for_missing_mcp_sampling.yaml).

Findings

No cross-SDK inconsistencies found. Node.js and Java already had this design from #2523; this PR brings .NET, Go, Python, and Rust to parity with matching naming conventions per language idiom (PascalCase for .NET/Go, snake_case for Python/Rust, with Rust's per-variant OutOfProcessOptions being an appropriate idiomatic divergence rather than a gap). The CHANGELOG documents the breaking change and migration path per language, consistent with the project's practice for prior breaking changes.

No further action needed from a consistency standpoint. Nice work keeping all six SDKs aligned on this API surface.

Generated by SDK Consistency Review Agent for #2536 · copilot · sonnet50 · 79.4 AIC · ⌖ 12.3 AIC · ⊞ 9.7K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-v2 Work planned for Copilot SDK v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] Redesign process and transport configuration APIs

1 participant