From 6f79489d346b1d7bfc478c297a06868947cdafb8 Mon Sep 17 00:00:00 2001 From: Dharshika-11 Date: Mon, 3 Aug 2026 14:08:53 +0530 Subject: [PATCH 1/2] feat: support reasoningEffort 'max' in SDK types and docs --- dotnet/README.md | 2 +- dotnet/src/Session.cs | 4 ++-- dotnet/src/Types.cs | 2 +- go/README.md | 2 +- go/session.go | 2 +- go/types.go | 4 ++-- java/src/main/java/com/github/copilot/CopilotSession.java | 4 ++-- .../main/java/com/github/copilot/rpc/ResumeSessionConfig.java | 4 ++-- java/src/main/java/com/github/copilot/rpc/SessionConfig.java | 4 ++-- nodejs/README.md | 2 +- nodejs/src/types.ts | 2 +- python/README.md | 2 +- python/copilot/session.py | 4 ++-- rust/src/types.rs | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dotnet/README.md b/dotnet/README.md index 1971c2107b..cb24f34e02 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -123,7 +123,7 @@ Create a new conversation session. - `SessionId` - Custom session ID - `Model` - Model to use ("gpt-5", "claude-sonnet-4.5", etc.) -- `ReasoningEffort` - Reasoning effort level for models that support it ("low", "medium", "high", "xhigh"). Use `ListModelsAsync()` to check which models support this option. +- `ReasoningEffort` - Reasoning effort level for models that support it ("low", "medium", "high", "xhigh", "max"). Use `ListModelsAsync()` to check which models support this option. - `Tools` - Custom tool declarations exposed to the CLI. Declarations without an invocable `AIFunction` are left pending for manual resolution. - `SystemMessage` - System message customization - `AvailableTools` - List of tool names to allow diff --git a/dotnet/src/Session.cs b/dotnet/src/Session.cs index d2f6cedbfb..92e2693790 100644 --- a/dotnet/src/Session.cs +++ b/dotnet/src/Session.cs @@ -1,4 +1,4 @@ -/*--------------------------------------------------------------------------------------------- +/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ @@ -1790,7 +1790,7 @@ public async Task AbortAsync(CancellationToken cancellationToken = default) /// The new model takes effect for the next message. Conversation history is preserved. /// /// Model ID to switch to (e.g., "gpt-5.4"). - /// Reasoning effort level (e.g., "low", "medium", "high", "xhigh"). + /// Reasoning effort level (e.g., "low", "medium", "high", "xhigh", "max"). /// Per-property overrides for model capabilities, deep-merged over runtime defaults. /// Optional cancellation token. /// diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index 6b511117cd..88ce160797 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -3108,7 +3108,7 @@ protected SessionConfigBase(SessionConfigBase? other) /// /// Reasoning effort level for models that support it. - /// Valid values: "low", "medium", "high", "xhigh". + /// Valid values: "low", "medium", "high", "xhigh", "max". /// Only applies to models where capabilities.supports.reasoningEffort is true. /// public string? ReasoningEffort { get; set; } diff --git a/go/README.md b/go/README.md index bc360253f9..6922036148 100644 --- a/go/README.md +++ b/go/README.md @@ -210,7 +210,7 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec **SessionConfig:** - `Model` (string): Model to use ("gpt-5", "claude-sonnet-4.5", etc.). **Required when using custom provider.** -- `ReasoningEffort` (string): Reasoning effort level for models that support it ("low", "medium", "high", "xhigh"). Use `ListModels()` to check which models support this option. +- `ReasoningEffort` (string): Reasoning effort level for models that support it ("low", "medium", "high", "xhigh", "max"). Use `ListModels()` to check which models support this option. - `SessionID` (string): Custom session ID - `Tools` ([]Tool): Custom tools exposed to the CLI - `SystemMessage` (\*SystemMessageConfig): System message configuration. Supports three modes: diff --git a/go/session.go b/go/session.go index a04119720e..a30700ce1c 100644 --- a/go/session.go +++ b/go/session.go @@ -1769,7 +1769,7 @@ func (s *Session) Abort(ctx context.Context) error { // SetModelOptions configures optional parameters for SetModel. type SetModelOptions struct { - // ReasoningEffort sets the reasoning effort level for the new model (e.g., "low", "medium", "high", "xhigh"). + // ReasoningEffort sets the reasoning effort level for the new model (e.g., "low", "medium", "high", "xhigh", "max"). ReasoningEffort *string // ReasoningSummary sets the reasoning summary mode for the new model. // Use ReasoningSummaryNone to suppress summary output regardless of whether reasoning is enabled. diff --git a/go/types.go b/go/types.go index d625310b1b..4927a31621 100644 --- a/go/types.go +++ b/go/types.go @@ -1163,7 +1163,7 @@ type SessionConfig struct { // Model to use for this session Model string // ReasoningEffort level for models that support it. - // Valid values: "low", "medium", "high", "xhigh" + // Valid values: "low", "medium", "high", "xhigh", "max" // Only applies to models where capabilities.supports.reasoningEffort is true. ReasoningEffort string // ReasoningSummary mode for models that support configurable reasoning summaries. @@ -1710,7 +1710,7 @@ type ResumeSessionConfig struct { // Only non-nil fields are applied over the runtime-resolved capabilities. ModelCapabilities *rpc.ModelCapabilitiesOverride // ReasoningEffort level for models that support it. - // Valid values: "low", "medium", "high", "xhigh" + // Valid values: "low", "medium", "high", "xhigh", "max" ReasoningEffort string // ReasoningSummary mode for models that support configurable reasoning summaries. // Use ReasoningSummaryNone to suppress summary output regardless of whether reasoning is enabled. diff --git a/java/src/main/java/com/github/copilot/CopilotSession.java b/java/src/main/java/com/github/copilot/CopilotSession.java index aacd9ee481..3cb47b9b18 100644 --- a/java/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/src/main/java/com/github/copilot/CopilotSession.java @@ -1972,7 +1972,7 @@ public CompletableFuture abort() { * the model ID to switch to (e.g., {@code "gpt-5.4"}) * @param reasoningEffort * reasoning effort level (e.g., {@code "low"}, {@code "medium"}, - * {@code "high"}, {@code "xhigh"}); {@code null} to use default + * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to use default * @return a future that completes when the model switch is acknowledged * @throws IllegalStateException * if this session has been terminated @@ -2003,7 +2003,7 @@ public CompletableFuture setModel(String model, String reasoningEffort) { * the model ID to switch to (e.g., {@code "gpt-5.4"}) * @param reasoningEffort * reasoning effort level (e.g., {@code "low"}, {@code "medium"}, - * {@code "high"}, {@code "xhigh"}); {@code null} to use default + * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to use default * @param modelCapabilities * per-property overrides for model capabilities; {@code null} to use * runtime defaults diff --git a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java index 42419e5a36..0bc3cccc1d 100644 --- a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java @@ -637,7 +637,7 @@ public ResumeSessionConfig clearManageScheduleEnabled() { /** * Gets the reasoning effort level. * - * @return the reasoning effort level ("low", "medium", "high", or "xhigh") + * @return the reasoning effort level ("low", "medium", "high", "xhigh", or "max") */ public String getReasoningEffort() { return reasoningEffort; @@ -646,7 +646,7 @@ public String getReasoningEffort() { /** * Sets the reasoning effort level for models that support it. *

- * Valid values: "low", "medium", "high", "xhigh". + * Valid values: "low", "medium", "high", "xhigh", "max". * * @param reasoningEffort * the reasoning effort level diff --git a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java index 7033ba5572..e6ff62a62b 100644 --- a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java @@ -178,7 +178,7 @@ public SessionConfig setModel(String model) { /** * Gets the reasoning effort level. * - * @return the reasoning effort level ("low", "medium", "high", or "xhigh") + * @return the reasoning effort level ("low", "medium", "high", "xhigh", or "max") */ public String getReasoningEffort() { return reasoningEffort; @@ -187,7 +187,7 @@ public String getReasoningEffort() { /** * Sets the reasoning effort level for models that support it. *

- * Valid values: "low", "medium", "high", "xhigh". Only applies to models where + * Valid values: "low", "medium", "high", "xhigh", "max". Only applies to models where * {@code capabilities.supports.reasoningEffort} is true. * * @param reasoningEffort diff --git a/nodejs/README.md b/nodejs/README.md index 4c430da05c..416d9bb0dd 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -131,7 +131,7 @@ Create a new conversation session. - `sessionId?: string` - Custom session ID. - `model?: string` - Model to use ("gpt-5", "claude-sonnet-4.5", etc.). **Required when using custom provider.** -- `reasoningEffort?: "low" | "medium" | "high" | "xhigh"` - Reasoning effort level for models that support it. Use `listModels()` to check which models support this option. +- `reasoningEffort?: "low" | "medium" | "high" | "xhigh" | "max"` - Reasoning effort level for models that support it. Use `listModels()` to check which models support this option. - `tools?: Tool[]` - Custom tools exposed to the CLI. Tools without `handler` are declaration-only and must be resolved via pending tool-call RPCs. - `systemMessage?: SystemMessageConfig` - System message customization (see below) - `infiniteSessions?: InfiniteSessionConfig` - Configure automatic context compaction (see below) diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index acba826673..d0113914be 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -1823,7 +1823,7 @@ export interface LargeToolOutputConfig { /** * Valid reasoning effort levels for models that support it. */ -export type ReasoningEffort = "low" | "medium" | "high" | "xhigh"; +export type ReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max"; /** * Context window tier for the session. "long_context" pins the session to the diff --git a/python/README.md b/python/README.md index 0206ad49b3..8fdb1f191f 100644 --- a/python/README.md +++ b/python/README.md @@ -272,7 +272,7 @@ finally: These are passed as keyword arguments to `create_session()`: - `model` (str): Model to use ("gpt-5", "claude-sonnet-4.5", etc.). **Required when using custom provider.** -- `reasoning_effort` (str): Reasoning effort level for models that support it ("low", "medium", "high", "xhigh"). Use `list_models()` to check which models support this option. +- `reasoning_effort` (str): Reasoning effort level for models that support it ("low", "medium", "high", "xhigh", "max"). Use `list_models()` to check which models support this option. - `session_id` (str): Custom session ID - `tools` (list): Custom tools exposed to the CLI. Tools with `handler=None` are declaration-only and must be resolved via pending tool-call RPCs. - `system_message` (SystemMessageConfig): System message configuration diff --git a/python/copilot/session.py b/python/copilot/session.py index 4474ce562a..193c571b3e 100644 --- a/python/copilot/session.py +++ b/python/copilot/session.py @@ -169,7 +169,7 @@ def _capabilities_to_dict(caps: ModelCapabilitiesOverride) -> dict: return result -ReasoningEffort = Literal["low", "medium", "high", "xhigh"] +ReasoningEffort = Literal["low", "medium", "high", "xhigh", "max"] ReasoningSummary = Literal["none", "concise", "detailed"] ContextTier = Literal["default", "long_context"] SessionFsConventions = Literal["posix", "windows"] @@ -2976,7 +2976,7 @@ async def set_model( Args: model: Model ID to switch to (e.g., "gpt-5.4", "claude-sonnet-4"). reasoning_effort: Optional reasoning effort level for the new model - (e.g., "low", "medium", "high", "xhigh"). + (e.g., "low", "medium", "high", "xhigh", "max"). reasoning_summary: Optional reasoning summary mode for supported models. Use "none" to suppress summary output regardless of whether reasoning is enabled. diff --git a/rust/src/types.rs b/rust/src/types.rs index b5c180e4ab..04cef322cc 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -4330,7 +4330,7 @@ impl LogOptions { #[derive(Debug, Clone, Default)] pub struct SetModelOptions { /// Reasoning effort for the new model (e.g. `"low"`, `"medium"`, - /// `"high"`, `"xhigh"`). + /// `"high"`, `"xhigh"`, `"max"`). pub reasoning_effort: Option, /// Reasoning summary mode for the new model. Use /// [`ReasoningSummary::None`] to suppress summary output regardless of From 8c88b381853fa603bec8408fea3bcab01e42f710 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 3 Aug 2026 13:10:44 +0000 Subject: [PATCH 2/2] Fix Java formatting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- java/src/main/java/com/github/copilot/CopilotSession.java | 6 ++++-- .../java/com/github/copilot/rpc/ResumeSessionConfig.java | 3 ++- .../main/java/com/github/copilot/rpc/SessionConfig.java | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/java/src/main/java/com/github/copilot/CopilotSession.java b/java/src/main/java/com/github/copilot/CopilotSession.java index 3cb47b9b18..cb16f55fc9 100644 --- a/java/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/src/main/java/com/github/copilot/CopilotSession.java @@ -1972,7 +1972,8 @@ public CompletableFuture abort() { * the model ID to switch to (e.g., {@code "gpt-5.4"}) * @param reasoningEffort * reasoning effort level (e.g., {@code "low"}, {@code "medium"}, - * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to use default + * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to + * use default * @return a future that completes when the model switch is acknowledged * @throws IllegalStateException * if this session has been terminated @@ -2003,7 +2004,8 @@ public CompletableFuture setModel(String model, String reasoningEffort) { * the model ID to switch to (e.g., {@code "gpt-5.4"}) * @param reasoningEffort * reasoning effort level (e.g., {@code "low"}, {@code "medium"}, - * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to use default + * {@code "high"}, {@code "xhigh"}, {@code "max"}); {@code null} to + * use default * @param modelCapabilities * per-property overrides for model capabilities; {@code null} to use * runtime defaults diff --git a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java index 0bc3cccc1d..12ed08c390 100644 --- a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java @@ -637,7 +637,8 @@ public ResumeSessionConfig clearManageScheduleEnabled() { /** * Gets the reasoning effort level. * - * @return the reasoning effort level ("low", "medium", "high", "xhigh", or "max") + * @return the reasoning effort level ("low", "medium", "high", "xhigh", or + * "max") */ public String getReasoningEffort() { return reasoningEffort; diff --git a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java index e6ff62a62b..6b9172d474 100644 --- a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java @@ -178,7 +178,8 @@ public SessionConfig setModel(String model) { /** * Gets the reasoning effort level. * - * @return the reasoning effort level ("low", "medium", "high", "xhigh", or "max") + * @return the reasoning effort level ("low", "medium", "high", "xhigh", or + * "max") */ public String getReasoningEffort() { return reasoningEffort; @@ -187,8 +188,8 @@ public String getReasoningEffort() { /** * Sets the reasoning effort level for models that support it. *

- * Valid values: "low", "medium", "high", "xhigh", "max". Only applies to models where - * {@code capabilities.supports.reasoningEffort} is true. + * Valid values: "low", "medium", "high", "xhigh", "max". Only applies to models + * where {@code capabilities.supports.reasoningEffort} is true. * * @param reasoningEffort * the reasoning effort level