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
# Editing Copilot content instruction and agent files
6
+
7
+
This applies when you add, edit, or remove a Copilot instruction or shared agent file that guides how **content** (articles, data files) is written. It does **not** apply to code instructions or agents owned by the engineering team (for example `code.instructions.md`).
8
+
9
+
When it applies, you **must** first read the instruction-architecture doc in full and follow it:
Read the current version every time (from a local `github/docs-team` checkout if you have one, otherwise fetch the URL); do not rely on your memory of it, because it changes. If you cannot access it, say so and stop rather than guessing.
|`bearerTokenProvider` / `bearer_token_provider`| callback | Returns a bearer token on demand (takes precedence over `apiKey` and `bearerToken`) |
216
217
|`wireApi` / `wire_api`|`"completions"`\|`"responses"`| Select `"completions"` for broad model compatibility (the Chat Completions API); select `"responses"` for multi-turn state management, tool namespacing, and reasoning support (the Responses API). Anthropic models always use the Messages API regardless of this setting. |
217
218
|`azure.apiVersion` / `azure.api_version`| string | Azure API version (default: `"2024-10-21"`) |
218
219
@@ -274,7 +275,7 @@ For Azure AI Foundry deployments with `/openai/v1/` endpoints, use `type: "opena
Some providers require bearer token authentication instead of API keys:
338
+
Some providers require bearer token authentication instead of API keys. Supply a static token with `bearerToken`, or supply a `bearerTokenProvider` callback that the GitHub Copilot SDK runtime invokes before outbound provider requests. The callback or identity library it wraps manages token caching and refresh.
339
+
340
+
Use `bearerToken` when your application already has a token:
> The `bearerToken` option accepts a **static token string** only. The SDK does not refresh this token automatically. If your token expires, requests will fail and you'll need to create a new session with a fresh token.
349
352
353
+
Use `bearerTokenProvider` to acquire tokens on demand:
For more details about acquiring and refreshing Microsoft Entra bearer tokens, see [AUTOTITLE](/copilot/how-tos/copilot-sdk/setup/azure-managed-identity).
368
+
350
369
## Custom model listing
351
370
352
371
When using BYOK, the CLI server may not know which models your provider supports. You can supply a custom `onListModels` handler at the client level so that `client.listModels()` returns your provider's models in the standard `ModelInfo` format. This lets downstream consumers discover available models without querying the CLI.
@@ -531,7 +550,7 @@ import { CopilotClient } from "@github/copilot-sdk";
531
550
532
551
const client =newCopilotClient();
533
552
const session =awaitclient.createSession({
534
-
model: "gpt-4.1",
553
+
model: "gpt-5.4",
535
554
provider: {
536
555
type: "azure",
537
556
baseUrl: "https://my-resource.openai.azure.com",
@@ -564,7 +583,7 @@ import { CopilotClient } from "@github/copilot-sdk";
|`mcpServers`|`object`|| MCP server configurations specific to this agent |
251
251
|`infer`|`boolean`|| Whether the runtime can auto-select this agent (default: `true`) |
252
252
|`skills`|`string[]`|| Skill names to preload into the agent's context at startup |
253
+
|`model`|`string`|| Model identifier to use while this agent runs |
254
+
|`reasoningEffort`|`string`|| Reasoning effort to use while this agent runs. When omitted, no override is sent and the backend chooses its default |
253
255
254
256
> [!TIP]
255
257
> A good `description` helps the runtime match user intent to the right agent. Be specific about the agent's expertise and capabilities.
256
258
259
+
Set `model` and `reasoningEffort` to override the parent session's model settings while a custom agent runs. When `reasoningEffort` is omitted, the SDK sends no per-agent override and the backend chooses its default. The parent session effort is not inherited, and the SDK does not add a per-agent default. Python uses `reasoning_effort`, .NET uses `ReasoningEffort`, Go uses `ReasoningEffort`, Java uses `setReasoningEffort`, and Rust uses `with_reasoning_effort`.
260
+
257
261
In addition to per-agent configuration above, you can set `agent` on the **session config** itself to pre-select which custom agent is active when the session starts. See [Selecting an Agent at Session Creation](#selecting-an-agent-at-session-creation) below.
258
262
259
263
| Session Config Property | Type | Description |
@@ -429,6 +433,8 @@ By default, all custom agents are available for automatic selection (`infer: tru
429
433
430
434
When a sub-agent runs, the parent session emits lifecycle events. Subscribe to these events to build UIs that visualize agent activity.
431
435
436
+
Sub-agent-originated session events share the parent session stream and include envelope-level `agentId`. Root/main agent events and session-level events omit `agentId`, so renderers can keep the parent response separate from sub-agent traces by checking the event envelope.
0 commit comments