You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet/README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ Create a new conversation session.
125
125
-`Provider` - Custom API provider configuration (BYOK)
126
126
-`Streaming` - Enable streaming of response chunks (default: false)
127
127
-`InfiniteSessions` - Configure automatic context compaction (see below)
128
+
-`SessionLimits` - Configure an AI credit budget for the session (see below)
128
129
-`OnPermissionRequest` - Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. Use `PermissionHandler.ApproveAll` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
129
130
-`OnUserInputRequest` - Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
130
131
-`Hooks` - Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
@@ -136,6 +137,7 @@ Resume an existing session. Returns the session with `WorkspacePath` populated i
136
137
**ResumeSessionConfig:**
137
138
138
139
-`OnPermissionRequest` - Optional handler called before each tool execution to approve or deny it. See [Permission Handling](#permission-handling) section.
140
+
-`SessionLimits` - Configure an AI credit budget for the resumed session.
@@ -431,6 +433,23 @@ var session = await client.CreateSessionAsync(new SessionConfig
431
433
432
434
When `Memory` is left unset, no memory configuration is sent and the runtime default applies. In the default `CopilotClientMode.CopilotCli` the SDK leaves `Memory` unset so the runtime applies its own default, while `CopilotClientMode.Empty` defaults `Memory` to disabled unless you set it explicitly.
433
435
436
+
## Session Limits
437
+
438
+
Set an AI credit budget when creating or resuming a session, then update it later through the session limits API. Pass `null` to clear the current limit.
The runtime emits limit-related events such as `SessionUsageCheckpointEvent`, `SessionSessionLimitsChangedEvent`, `SessionLimitsExhaustedRequestedEvent`, and `SessionLimitsExhaustedCompletedEvent`.
0 commit comments