Add Auto routing tier options across all SDKs - #2437
Conversation
Expose typed capi.autoTier options for create and resume across all six SDKs, including Python wire conversion. Cover canonical values and omission, and document runtime-owned persistence and resume semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2417f184-d8c9-4f2a-a27b-e15e4baea808
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
Adds Auto routing tier configuration across all six SDKs while leaving routing defaults, validation, and persistence to the runtime.
Changes:
- Adds typed
efficiency,balance, andintelligencetier options. - Forwards tiers during session creation and resume.
- Documents persistence semantics and adds serialization tests.
| File | Description |
|---|---|
rust/src/types.rs |
Adds AutoTier, builder support, and tests. |
rust/README.md |
Documents Rust usage. |
python/test_client.py |
Tests create/resume wire conversion. |
python/README.md |
Documents Python configuration. |
python/copilot/client.py |
Adds typed tiers and wire conversion. |
python/copilot/__init__.py |
Exports AutoTier. |
nodejs/test/client.test.ts |
Tests tier forwarding and omission. |
nodejs/src/types.ts |
Adds public tier types. |
nodejs/src/index.ts |
Exports AutoTier. |
nodejs/README.md |
Documents Node.js configuration. |
java/sdk/src/test/java/com/github/copilot/CapiSessionOptionsTest.java |
Tests Java serialization and forwarding. |
java/sdk/src/main/java/com/github/copilot/rpc/CapiSessionOptions.java |
Adds fluent tier configuration. |
java/sdk/src/main/java/com/github/copilot/rpc/AutoTier.java |
Defines Java tier values. |
java/README.md |
Documents Java usage. |
go/types.go |
Adds Go tier constants and option field. |
go/client_test.go |
Tests Go request serialization. |
dotnet/test/Unit/ClientSessionLifetimeTests.cs |
Tests .NET serialization and omission. |
dotnet/src/Types.cs |
Adds .NET tier enum and option. |
docs/features/session-persistence.md |
Documents runtime persistence semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
Refresh CLI dependencies and generated RPC/session-event types across all SDKs. Reuse shared AutoTier definitions where applicable and cover typed lifecycle-event decoding, canonical values, and omission. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2417f184-d8c9-4f2a-a27b-e15e4baea808
This comment has been minimized.
This comment has been minimized.
Resolve dependency conflicts using main's newer CLI and lockfiles. Preserve both AutoTier and AskUserVariant exports, and regenerate SDK bindings to avoid duplicate Go aliases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2417f184-d8c9-4f2a-a27b-e15e4baea808
This comment has been minimized.
This comment has been minimized.
Use distinct create/resume WebSocket options, including alongside an unchanged Auto tier, so payload reuse cannot pass the forwarding regression test. Leave AutoTier traits owned by the Rust generator and explicitly clone the reused test value. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2417f184-d8c9-4f2a-a27b-e15e4baea808
This comment has been minimized.
This comment has been minimized.
Bring in the managed Rust runtime wrapper, Go bundler improvements, and Java release changes while retaining Auto tier APIs and regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2417f184-d8c9-4f2a-a27b-e15e4baea808
✅ Cross-SDK Consistency ReviewPR: Add Auto routing tier options across all SDKs (#2437) This PR adds the
Observations:
No consistency gaps found. 🎉
|
Add the required permission handler to the Java SessionConfig documentation sample so the doc-sample guard passes.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SteveSandersonMS
left a comment
There was a problem hiding this comment.
Reviewed the PR end-to-end and applied the required Java README sample fix before merge. The feature exposes an existing runtime capability consistently across all SDK languages, preserves omission semantics, and was manually validated against the bundled CLI.
Trigger a clean CI run after unrelated Windows E2E flakes.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Runtime PR https://github.com/github/copilot-agent-runtime/pull/16072 introduced
capi.autoTier, but the SDKs' handwritten session options did not expose it. Python also discarded the new field during wire conversion.efficiency,balance, andintelligenceoptions across Node.js, Python, Go, .NET, Java, and Rust, including public exports and fluent builders where applicable.auto_tierasautoTier; preserve omission and compatibility with the existing WebSocket option on create/resume.1.0.83-0dependencies and lockfiles; no runtime downgrade or additional dependency bump is needed.Verification
1.0.82-1using Node and Python with an offline loopback CAPI fixture: all 14 model turns had the expected/autotier payload or omission, with zero legacy routing calls.Compatibility
The feature requires Copilot CLI
1.0.82-1or later with V2 Auto routing. The branch now uses main's newer1.0.83-0; no follow-up runtime bump is pending. Omitting the option preserves existing behavior.The generated .NET AutoTier uses the SDK's forward-compatible string-struct pattern, and Rust uses its generated enum with an Unknown variant. Existing canonical member names are preserved; runtime validation remains authoritative.