Skip to content

Commit cf38b7b

Browse files
andyfellerCopilot
andcommitted
Address review feedback on the Auto tier surface
Gate the experimental Auto tier options consistently. The .NET SetModelOptions.AutoTier and .ResetAutoTier properties, the Java Auto tier accessors, and the Python set_model auto_tier parameter now carry the same experimental marker their dedicated setAutoTier counterparts already had. Correct two documentation errors. The reset-state paragraph claimed four SDKs cannot express reset in a single value; Rust can, through AutoTierPreference::Reset, so only Go, .NET, and Java need a separate flag. The live-switching section now states that it needs Copilot CLI 1.0.83-4, which is newer than the 1.0.82-1 required to select a tier at create or resume. Fix the Java class Javadoc, which said every option is optional when setModel rejects a null model, and rewrite the Rust E2E doc comment to describe what it covers instead of pointing at the Node.js test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2aad36e9-e078-4b9c-afa1-0c7cd2c71f74
1 parent 4ae0906 commit cf38b7b

5 files changed

Lines changed: 18 additions & 6 deletions

File tree

docs/features/session-persistence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The `session.start` and `session.resume` events expose the selected tier in thei
271271

272272
### Changing the Auto tier during a session
273273

274-
Call `setAutoTier` to change the routing preference on a live session without changing the selected model. Pass `null` (Python `None`, Go `nil`) to return to the provider's default Auto routing.
274+
Call `setAutoTier` to change the routing preference on a live session without changing the selected model. Pass `null` (Python `None`, Go `nil`) to return to the provider's default Auto routing. This requires Copilot CLI `1.0.83-4` or later, which is newer than the `1.0.82-1` needed to select a tier when creating or resuming a session.
275275

276276
```typescript
277277
const result = await session.setAutoTier("intelligence");
@@ -309,7 +309,7 @@ To select the `auto` model and its routing preference in a single call, stage th
309309
| Rust | `SetModelOptions::default().with_auto_tier(AutoTier::Balance)` | `SetModelOptions::default().with_reset_auto_tier()` |
310310
| Java | `new SetModelOptions().setModel("auto").setAutoTier(AutoTier.BALANCE)` | `new SetModelOptions().setModel("auto").setResetAutoTier(true)` |
311311

312-
Node.js and Python express all three states natively, because `null`/`None` is distinguishable from an omitted argument. The other four SDKs cannot make that distinction in a single value, so they carry a separate reset option. Omitting both always means "leave the current preference alone."
312+
Node.js, Python, and Rust express all three states in a single value: Node.js and Python because `null`/`None` is distinguishable from an omitted argument, and Rust because `AutoTierPreference::Reset` is a distinct variant of the same option. Go, .NET, and Java have no way to distinguish "reset" from "unset" in one value, so they carry a separate reset flag. Omitting both always means "leave the current preference alone."
313313

314314
### Example: changing model on resume
315315

dotnet/src/Types.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,12 +3030,14 @@ public struct SetModelOptions
30303030
/// <c>auto</c>; use <see cref="CopilotSession.SetAutoTierAsync"/> to change the
30313031
/// preference without changing the selected model.
30323032
/// </remarks>
3033+
[Experimental(Diagnostics.Experimental)]
30333034
public AutoTier? AutoTier { get; set; }
30343035

30353036
/// <summary>
30363037
/// Returns to the provider's default Auto routing as part of this switch.
30373038
/// Mutually exclusive with <see cref="AutoTier"/>.
30383039
/// </summary>
3040+
[Experimental(Diagnostics.Experimental)]
30393041
public bool ResetAutoTier { get; set; }
30403042
}
30413043

java/sdk/src/main/java/com/github/copilot/rpc/SetModelOptions.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
package com.github.copilot.rpc;
66

7+
import com.github.copilot.CopilotExperimental;
8+
79
/**
810
* Optional settings for a model switch.
911
* <p>
10-
* All setter methods return {@code this} for method chaining. Every option is
11-
* optional; an unset option leaves the corresponding session state unchanged.
12+
* All setter methods return {@code this} for method chaining. {@code model} is
13+
* required. Every other option is optional; an unset option leaves the
14+
* corresponding session state unchanged.
1215
*
1316
* <pre>{@code
1417
* session.setModel(new SetModelOptions().setModel("auto").setAutoTier(AutoTier.INTELLIGENCE)).get();
@@ -122,6 +125,7 @@ public SetModelOptions setModelCapabilities(ModelCapabilitiesOverride modelCapab
122125
*
123126
* @return the requested tier, or {@code null} when no tier was requested
124127
*/
128+
@CopilotExperimental
125129
public AutoTier getAutoTier() {
126130
return autoTier;
127131
}
@@ -139,6 +143,7 @@ public AutoTier getAutoTier() {
139143
* current preference unchanged
140144
* @return this options object for method chaining
141145
*/
146+
@CopilotExperimental
142147
public SetModelOptions setAutoTier(AutoTier autoTier) {
143148
this.autoTier = autoTier;
144149
return this;
@@ -149,6 +154,7 @@ public SetModelOptions setAutoTier(AutoTier autoTier) {
149154
*
150155
* @return {@code true} when the request clears the Auto routing preference
151156
*/
157+
@CopilotExperimental
152158
public boolean isResetAutoTier() {
153159
return resetAutoTier;
154160
}
@@ -163,6 +169,7 @@ public boolean isResetAutoTier() {
163169
* {@code true} to return to provider-default Auto routing
164170
* @return this options object for method chaining
165171
*/
172+
@CopilotExperimental
166173
public SetModelOptions setResetAutoTier(boolean resetAutoTier) {
167174
this.resetAutoTier = resetAutoTier;
168175
return this;

python/copilot/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3101,7 +3101,9 @@ async def set_model(
31013101
context_tier: Optional context window tier for supported models.
31023102
Omit to use normal model behavior with no explicit tier.
31033103
model_capabilities: Override individual model capabilities resolved by the runtime.
3104-
auto_tier: Routing preference to apply when ``model`` is ``"auto"``.
3104+
auto_tier: **Experimental.** Part of an experimental Auto routing
3105+
surface and may change or be removed in a future release.
3106+
Routing preference to apply when ``model`` is ``"auto"``.
31053107
Pass ``None`` to return to the provider's default Auto routing.
31063108
Omit the argument to leave the current preference alone. The
31073109
runtime rejects this option when ``model`` is anything other than

rust/tests/e2e/auto_tier.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use super::support::with_dedicated_e2e_context;
77

88
const MODEL_ID: &str = "auto";
99

10-
/// Mirrors nodejs/test/e2e/auto_tier.e2e.test.ts (snapshot category "auto_tier").
10+
/// End-to-end coverage for staging and resetting an Auto routing preference
11+
/// (snapshot category "auto_tier").
1112
///
1213
/// The runtime stages an Auto routing preference instead of applying it immediately: a
1314
/// request stays unclaimed until a later turn using the `auto` model mints a usable model

0 commit comments

Comments
 (0)