Skip to content

Commit 5a887d7

Browse files
patnikoCopilotSteveSandersonMS
authored
docs: fix inaccurate SDK/runtime claims found in docs audit (#2064)
* docs: fix inaccurate SDK/runtime claims found in docs audit Cross-checked doc claims against the SDK and copilot-agent-runtime repos and corrected five verified inaccuracies: - setup/local-cli.md, setup/bundled-cli.md: the Go SDK is not bundle-less — it embeds a CLI via `go tool bundler` and reads COPILOT_CLI_PATH; corrected the "must always provide Connection" guidance. - setup/bundled-cli.md: Java configures the CLI via setCliPath / setCliUrl (or `copilot` on PATH), not `Connection` / COPILOT_CLI_PATH. - hooks/user-prompt-submitted.md: the hook output has no reject/rejectReason; replaced the rate-limit example and best-practice bullet with the real additionalContext behavior. - auth/byok.md: omitted Azure apiVersion uses the GA versionless v1 route, not a 2024-10-21 default. - features/custom-agents.md: the runtime now inherits parent reasoning effort for same-model subagents (#13388); corrected the "parent effort is not inherited" statement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: af5056fb-e73c-4bc2-bc11-753fd633cb98 * docs: address audit review feedback Document the Go PATH fallback, reframe the hook example as advisory, and correct Azure versionless routing references across SDK docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: finish cross-SDK audit corrections Correct the advisory threshold example and align Azure routing and reasoning-effort API documentation across all six SDKs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * style(java): format Azure options Javadoc Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Steve Sanderson <1101362+SteveSandersonMS@users.noreply.github.com> Copilot-Session: af5056fb-e73c-4bc2-bc11-753fd633cb98
1 parent 2b5e237 commit 5a887d7

15 files changed

Lines changed: 44 additions & 38 deletions

File tree

docs/auth/byok.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ client.stop().get();
207207
| `bearerToken` / `bearer_token` | string | Bearer token auth (takes precedence over apiKey) |
208208
| `bearerTokenProvider` / `bearer_token_provider` | callback | Returns a bearer token on demand (takes precedence over `apiKey` and `bearerToken`) |
209209
| `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. |
210-
| `azure.apiVersion` / `azure.api_version` | string | Azure API version (default: `"2024-10-21"`) |
210+
| `azure.apiVersion` / `azure.api_version` | string | Azure API version. When set, the runtime uses the versioned deployment route; when omitted, it uses the GA versionless `v1` route. |
211211

212212
### Wire API format
213213

docs/features/custom-agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ try (var client = new CopilotClient()) {
254254
| `infer` | `boolean` | | Whether the runtime can auto-select this agent (default: `true`) |
255255
| `skills` | `string[]` | | Skill names to preload into the agent's context at startup |
256256
| `model` | `string` | | Model identifier to use while this agent runs |
257-
| `reasoningEffort` | `string` | | Reasoning effort to use while this agent runs. When omitted, no override is sent and the backend chooses its default |
257+
| `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) |
258258

259259
> [!TIP]
260260
> A good `description` helps the runtime match user intent to the right agent. Be specific about the agent's expertise and capabilities.
261261
262-
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`.
262+
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`.
263263

264264
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.
265265

docs/hooks/user-prompt-submitted.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,11 @@ const session = await client.createSession({
415415
});
416416
```
417417

418-
### Rate limiting
418+
### Usage threshold notices
419419

420420
```typescript
421421
const promptTimestamps: number[] = [];
422-
const RATE_LIMIT = 10; // prompts
422+
const NOTICE_THRESHOLD = 10; // prompts
423423
const RATE_WINDOW = 60000; // 1 minute
424424

425425
const session = await client.createSession({
@@ -431,15 +431,16 @@ const session = await client.createSession({
431431
while (promptTimestamps.length > 0 && promptTimestamps[0] < now - RATE_WINDOW) {
432432
promptTimestamps.shift();
433433
}
434-
435-
if (promptTimestamps.length >= RATE_LIMIT) {
434+
435+
promptTimestamps.push(now);
436+
if (promptTimestamps.length >= NOTICE_THRESHOLD) {
437+
// This is advisory context for the model, not an enforced rate limit.
438+
// Enforce hard limits before calling session.send().
436439
return {
437-
reject: true,
438-
rejectReason: `Rate limit exceeded. Please wait before sending more prompts.`,
440+
additionalContext: `The user has sent ${promptTimestamps.length} prompts in the last minute. Suggest waiting before sending more.`,
439441
};
440442
}
441-
442-
promptTimestamps.push(now);
443+
443444
return null;
444445
},
445446
},
@@ -490,7 +491,7 @@ const session = await client.createSession({
490491

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

493-
1. **Provide clear rejection reasons** - When rejecting prompts, explain why and how to fix it.
494+
1. **Use `additionalContext` for advisory guidance**: This hook cannot reject a prompt or enforce policy. Enforce hard limits before calling `session.send()`.
494495

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

docs/setup/bundled-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ await client.stop()
7979
<summary><strong>Go</strong></summary>
8080

8181
> [!NOTE]
82-
> 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.
82+
> Unlike Node.js, Python, and .NET, the Go SDK does not include a CLI as an automatic dependency. With no explicit path, `NewClient(nil)` uses an embedded CLI when available, then falls back to `copilot` on `PATH`. To embed a CLI, run the [bundler tool](../../go/README.md#distributing-your-application-with-an-embedded-github-copilot-cli) at build time. You can also set `COPILOT_CLI_PATH` or point a `Connection` at an existing binary. See [Local CLI Setup](./local-cli.md) for details.
8383
8484
<!-- docs-validate: hidden -->
8585
```go
@@ -145,7 +145,7 @@ Console.WriteLine(response?.Data.Content);
145145
<summary><strong>Java</strong></summary>
146146

147147
> [!NOTE]
148-
> 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.
148+
> 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(...)`).
149149
150150
```java
151151
import com.github.copilot.CopilotClient;

docs/setup/local-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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.
44

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

77
## How it works
88

@@ -78,7 +78,7 @@ await client.stop()
7878
<summary><strong>Go</strong></summary>
7979

8080
> [!NOTE]
81-
> The Go SDK does not bundle a CLI, so you must always provide `Connection`.
81+
> The Go SDK does not ship a CLI automatically. Install `copilot` on `PATH`, set the `COPILOT_CLI_PATH` environment variable, embed a CLI with the [bundler tool](../../go/README.md#distributing-your-application-with-an-embedded-github-copilot-cli), or point `StdioConnection.Path` at an installed binary.
8282
8383
<!-- docs-validate: hidden -->
8484
```go

dotnet/src/Types.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ public sealed class CapiSessionOptions
22752275
public sealed class AzureOptions
22762276
{
22772277
/// <summary>
2278-
/// Azure OpenAI API version to use (e.g., "2024-02-01").
2278+
/// Azure OpenAI API version. When omitted, the runtime uses the GA versionless v1 route.
22792279
/// </summary>
22802280
[JsonPropertyName("apiVersion")]
22812281
public string? ApiVersion { get; set; }
@@ -2660,8 +2660,8 @@ public sealed class CustomAgentConfig
26602660

26612661
/// <summary>
26622662
/// Reasoning effort level for this agent's model.
2663-
/// When omitted, no per-agent override is sent and the backend chooses its
2664-
/// default. The parent session effort is not inherited.
2663+
/// When omitted, the runtime resolves model configuration, then inherits
2664+
/// the parent effort only if this agent uses the same model.
26652665
/// </summary>
26662666
[JsonPropertyName("reasoningEffort")]
26672667
public string? ReasoningEffort { get; set; }

go/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ The SDK supports custom OpenAI-compatible API providers (BYOK - Bring Your Own K
591591
- `APIKey` (string): API key (optional for local providers like Ollama)
592592
- `BearerToken` (string): Bearer token for authentication (takes precedence over APIKey)
593593
- `WireAPI` (string): API format for OpenAI/Azure - "completions" or "responses" (default: "completions")
594-
- `Azure.APIVersion` (string): Azure API version (default: "2024-10-21")
594+
- `Azure.APIVersion` (string): Azure API version; when empty, the runtime uses the GA versionless `v1` route
595595

596596
**Example with Ollama:**
597597

go/types.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ type CustomAgentConfig struct {
950950
// falling back to the parent session model if unavailable.
951951
Model string `json:"model,omitempty"`
952952
// ReasoningEffort is the reasoning effort level for this agent's model.
953-
// When empty, no per-agent override is sent and the backend chooses its
954-
// default. The parent session effort is not inherited.
953+
// When empty, the runtime resolves model configuration, then inherits the
954+
// parent effort only for the same model.
955955
ReasoningEffort string `json:"reasoningEffort,omitempty"`
956956
}
957957

@@ -1966,7 +1966,8 @@ type CapiSessionOptions struct {
19661966

19671967
// AzureProviderOptions contains Azure-specific provider configuration
19681968
type AzureProviderOptions struct {
1969-
// APIVersion is the Azure API version. Defaults to "2024-10-21".
1969+
// APIVersion is the Azure API version. When empty, the runtime uses the GA
1970+
// versionless v1 route.
19701971
APIVersion string `json:"apiVersion,omitempty"`
19711972
}
19721973

java/src/main/java/com/github/copilot/rpc/AzureOptions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* <p>
1313
* When using a BYOK (Bring Your Own Key) setup with Azure OpenAI, this class
1414
* allows you to specify Azure-specific settings such as the API version to use.
15+
* When no API version is set, the runtime uses the GA versionless v1 route.
1516
*
1617
* <h2>Example Usage</h2>
1718
*
@@ -32,7 +33,8 @@ public class AzureOptions {
3233
/**
3334
* Gets the Azure OpenAI API version.
3435
*
35-
* @return the API version string
36+
* @return the API version string, or {@code null} to use the GA versionless v1
37+
* route
3638
*/
3739
public String getApiVersion() {
3840
return apiVersion;
@@ -41,7 +43,8 @@ public String getApiVersion() {
4143
/**
4244
* Sets the Azure OpenAI API version to use.
4345
* <p>
44-
* Examples: {@code "2024-02-01"}, {@code "2023-12-01-preview"}
46+
* Examples: {@code "2024-02-01"}, {@code "2023-12-01-preview"} When this option
47+
* is not set, the runtime uses the GA versionless v1 route.
4548
*
4649
* @param apiVersion
4750
* the API version string

java/src/main/java/com/github/copilot/rpc/CustomAgentConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ public String getReasoningEffort() {
298298
/**
299299
* Sets the reasoning effort level for this agent's model.
300300
* <p>
301-
* When omitted, no per-agent override is sent and the backend chooses its
302-
* default. The parent session effort is not inherited.
301+
* When omitted, the runtime resolves model configuration, then inherits the
302+
* parent effort only if this agent uses the same model.
303303
*
304304
* @param reasoningEffort
305305
* the reasoning effort level

0 commit comments

Comments
 (0)