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
{{ message }}
Repository navigation
Commit 5817ec0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/features/session-persistence.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -313,6 +313,8 @@ With `model: "auto"`, the optional `capi.autoTier` setting selects an Auto routi
313
313
314
314
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.
315
315
316
+
To populate a model picker before any session exists, enable `DYNAMIC_AUTO_TIERS` in the runtime's environment (for example, the `env` client option). The server-level `models.list` RPC (`client.rpc.models.list()` in Node.js) then returns the same `auto` metadata from the same `/meta` response, with the same no-fallback behavior. The server-level listing reads the flag the runtime resolved at startup, not per-session feature flags or experiment assignments, so set the flag where you launch the runtime. With the flag disabled, `models.list` is unchanged and omits `auto`.
317
+
316
318
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.
317
319
318
320
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.
Copy file name to clipboardExpand all lines: docs/hooks/user-prompt-submitted.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,28 @@ Return `null` or `undefined` to use the prompt unchanged. Otherwise, return an o
142
142
|`modifiedPrompt`| string | Modified prompt to use instead of original |
143
143
|`additionalContext`| string | Extra context added to the conversation |
144
144
|`suppressOutput`| boolean | If true, suppress the assistant's response output |
145
+
|`decision`|`"block"`| Refuse the prompt (see [Blocking a prompt](#blocking-a-prompt)) |
146
+
|`reason`| string | Why the prompt was blocked; required with `decision`|
147
+
148
+
### Blocking a prompt
149
+
150
+
Return a block decision to refuse the prompt:
151
+
152
+
```json
153
+
{
154
+
"decision": "block",
155
+
"reason": "Prompts may not include credentials."
156
+
}
157
+
```
158
+
159
+
No model turn runs and no user message is recorded. The session emits an ephemeral `session.warning` with `warningType: "policy_blocked"` that carries the reason. The public member names follow each language's conventions:
160
+
161
+
| Meaning | Node.js / Python | Go / .NET | Rust | Java |
Copy file name to clipboardExpand all lines: dotnet/README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,18 @@ new CopilotClient(CopilotClientOptions? options = null)
112
112
-`BaseDirectory` - Base directory for Copilot data (session state, config, etc.). Sets `COPILOT_HOME` on the spawned runtime process. When not set, the runtime defaults to `~/.copilot`. Useful in restricted environments where only specific directories are writable. Ignored when connecting via `RuntimeConnection.ForUri(...)`.
-`Environment` - Environment variables to pass to the runtime process.
115
+
116
+
For the native standalone runtime, set the `Environment` dictionary entry
117
+
`["COPILOT_GITHUB_TELEMETRY_DISABLED"] = "true"` before startup to disable direct
118
+
GitHub telemetry uploads for the entire host, including sessionless events.
119
+
Authentication, `OnGitHubTelemetry` forwarding, and user-configured
120
+
OpenTelemetry export remain unchanged. This is separate from
121
+
`EnableSessionTelemetry = false`, which disables only a session's pipeline.
122
+
The value must be exactly `"true"`; changing it requires a runtime restart.
123
+
The Node CLI host does not use this variable. In-process connections reject
124
+
per-client `Environment`; set the variable in the host process environment
125
+
before starting the runtime instead.
126
+
115
127
-`Logger` - `ILogger` instance for SDK logging.
116
128
-`GitHubToken` - GitHub token for authentication. When provided, takes priority over other auth methods.
117
129
-`UseLoggedInUser` - Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `RuntimeConnection.ForUri(...)`.
@@ -1394,7 +1406,7 @@ var session = await client.CreateSessionAsync(new SessionConfig
1394
1406
-`OnPreToolUse` - Intercept tool calls before execution. Can allow/deny or modify arguments.
1395
1407
-`OnPostToolUse` - Process tool results after successful execution. Can modify results or add context.
1396
1408
-`OnPostToolUseFailure` - Observe failed tool executions and inject extra context to guide the model's next step.
1397
-
-`OnUserPromptSubmitted` - Intercept user prompts. Can modify the prompt before processing.
1409
+
-`OnUserPromptSubmitted` - Intercept user prompts. Can modify the prompt before processing, or return `new UserPromptSubmittedHookOutput { Decision = "block", Reason = "..." }` to refuse it: no model turn runs, no user message is recorded, and the session emits an ephemeral `session.warning` (`warningType: "policy_blocked"`) carrying the reason.
1398
1410
-`OnSessionStart` - Run logic when a session starts or resumes.
1399
1411
-`OnSessionEnd` - Cleanup or logging when session ends.
1400
1412
-`OnErrorOccurred` - Handle errors with retry/skip/abort strategies.
0 commit comments