Skip to content

Commit b347f85

Browse files
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>
1 parent 1a2c21b commit b347f85

8 files changed

Lines changed: 22 additions & 19 deletions

File tree

docs/hooks/user-prompt-submitted.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,16 +431,16 @@ const session = await client.createSession({
431431
while (promptTimestamps.length > 0 && promptTimestamps[0] < now - RATE_WINDOW) {
432432
promptTimestamps.shift();
433433
}
434-
434+
435+
promptTimestamps.push(now);
435436
if (promptTimestamps.length >= NOTICE_THRESHOLD) {
436437
// This is advisory context for the model, not an enforced rate limit.
437438
// Enforce hard limits before calling session.send().
438439
return {
439-
additionalContext: `The user has sent ${NOTICE_THRESHOLD} prompts in the last minute. Suggest waiting before sending more.`,
440+
additionalContext: `The user has sent ${promptTimestamps.length} prompts in the last minute. Suggest waiting before sending more.`,
440441
};
441442
}
442-
443-
promptTimestamps.push(now);
443+
444444
return null;
445445
},
446446
},
@@ -491,7 +491,7 @@ const session = await client.createSession({
491491

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

494-
1. **Use `additionalContext` for advisory guidance** - This hook cannot reject a prompt or enforce policy. Enforce hard limits before calling `session.send()`.
494+
1. **Use `additionalContext` for advisory guidance**: This hook cannot reject a prompt or enforce policy. Enforce hard limits before calling `session.send()`.
495495

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

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/types.go

Lines changed: 2 additions & 2 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

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

Lines changed: 4 additions & 1 deletion
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;
@@ -42,6 +44,7 @@ public String getApiVersion() {
4244
* Sets the Azure OpenAI API version to use.
4345
* <p>
4446
* Examples: {@code "2024-02-01"}, {@code "2023-12-01-preview"}
47+
* When this option 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

nodejs/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,8 +1643,8 @@ export interface CustomAgentConfig {
16431643
model?: string;
16441644
/**
16451645
* Reasoning effort level for this agent's model.
1646-
* When omitted, no per-agent override is sent and the backend chooses its
1647-
* default. The parent session effort is not inherited.
1646+
* When omitted, the runtime resolves the effort from model configuration,
1647+
* then inherits the parent effort only if this agent uses the same model.
16481648
*/
16491649
reasoningEffort?: ReasoningEffort;
16501650
}

python/copilot/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,8 @@ class CustomAgentConfig(TypedDict, total=False):
10801080
skills: NotRequired[list[str]]
10811081
# Model identifier (e.g. "claude-haiku-4.5"); runtime falls back to parent model if unavailable
10821082
model: NotRequired[str]
1083-
# Reasoning effort for this agent's model. When omitted, no per-agent override
1084-
# is sent and the backend chooses its default; the parent effort is not inherited.
1083+
# Reasoning effort for this agent's model. When omitted, the runtime resolves
1084+
# model configuration, then inherits the parent effort only for the same model.
10851085
reasoning_effort: NotRequired[ReasoningEffort]
10861086

10871087

rust/src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ pub struct CustomAgentConfig {
644644
pub model: Option<String>,
645645
/// Reasoning effort level for this agent's model.
646646
///
647-
/// When unset, no per-agent override is sent and the backend chooses its
648-
/// default. The parent session effort is not inherited.
647+
/// When unset, the runtime resolves model configuration, then inherits the
648+
/// parent effort only for the same model.
649649
#[serde(default, skip_serializing_if = "Option::is_none")]
650650
pub reasoning_effort: Option<String>,
651651
}

0 commit comments

Comments
 (0)