Skip to content

Version-independent SDK test and codegen fixes split from the 1.0.76-0 bump - #2110

Merged
stephentoub merged 5 commits into
mainfrom
sdk-fixes-independent-of-cli-bump
Jul 28, 2026
Merged

Version-independent SDK test and codegen fixes split from the 1.0.76-0 bump#2110
stephentoub merged 5 commits into
mainfrom
sdk-fixes-independent-of-cli-bump

Conversation

@stephentoub

Copy link
Copy Markdown
Collaborator

Summary

  • emit Rust type aliases for scalar RPC result schemas
  • close the Go and .NET shell-test session teardown gap
  • remove the unsupported Rust raw-RPC session.mcp.registerExternalClient e2e coverage
  • bound Python tests with a five-minute per-test timeout

These version-independent fixes were split from #2100 so they can land separately from the automated @github/copilot 1.0.76-0 dependency bump.

Validation

  • regenerated Rust output matches the committed generated files
  • cargo check --tests --features test-support

Generated by Copilot

stephentoub and others added 4 commits July 28, 2026 12:04
pytest-timeout has been a declared dev dependency for a while but was never
configured, and the Python job sets no timeout-minutes either. When CLI 1.0.76-0
introduced a session.destroy deadlock, five of the six Python jobs sat
in_progress for hours instead of failing, producing no diagnostic signal at all
and holding runners until GitHub's 6-hour job limit.

Setting timeout = 300 makes a deadlocked test fail in five minutes with a full
stack dump pointing at the blocked call, which is how the other SDKs already
behave (Node uses 30s/60s/180s per test, Go bounds the package at 20m).

The value is deliberately generous: the whole Python suite completes in about
10 minutes, so no individual test comes close to 300s. Verified locally that
pytest honours the setting from pyproject.toml and that it interrupts a hanging
test with a traceback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a
(cherry picked from commit c33d8e2)
The "should kill shell process" e2e test exists in all five SDKs, but only
Node, Python and Rust destroy the session at the end of it. Go tears the whole
client down with client.ForceStop() and .NET simply ended at the last assert,
so neither ever exercised session.destroy after a session.shell.exec.

That gap is why Go and .NET stayed green on CLI 1.0.76-0 while Node, Python and
Rust hang: the hang is in session.destroy after a shell exec, and the two green
SDKs never made the call. Adding the teardown makes all five cover the same
sequence.

Verified locally against the same CLI binary (1.0.76-0, sha256 b8bfad2c...):
with the added Disconnect(), the Go test hangs past a 3-minute timeout where it
previously passed in seconds. The same test passes on CLI 1.0.73.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a
(cherry picked from commit 2e54b47)
The runtime team confirmed this method is marked `visibility: internal` in the
shared API contract: its `client` and `transport` fields are live in-process MCP
SDK instances that cannot be serialized over JSON-RPC. No SDK exposes it as a
typed method, and the Rust test drove it through a raw `call_session_rpc` with
placeholder JSON objects that could never satisfy that contract.

It passed on CLI 1.0.73 only because the old TypeScript dispatch happened to
route internal methods generically. 1.0.76-0 routes the method through the Rust
native registry, where the host-effect switch has no case for it, so it now
returns -32603 "Unsupported native session host effect". That is correct
behaviour, not a regression, so the test is removed along with its now-orphaned
snapshot and a note recording why the gap is deliberate.

Both `call_session_rpc` and `is_mcp_server_running` remain in use by other tests
in the file, so no helper became dead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a
(cherry picked from commit f0c846c)
The Rust codegen only emitted a named type for result schemas that were an
enum, array, map, or object. A method whose result is an inline primitive
(e.g. {"type":"integer"}) produced a reference to a type that was never
defined, so the generated crate failed to compile with E0425.

No RPC method had a primitive result until session.cancelAllBackgroundAgents
was added, so this latent gap only surfaces on a schema update. Add
rustScalarType()/emitRustScalarAlias() so scalar results emit a plain type
alias alongside the existing shapes.

This is a no-op against the current pinned schema and prevents the next
dependency bump from hitting the same build break.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e615d062-bcb7-431e-aa9c-d3e47405723a
Copilot AI review requested due to automatic review settings July 28, 2026 16:28
@stephentoub
stephentoub requested a review from a team as a code owner July 28, 2026 16:28
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Separates version-independent codegen and test reliability fixes from the dependency bump.

Changes:

  • Adds Rust scalar RPC result aliases.
  • Updates E2E teardown and removes unsupported Rust MCP coverage.
  • Adds a five-minute Python test timeout.
Show a summary per file
File Description
scripts/codegen/rust.ts Generates Rust aliases for scalar schemas.
rust/tests/e2e/rpc_mcp_lifecycle.rs Removes unsupported raw-RPC coverage.
test/snapshots/rpc_mcp_lifecycle/should_register_and_unregister_external_mcp_client.yaml Deletes the obsolete snapshot.
python/pyproject.toml Configures the per-test timeout.
go/internal/e2e/rpc_shell_and_fleet_e2e_test.go Adds shell-session teardown.
dotnet/test/E2E/RpcShellAndFleetE2ETests.cs Adds shell-session disposal.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread go/internal/e2e/rpc_shell_and_fleet_e2e_test.go Outdated
Comment thread dotnet/test/E2E/RpcShellAndFleetE2ETests.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b565403c-57ed-4368-84f1-f04bfe39e46e
Copilot AI review requested due to automatic review settings July 28, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Resolved since last review (2)
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR makes targeted, consistent fixes across multiple SDKs. Here's a summary of the cross-SDK analysis:

Session teardown in should_kill_shell_process (Go + .NET)

Both SDKs were missing guaranteed session cleanup in the should_kill_shell_process test. The PR fixes both in parallel:

  • Go: adds t.Cleanup(func() { _ = session.Disconnect() }) (idiomatic Go test cleanup)
  • .NET: upgrades var sessionawait using var session (idiomatic C# IAsyncDisposable)

The other SDKs that have this test already handle teardown correctly:

  • Node.js: explicit await session.disconnect() at end of test ✅
  • Python: explicit await session.disconnect() at end of test ✅
  • Rust: explicit session.disconnect().await at end of test ✅

Python test timeout (pyproject.toml)

Test-infra–only change with no API surface impact. No equivalent is needed in other SDKs (each SDK's test runner handles this differently).

Rust: removed unsupported e2e test

The removed should_register_and_unregister_external_mcp_client test is explained clearly in the replacement comment: the method is visibility: internal in the API contract and cannot be exercised over JSON-RPC. No other SDK exposes this as a typed method, so no cross-SDK gap is created.

Rust codegen: scalar type aliases (scripts/codegen/rust.ts)

Internal codegen fix for Rust-specific type generation. No impact on other SDKs' generated types.

No cross-SDK consistency issues found. The changes are well-targeted and maintain feature parity across all language implementations.

Generated by SDK Consistency Review Agent for #2110 · sonnet46 26.8 AIC · ⌖ 5.45 AIC · ⊞ 6.6K ·

@stephentoub
stephentoub merged commit aa4e707 into main Jul 28, 2026
66 checks passed
@stephentoub
stephentoub deleted the sdk-fixes-independent-of-cli-bump branch July 28, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants