Update SDK snapshot for Copilot CLI 1.0.94-4 · github/copilot-sdk@2d5bbe1 · GitHub
Skip to content

Commit 2d5bbe1

Browse files
Update SDK snapshot for Copilot CLI 1.0.94-4
1 parent 503bc70 commit 2d5bbe1

171 files changed

Lines changed: 16307 additions & 2078 deletions

File tree

Some content is hidden

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

‎.github/actions/run-alpine-tests/action.yml‎

Lines changed: 1 addition & 1 deletion

‎.github/workflows/sdk-java.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ jobs:
203203
env:
204204
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
205205
run: |
206-
docker run --rm \
206+
docker run --rm --init \
207207
--volume "$GITHUB_WORKSPACE:/workspace" \
208208
--workdir "/workspace/$SDK_HOME/java" \
209209
--env CI=true \

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ failed-startup cleanup. Keep those lifecycle expectations aligned when changing
408408
an SDK transport; test watchdogs must allow all cleanup phases their separate
409409
budgets, rather than treating the graceful-exit timeout as a total shutdown cap.
410410

411+
Java also exercises the opt-in `shutdown-error` mode. It rejects
412+
`runtime.shutdown`, writes `<cleanup-marker>.eof` when stdin closes, and holds
413+
cleanup-marker creation and process exit until the test creates
414+
`<cleanup-marker>.release`. This handshake verifies that a failed shutdown RPC
415+
still allows EOF-driven finalization before forced cleanup.
416+
411417
The shared harness records real inference responses under `test/snapshots`.
412418
Record new captures with `GITHUB_TOKEN` set and `GITHUB_ACTIONS` unset;
413419
never author model responses by hand. Rerun with `GITHUB_ACTIONS=true` and real

‎docs/features/usage-and-billing.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@ The table below maps each signal to the API that exposes it.
2222
| Accumulated AI credit and token totals | `session.usage.getMetrics` | Session | RPC |
2323
| Per-model AI credit pricing | `models.list` | Server | RPC |
2424
| Account quota and premium interactions | `account.getQuota` | Server | RPC |
25+
| Session-owned provider quota observations | `session.quota.get` and `session.quota.refresh` | Session | RPC |
26+
| Provider admission-state updates | `session.quota_observation` | Session | Event |
27+
28+
`session.quota.get` reads local runtime state; `session.quota.refresh` refreshes the provider catalogs and quota sources. Both return `providerQuotas`, keyed by provider identity, quota ID, and observation kind. The runtime keeps one observation store. The legacy `snapshots` field is a derived compatibility view of authoritative budgets, not a second source of quota state.
29+
30+
Provider cardinality is an emergent property of actual usage and observations supplied to the seam. This API neither knows nor enforces how many providers a user may use: it records and projects zero, one, or many entries identically. Producers supply stable provider/account-scoped references; usage adds model identity, and quota adds quota identity and observation kind. `get()` returns the full known collection, so callers can select an exact key, a subset, or all entries without provider-specific methods. Acquisition uses the sources supplied by the upstream account/model layer; it does not manufacture a union or impose a selected-provider filter on reads.
31+
32+
Check `observationKind`, `quantityKind`, and `acquisitionStatus` before interpreting a reading. An `authoritative_budget` can supply progress and reset metadata. An `advisory_balance` reports independent signed 64-bit quantities without promising a percentage, reset window, or post-call balance. An `admission_state` reports permission/capacity at request admission and carries no quantities; it does not replace an account balance. Preserve missing values and explicit nulls rather than converting them to zero. A failed or unavailable acquisition is not quota exhaustion.
33+
34+
For Microsoft 365 Copilot, access and capacity are service verdicts, while quantities are advisory. For example, `allowed`/`available` with both quantities explicitly zero means **0 / 0 AIC reported**, not 100% consumed or inconsistent state. A missing entitlement is different from a zero entitlement. The `-1` entitlement sentinel means unlimited entitlement without changing the reported capacity state. Inference headers can reflect cached admission state; neither those headers nor an on-demand quota refresh establish the charge for the preceding call.
35+
36+
Usage totals belong to a session, not the active account. In the CLI, switching away from a non-empty Microsoft 365 Copilot session requires starting a new session. The previous session retains its usage and history for resume; the new session starts its own totals.
2537

