Skip to content

Commit cf245cd

Browse files
Update SDK snapshot for Copilot CLI 1.0.93-4
1 parent 2023ed2 commit cf245cd

58 files changed

Lines changed: 2078 additions & 149 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎BUILD.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SHARED_CODEGEN_INPUTS = [
44
"scripts/codegen/legacy-parameters.ts",
55
"scripts/codegen/package-lock.json",
66
"scripts/codegen/package.json",
7+
"scripts/codegen/extensible-enums.ts",
78
"scripts/codegen/utils.ts",
89
"scripts/runtime-layout.mjs",
910
"scripts/runtime-release.mjs",

‎docs/features/session-persistence.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,17 @@ When resuming a session, you can optionally reconfigure many settings. This is u
283283

284284
With `model: "auto"`, the optional `capi.autoTier` setting selects an Auto routing preference: `efficiency`, `balance`, `intelligence`, or `fast`. In Python, use `capi={"auto_tier": "balance"}`. This setting applies to V2 Auto routing; V1 Auto requests are unchanged.
285285

286-
`fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. The SDK does not decide Fast eligibility, inspect client identity, choose it as a default, or fall back to another tier when a runtime does not support it—an older runtime returns its native error unchanged.
286+
When the runtime's default-off `DYNAMIC_AUTO_TIERS` feature is enabled, the session's `model.list` RPC also returns optional `auto` metadata from the provider's `/meta` endpoint. Use the enabled descriptors with `type: "auto"` to discover additional supported tier identifiers, their display names, descriptions, and ordering. The existing selection methods and JSON fields accept these identifiers. A discovery failure does not fall back to `/models`, and a successful response without `auto` metadata provides no selectable Auto tiers.
287+
288+
Treat tier identifiers as extensible values, not a closed enumeration. Existing named values remain available; for additional identifiers, use strings in Node.js and Python, `AutoTier("premium-v2")` in Go, `new AutoTier("premium-v2")` in .NET, `AutoTier::Custom` in Rust, or `AutoTier.fromValue` in Java. The provider's `defaultTier` describes its default routing without creating a committed SDK preference.
289+
290+
If a persisted tier is removed or disabled, resume preserves the explicit preference rather than replacing it with the provider's default. Select an available replacement before activating Auto routing.
291+
292+
The CLI also preserves settings-derived preferences during startup, even when a tier is unavailable or dynamic discovery is disabled. You can then select a replacement in the model picker. Explicit SDK create and resume preferences are still validated before the operation succeeds, and Auto activation always validates availability against the resolved discovery mode.
293+
294+
When a create or resume request includes `expAssignments`, the runtime installs those assignments before validating an explicit Auto preference. Validation, discovery, and activation use the same resolved feature decision.
295+
296+
`fast` is an integrator-only latency preset, not a first-party GitHub Copilot product preference. Fast is not validated against the `/meta` tier catalog when configuring a session. The SDK does not decide Fast eligibility, inspect client identity, choose it as a default, or fall back to another tier when a runtime does not support it—an older runtime returns its native error unchanged.
287297

288298
The runtime persists the selected tier, so applications do not need to resend it on every resume:
289299

@@ -309,6 +319,8 @@ if (result.status === "pending") {
309319

310320
The runtime does not apply the preference immediately. It records the request and commits it only when a later user turn using the `auto` model successfully obtains a usable model from the provider. A `pending` status therefore confirms that the request was accepted, not that it took effect. Only the most recent request survives: a new request replaces any earlier one that no turn has claimed yet.
311321

322+
If an older request is still validating when a newer preference request or reset arrives, the older call fails with a superseded-request error instead of replacing the newer intent.
323+
312324
Watch for the outcome through these events:
313325

314326
* `session.model_change` when the preference commits.

‎dotnet/src/Generated/Rpc.cs‎

Lines changed: 67 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dotnet/src/Generated/SessionEvents.cs‎

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------------------------------------------*/
4+
5+
using System.Text.Json;
6+
using System.Text.Json.Serialization.Metadata;
7+
using GitHub.Copilot.Rpc;
8+
using Xunit;
9+
10+
#pragma warning disable GHCP001 // Exercise the public model RPC projection.
11+
12+
namespace GitHub.Copilot.Test.Unit;
13+
14+
public class AutoTierIdentityTests
15+
{
16+
private static readonly JsonSerializerOptions JsonOptions = new()
17+
{
18+
TypeInfoResolver = new DefaultJsonTypeInfoResolver(),
19+
};
20+
21+
[Fact]
22+
public void CaseDistinctTierIdsRemainDistinctAcrossCollectionsAndJson()
23+
{
24+
var custom = new AutoTier("BALANCE");
25+
Assert.NotEqual(AutoTier.Balance, custom);
26+
Assert.Equal(2, new HashSet<AutoTier> { AutoTier.Balance, custom }.Count);
27+
Assert.Equal("\"BALANCE\"", JsonSerializer.Serialize(custom, JsonOptions));
28+
Assert.Equal(custom, JsonSerializer.Deserialize<AutoTier>("\"BALANCE\"", JsonOptions));
29+
Assert.Equal("balance", AutoTier.Balance.Value);
30+
31+
var rpc = JsonSerializer.Deserialize<CurrentModel>("""{"modelId":"auto","autoTier":"BALANCE"}""", JsonOptions);
32+
Assert.NotNull(rpc);
33+
Assert.Equal(custom, rpc.AutoTier);
34+
Assert.NotEqual(AutoTier.Balance, rpc.AutoTier);
35+
}
36+
37+
[Fact]
38+
public void CaseDistinctRecommendationIdsRemainDistinct()
39+
{
40+
var custom = new RecommendedAutoTier("BALANCE");
41+
Assert.NotEqual(RecommendedAutoTier.Balance, custom);
42+
Assert.Equal(2, new HashSet<RecommendedAutoTier> { RecommendedAutoTier.Balance, custom }.Count);
43+
Assert.Equal("\"BALANCE\"", JsonSerializer.Serialize(custom, JsonOptions));
44+
Assert.Equal(custom, JsonSerializer.Deserialize<RecommendedAutoTier>("\"BALANCE\"", JsonOptions));
45+
}
46+
}

0 commit comments

Comments
 (0)