Skip to content

Commit 2a2a12b

Browse files
szabta89Copilot
andcommitted
docs: clarify session limits soft cap
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4d98a3e commit 2a2a12b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

docs/features/session-limits.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Session limits
22

3-
Session limits let an application set an AI Credits budget for a Copilot session. Use `sessionLimits` when creating or resuming a session to cap the current accounting window.
3+
Session limits let an application set an AI Credits budget for a Copilot session. Use `sessionLimits` when creating or resuming a session to set a soft cap for the current accounting window.
44

55
## Configure a session limit
66

7-
Set `maxAiCredits` to the maximum AI Credits the session can consume in its current accounting window. The SDK forwards this value to the Copilot CLI when it creates or resumes the session.
7+
Set `maxAiCredits` to the AI Credits soft cap for the session's current accounting window. Usage is checked after model calls return, so one response can exceed the configured value before the runtime blocks the next model call. The SDK forwards this value to the Copilot CLI when it creates or resumes the session.
88

99
<details open>
1010
<summary><strong>TypeScript</strong></summary>
@@ -150,13 +150,13 @@ let resumed = client
150150

151151
## Observe budget events
152152

153-
Applications can subscribe to session events to update UI when the limit changes or the session exhausts its budget.
153+
Applications can subscribe to session events to update UI when the soft cap changes or the session reaches the exhausted-budget flow.
154154

155155
| Event type | When it is emitted | Important fields |
156156
|---|---|---|
157157
| `session.session_limits_changed` | Active session limits changed. A `null` `sessionLimits` value means no limits are active. | `sessionLimits.maxAiCredits?` |
158158
| `session.usage_checkpoint` | The runtime records durable aggregate usage for resume and accounting. | `totalNanoAiu`, `totalPremiumRequests?` |
159-
| `session_limits_exhausted.requested` | The session exhausted its configured budget and needs a user decision before continuing. | `requestId`, `maxAiCredits`, `usedAiCredits` |
159+
| `session_limits_exhausted.requested` | The session reached the exhausted-budget flow and needs a user decision before continuing. | `requestId`, `maxAiCredits`, `usedAiCredits` |
160160
| `session_limits_exhausted.completed` | The exhausted-limit prompt was resolved. | `requestId`, `response.action`, `response.additionalAiCredits?`, `response.maxAiCredits?` |
161161

162162
Use the generated event types for the SDK language you are using. For example, TypeScript narrows by `event.type`:
@@ -172,7 +172,3 @@ session.on((event) => {
172172
}
173173
});
174174
```
175-
176-
## Current limitations
177-
178-
The SDKs expose session limits when creating or resuming a session. They do not currently expose a high-level convenience API for changing or clearing limits on an already-running session. To apply a different limit through the public SDK surface, create or resume a session with a new `sessionLimits` value.

0 commit comments

Comments
 (0)