2638
> [!NOTE]
27-
> `session.usage.getMetrics`, `session.metadata.contextInfo`, and `session.metadata.recomputeContextTokens` are marked experimental in the generated RPC surface. In .NET they raise the `GHCP001` experimental diagnostic, which you suppress with `#pragma warning disable GHCP001` or a project-level `<NoWarn>GHCP001</NoWarn>`. Pin both the SDK and the Copilot CLI runtime if your application depends on them.
39+
> `session.quota`, `session.usage.getMetrics`, `session.metadata.contextInfo`, and `session.metadata.recomputeContextTokens` are marked experimental in the generated RPC surface. In .NET they raise the `GHCP001` experimental diagnostic, which you suppress with `#pragma warning disable GHCP001` or a project-level `<NoWarn>GHCP001</NoWarn>`. Pin both the SDK and the Copilot CLI runtime if your application depends on them.
2840
2941
The field tables below list only the fields used in the examples on this page. The complete, always-current field reference is the generated SDK types plus [Streaming events](./streaming-events.md), which is regenerated from the CLI schema on every dependency bump. Treat those as the source of truth and this page as a task-oriented guide.
3042

‎dotnet/README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ Start the CLI server and establish connection.
178178
##### `StopAsync(): Task`
179179

180180
Stop the server and close all sessions. Throws if errors are encountered during cleanup.
181+
Closing a session stops subscribed event delivery, drops queued events, and releases
182+
subscriptions without waiting for handlers already admitted for dispatch. Pending `SendAndWaitAsync`
183+
operations fail with `IOException` if the session closes before their final response arrives.
181184
For an owned stdio runtime, graceful shutdown closes stdin and waits up to 10 seconds
182185
for host cleanup, including telemetry export. This cleanup is best-effort: if the wait
183186
times out, the process is terminated and that timeout alone is not reported as a cleanup
@@ -186,6 +189,20 @@ error. A successful return does not guarantee that all telemetry was exported.
186189
##### `ForceStopAsync(): Task`
187190

188191
Force stop the CLI server without graceful cleanup. Use when `StopAsync()` takes too long.
192+
Stops session event dispatch and releases queued events and subscriptions. A handler already
193+
admitted for dispatch may finish; shutdown does not wait for it. Pending `SendAndWaitAsync` operations fail
194+
with `IOException` if the session closes before their final response arrives.
195+
The SDK releases its references to later handlers' captured objects even if an admitted handler remains blocked.
196+
Local retirement also releases tool, command, hook, auth/input, provider, canvas,
197+
and transform registrations, without changing caller-owned configuration or joining
198+
callbacks already admitted. Registration and callback lookup share a retirement fence;
199+
late accepted tool replacements cannot restore handlers. Ordinary disposal retains
200+
hook callbacks through the detach response and performs local retirement in `finally`.
201+
Both stop methods close session admission before taking the session snapshot. Concurrent
202+
create/resume setup on that connection is rejected and retired locally; restarting the
203+
client opens admission only for the new connection.
204+
Cleanup of a rejected cloud creation stays on its original connection and cannot
205+
restart the client during shutdown.
189206

190207
##### `CreateSessionAsync(SessionConfig? config = null): Task<CopilotSession>`
191208

@@ -600,6 +617,24 @@ await session2.DisposeAsync();
600617

601618
---
602619

620+
## Provider-qualified model selection
621+
622+
Use the experimental request-object overload to select the `modelId` and `providerId` from a model catalog entry:
623+
624+
```csharp
625+
using GitHub.Copilot.Rpc;
626+
627+
#pragma warning disable GHCP001 // Provider-qualified model selection is experimental.
628+
await session.Rpc.Model.SwitchToAsync(new ModelSwitchToRequest
629+
{
630+
ModelId = modelId,
631+
ProviderId = providerId,
632+
});
633+
#pragma warning restore GHCP001
634+
```
635+
636+
The SDK supplies the session ID. Existing positional calls, including `session.Rpc.Model.SwitchToAsync("auto", AutoTier.Balance)`, retain their original parameter order and defaults.
637+
603638
## Auto routing tiers
604639

605640
The canonical values are `AutoTier.Efficiency`, `AutoTier.Balance`, `AutoTier.Intelligence`, and `AutoTier.Fast`, which send `efficiency`, `balance`, `intelligence`, and `fast` on the wire. Fast is an integrator-only latency preset, not a fourth first-party GitHub Copilot preference. The SDK forwards the requested value without deciding eligibility or inspecting client identity. An externally supplied older runtime returns its native runtime or JSON-RPC error; the SDK does not downgrade or silently ignore the request.

‎dotnet/src/Client.cs‎

Lines changed: 71 additions & 17 deletions

0 commit comments

Comments
 (0)