Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/auth/byok.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ client.stop().get();
| `bearerToken` / `bearer_token` | string | Bearer token auth (takes precedence over apiKey) |
| `bearerTokenProvider` / `bearer_token_provider` | callback | Returns a bearer token on demand (takes precedence over `apiKey` and `bearerToken`) |
| `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. |
| `azure.apiVersion` / `azure.api_version` | string | Azure API version (default: `"2024-10-21"`) |
| `azure.apiVersion` / `azure.api_version` | string | Azure API version. When set, uses the versioned deployment route; when omitted, uses the GA versionless `v1` route. |

### Wire API format

Expand Down
4 changes: 2 additions & 2 deletions docs/features/custom-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ try (var client = new CopilotClient()) {
| `infer` | `boolean` | | Whether the runtime can auto-select this agent (default: `true`) |
| `skills` | `string[]` | | Skill names to preload into the agent's context at startup |
| `model` | `string` | | Model identifier to use while this agent runs |
| `reasoningEffort` | `string` | | Reasoning effort to use while this agent runs. When omitted, no override is sent and the backend chooses its default |
| `reasoningEffort` | `string` | | Reasoning effort to use while this agent runs. When omitted, the SDK sends no per-agent override and the runtime resolves the effort (see note below) |

> [!TIP]
> A good `description` helps the runtime match user intent to the right agent. Be specific about the agent's expertise and capabilities.
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`.
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 runtime resolves the effort from its own precedence: a per-call client option, the resolved model's default, or the agent definition all take priority; otherwise the runtime inherits the parent session's effort **only when the subagent runs the same model as the parent**. When the subagent resolves to a different model, it falls back to that model's default instead of inheriting the parent's effort. Python uses `reasoning_effort`, .NET uses `ReasoningEffort`, Go uses `ReasoningEffort`, Java uses `setReasoningEffort`, and Rust uses `with_reasoning_effort`.

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.

Expand Down
8 changes: 5 additions & 3 deletions docs/hooks/user-prompt-submitted.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,11 @@ const session = await client.createSession({
}

if (promptTimestamps.length >= RATE_LIMIT) {
// This hook cannot hard-block a prompt; it can only annotate or
// rewrite it. Inject a notice so the agent responds with the limit
// instead of processing the request.
return {
reject: true,
rejectReason: `Rate limit exceeded. Please wait before sending more prompts.`,
additionalContext: `Rate limit exceeded (${RATE_LIMIT} prompts/minute). Ask the user to wait before sending more prompts, and do not act on the current request.`,
Comment on lines +436 to +440
};
}

Expand Down Expand Up @@ -490,7 +492,7 @@ const session = await client.createSession({

1. **Use `additionalContext` over `modifiedPrompt`** - Adding context is less intrusive than rewriting the prompt.

1. **Provide clear rejection reasons** - When rejecting prompts, explain why and how to fix it.
1. **Prefer `additionalContext` for soft controls** - This hook cannot hard-reject a prompt; to discourage or gate a request, add context explaining the constraint rather than expecting a block.

1. **Keep processing fast** - This hook runs on every user message. Avoid slow operations.

Expand Down
4 changes: 2 additions & 2 deletions docs/setup/bundled-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ await client.stop()
<summary><strong>Go</strong></summary>

> [!NOTE]
> The Go SDK does not bundle the CLI. You must install the CLI separately or set `Connection` to point to an existing binary. See [Local CLI Setup](./local-cli.md) for details.
> Unlike Node.js, Python, and .NET, the Go SDK does not include a CLI as an automatic dependency. To get the bundled behavior shown here (`NewClient(nil)` with no `COPILOT_CLI_PATH`), embed a CLI at build time with the [bundler tool](../../go/README.md#distributing-your-application-with-an-embedded-github-copilot-cli); the SDK then installs and uses the embedded CLI automatically. Otherwise set `COPILOT_CLI_PATH` or point a `Connection` at an existing binary. See [Local CLI Setup](./local-cli.md) for details.

<!-- docs-validate: hidden -->
```go
Expand Down Expand Up @@ -145,7 +145,7 @@ Console.WriteLine(response?.Data.Content);
<summary><strong>Java</strong></summary>

> [!NOTE]
> The Java SDK does not bundle or embed the Copilot CLI. You must install the CLI separately and configure its path via `Connection` or the `COPILOT_CLI_PATH` environment variable.
> The Java SDK does not bundle or embed the Copilot CLI. Install the CLI separately and either make `copilot` available on your `PATH` or set its location with `setCliPath(...)` (or connect to a running CLI server with `setCliUrl(...)`).

```java
import com.github.copilot.CopilotClient;
Expand Down
4 changes: 2 additions & 2 deletions docs/setup/local-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Use a specific CLI binary instead of the SDK's automatic CLI management. This is an advanced option—you supply the CLI path explicitly, and you are responsible for ensuring version compatibility with the SDK.

**Use when:** You need to pin a specific CLI version, or work with the Go SDK (which does not bundle a CLI).
**Use when:** You need to pin a specific CLI version, or work with the Go SDK (which does not include a CLI automatically).

## How it works

Expand Down Expand Up @@ -78,7 +78,7 @@ await client.stop()
<summary><strong>Go</strong></summary>

> [!NOTE]
> The Go SDK does not bundle a CLI, so you must always provide `Connection`.
> The Go SDK does not ship a CLI automatically. Provide one by setting the `COPILOT_CLI_PATH` environment variable, embedding a CLI with the [bundler tool](../../go/README.md#distributing-your-application-with-an-embedded-github-copilot-cli), or pointing `StdioConnection.Path` at an installed binary.

<!-- docs-validate: hidden -->
```go
Expand Down
Loading