Skip to content

Add Auto routing tier options across all SDKs - #2437

Open
dereklegenzoff wants to merge 4 commits into
mainfrom
dereklegenzoff-pr-review-and-sdk-update
Open

Add Auto routing tier options across all SDKs#2437
dereklegenzoff wants to merge 4 commits into
mainfrom
dereklegenzoff-pr-review-and-sdk-update

Conversation

@dereklegenzoff

@dereklegenzoff dereklegenzoff commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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.

  • Add typed efficiency, balance, and intelligence options across Node.js, Python, Go, .NET, Java, and Rust, including public exports and fluent builders where applicable.
  • Forward Python's auto_tier as autoTier; preserve omission and compatibility with the existing WebSocket option on create/resume.
  • Use the generated AutoTier and lifecycle-event contracts already present on main. Retain main's CLI 1.0.83-0 dependencies and lockfiles; no runtime downgrade or additional dependency bump is needed.
  • Reuse shared generated AutoTier definitions where applicable and cover typed lifecycle-event decoding. Regenerate bindings after merging main to avoid duplicate Go aliases.
  • Document runtime-owned persistence: cold resume restores or explicitly overrides the tier, while a conflicting tier on a resident session is rejected. The SDK does not choose a default or implement routing state.

Verification

  • After merging main, targeted CAPI forwarding and lifecycle-event tests passed in all six languages. Node/Python source type checks and neighboring factory/ask-user API coverage also passed.
  • Previously repeated real-process SDK verification against published CLI 1.0.82-1 using Node and Python with an offline loopback CAPI fixture: all 14 model turns had the expected /auto tier payload or omission, with zero legacy routing calls.
  • Confirmed typed session start/resume event values in both SDKs, resident-session same/omitted/conflicting tiers, cold restoration, explicit overrides, and override durability.
  • Earlier verification against a freshly built runtime containing the upstream change also passed 47 assertions across 15 model turns. Neither loopback run exercised production CAPI.

Compatibility

The feature requires Copilot CLI 1.0.82-1 or later with V2 Auto routing. The branch now uses main's newer 1.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.

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
Copilot AI balanced review requested due to automatic review settings August 28, 2026 16:20
@dereklegenzoff
dereklegenzoff requested a review from a team as a code owner August 28, 2026 16:20

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.

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, and intelligence tier 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.

@github-actions

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
Comment thread python/copilot/generated/rpc.py Fixed
@github-actions

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
@github-actions

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
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

PR #2437 adds capi.autoTier support across all six SDK implementations. The feature is consistently implemented with no parity gaps found.

Summary by SDK

SDK Type Options field Session event field Builder/fluent API
Node.js AutoTier (re-exported from generated) autoTier?: AutoTier ✅ (generated) n/a (TypedDict-style)
Python AutoTier Literal type auto_tier: AutoTier (snake_case ✓) auto_tier in generated event data Wire-conversion: auto_tierautoTier
Go AutoTier (type alias to rpc) + 3 constants AutoTier AutoTier in CapiSessionOptions *AutoTier in SessionStartData/SessionResumeData Struct literal
.NET AutoTier struct (forward-compatible string-struct pattern) public AutoTier? AutoTier ✅ Generated SessionEvents.cs Object initializer
Java AutoTier enum setAutoTier(AutoTier) / getAutoTier() ✅ Generated SessionStartEvent/SessionResumeEvent Fluent setter ✓
Rust AutoTier enum (with Unknown variant for forward compat) auto_tier: Option<AutoTier> + with_auto_tier() auto_tier: Option<AutoTier> in generated data Builder method ✓

Design consistency

  • Wire field name "autoTier" is used uniformly across all SDKs ✓
  • All three tier values (efficiency, balance, intelligence) are represented in each SDK ✓
  • Field is optional/nullable in all implementations — omission preserves existing behavior ✓
  • Session start/resume lifecycle events surface the active tier in all six SDKs ✓
  • Language-idiomatic naming conventions are followed (snake_case in Python/Rust, camelCase in Node/Java, PascalCase in .NET/Go exported fields) ✓

No inconsistencies found. The PR achieves full feature parity.

Generated by SDK Consistency Review Agent for #2437 · sonnet46 63.9 AIC · ⌖ 5.55 AIC · ⊞ 6.6K ·

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.

3 participants