Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,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.
- `Tools` - Custom tools exposed to the CLI
- `SystemMessage` - System message customization
- `AvailableTools` - List of tool names to allow
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig? config = nul
var request = new CreateSessionRequest(
config?.Model,
config?.SessionId,
config?.ReasoningEffort,
config?.Tools?.Select(ToolDefinition.FromAIFunction).ToList(),
config?.SystemMessage,
config?.AvailableTools,
Expand Down Expand Up @@ -428,6 +429,7 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes

var request = new ResumeSessionRequest(
sessionId,
config?.ReasoningEffort,
config?.Tools?.Select(ToolDefinition.FromAIFunction).ToList(),
config?.Provider,
config?.OnPermissionRequest != null ? true : null,
Expand Down Expand Up @@ -1090,6 +1092,7 @@ public static string Escape(string arg)
internal record CreateSessionRequest(
string? Model,
string? SessionId,
string? ReasoningEffort,
List<ToolDefinition>? Tools,
SystemMessageConfig? SystemMessage,
List<string>? AvailableTools,
Expand Down Expand Up @@ -1122,6 +1125,7 @@ internal record CreateSessionResponse(

internal record ResumeSessionRequest(
string SessionId,
string? ReasoningEffort,
List<ToolDefinition>? Tools,
ProviderConfig? Provider,
bool? RequestPermission,
Expand Down
27 changes: 27 additions & 0 deletions dotnet/src/Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,13 @@ public class SessionConfig
public string? SessionId { get; set; }
public string? Model { get; set; }

/// <summary>
/// Reasoning effort level for models that support it.
/// Valid values: "low", "medium", "high", "xhigh".
/// Only applies to models where capabilities.supports.reasoningEffort is true.
/// </summary>
public string? ReasoningEffort { get; set; }

/// <summary>
/// Override the default configuration directory location.
/// When specified, the session will use this directory for storing config and state.
Expand Down Expand Up @@ -766,6 +773,12 @@ public class ResumeSessionConfig
public ICollection<AIFunction>? Tools { get; set; }
public ProviderConfig? Provider { get; set; }

/// <summary>
/// Reasoning effort level for models that support it.
/// Valid values: "low", "medium", "high", "xhigh".
/// </summary>
public string? ReasoningEffort { get; set; }

/// <summary>
/// Handler for permission requests from the server.
/// When provided, the server will call this handler to request permission for operations.
Expand Down Expand Up @@ -930,6 +943,12 @@ public class ModelSupports
{
[JsonPropertyName("vision")]
public bool Vision { get; set; }

/// <summary>
/// Whether this model supports reasoning effort configuration.
/// </summary>
[JsonPropertyName("reasoningEffort")]
public bool ReasoningEffort { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -989,6 +1008,14 @@ public class ModelInfo
/// <summary>Billing information</summary>
[JsonPropertyName("billing")]
public ModelBilling? Billing { get; set; }

/// <summary>Supported reasoning effort levels (only present if model supports reasoning effort)</summary>
[JsonPropertyName("supportedReasoningEfforts")]
public List<string>? SupportedReasoningEfforts { get; set; }

/// <summary>Default reasoning effort level (only present if model supports reasoning effort)</summary>
[JsonPropertyName("defaultReasoningEffort")]
public string? DefaultReasoningEffort { get; set; }
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func main() {
**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.
- `SessionID` (string): Custom session ID
- `Tools` ([]Tool): Custom tools exposed to the CLI
- `SystemMessage` (\*SystemMessageConfig): System message configuration
Expand All @@ -114,6 +115,7 @@ func main() {
**ResumeSessionConfig:**

- `Tools` ([]Tool): Tools to expose when resuming
- `ReasoningEffort` (string): Reasoning effort level for models that support it
- `Provider` (\*ProviderConfig): Custom API provider configuration (BYOK). See [Custom Providers](#custom-providers) section.
- `Streaming` (bool): Enable streaming delta events

Expand Down
6 changes: 6 additions & 0 deletions go/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ func (c *Client) CreateSession(config *SessionConfig) (*Session, error) {
if config.SessionID != "" {
params["sessionId"] = config.SessionID
}
if config.ReasoningEffort != "" {
params["reasoningEffort"] = config.ReasoningEffort
}
if len(config.Tools) > 0 {
toolDefs := make([]map[string]interface{}, 0, len(config.Tools))
for _, tool := range config.Tools {
Expand Down Expand Up @@ -670,6 +673,9 @@ func (c *Client) ResumeSessionWithOptions(sessionID string, config *ResumeSessio
}

if config != nil {
if config.ReasoningEffort != "" {
params["reasoningEffort"] = config.ReasoningEffort
}
if len(config.Tools) > 0 {
toolDefs := make([]map[string]interface{}, 0, len(config.Tools))
for _, tool := range config.Tools {
Expand Down
22 changes: 16 additions & 6 deletions go/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ type SessionConfig struct {
SessionID string
// Model to use for this session
Model string
// ReasoningEffort level for models that support it.
// Valid values: "low", "medium", "high", "xhigh"
// Only applies to models where capabilities.supports.reasoningEffort is true.
ReasoningEffort string
// ConfigDir overrides the default configuration directory location.
// When specified, the session will use this directory for storing config and state.
ConfigDir string
Expand Down Expand Up @@ -399,6 +403,9 @@ type ResumeSessionConfig struct {
Tools []Tool
// Provider configures a custom model provider
Provider *ProviderConfig
// ReasoningEffort level for models that support it.
// Valid values: "low", "medium", "high", "xhigh"
ReasoningEffort string
// OnPermissionRequest is a handler for permission requests from the server
OnPermissionRequest PermissionHandler
// OnUserInputRequest is a handler for user input requests from the agent (enables ask_user tool)
Expand Down Expand Up @@ -523,7 +530,8 @@ type ModelLimits struct {

// ModelSupports contains model support flags
type ModelSupports struct {
Vision bool `json:"vision"`
Vision bool `json:"vision"`
ReasoningEffort bool `json:"reasoningEffort"`
}

// ModelCapabilities contains model capabilities and limits
Expand All @@ -545,11 +553,13 @@ type ModelBilling struct {

// ModelInfo contains information about an available model
type ModelInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Capabilities ModelCapabilities `json:"capabilities"`
Policy *ModelPolicy `json:"policy,omitempty"`
Billing *ModelBilling `json:"billing,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Capabilities ModelCapabilities `json:"capabilities"`
Policy *ModelPolicy `json:"policy,omitempty"`
Billing *ModelBilling `json:"billing,omitempty"`
SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitempty"`
DefaultReasoningEffort string `json:"defaultReasoningEffort,omitempty"`
}

// GetModelsResponse is the response from models.list
Expand Down
1 change: 1 addition & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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.
- `tools?: Tool[]` - Custom tools exposed to the CLI
- `systemMessage?: SystemMessageConfig` - System message customization (see below)
- `infiniteSessions?: InfiniteSessionConfig` - Configure automatic context compaction (see below)
Expand Down
56 changes: 28 additions & 28 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@github/copilot": "^0.0.399",
"@github/copilot": "^0.0.400",
"vscode-jsonrpc": "^8.2.1",
"zod": "^4.3.5"
},
Expand Down
2 changes: 2 additions & 0 deletions nodejs/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ export class CopilotClient {
const response = await this.connection!.sendRequest("session.create", {
model: config.model,
sessionId: config.sessionId,
reasoningEffort: config.reasoningEffort,
tools: config.tools?.map((tool) => ({
name: tool.name,
description: tool.description,
Expand Down Expand Up @@ -531,6 +532,7 @@ export class CopilotClient {

const response = await this.connection!.sendRequest("session.resume", {
sessionId,
reasoningEffort: config.reasoningEffort,
tools: config.tools?.map((tool) => ({
name: tool.name,
description: tool.description,
Expand Down
19 changes: 19 additions & 0 deletions nodejs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,11 @@ export interface InfiniteSessionConfig {
bufferExhaustionThreshold?: number;
}

/**
* Valid reasoning effort levels for models that support it.
*/
export type ReasoningEffort = "low" | "medium" | "high" | "xhigh";

export interface SessionConfig {
/**
* Optional custom session ID
Expand All @@ -615,6 +620,13 @@ export interface SessionConfig {
*/
model?: string;

/**
* Reasoning effort level for models that support it.
* Only valid for models where capabilities.supports.reasoningEffort is true.
* Use client.listModels() to check supported values for each model.
*/
reasoningEffort?: ReasoningEffort;

/**
* Override the default configuration directory location.
* When specified, the session will use this directory for storing config and state.
Expand Down Expand Up @@ -721,6 +733,7 @@ export type ResumeSessionConfig = Pick<
| "tools"
| "provider"
| "streaming"
| "reasoningEffort"
| "onPermissionRequest"
| "onUserInputRequest"
| "hooks"
Expand Down Expand Up @@ -876,6 +889,8 @@ export interface GetAuthStatusResponse {
export interface ModelCapabilities {
supports: {
vision: boolean;
/** Whether this model supports reasoning effort configuration */
reasoningEffort: boolean;
};
limits: {
max_prompt_tokens?: number;
Expand Down Expand Up @@ -917,4 +932,8 @@ export interface ModelInfo {
policy?: ModelPolicy;
/** Billing information */
billing?: ModelBilling;
/** Supported reasoning effort levels (only present if model supports reasoning effort) */
supportedReasoningEfforts?: ReasoningEffort[];
/** Default reasoning effort level (only present if model supports reasoning effort) */
defaultReasoningEffort?: ReasoningEffort;
}
1 change: 1 addition & 0 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ await client.stop()
**SessionConfig Options (for `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.
- `session_id` (str): Custom session ID
- `tools` (list): Custom tools exposed to the CLI
- `system_message` (dict): System message configuration
Expand Down
Loading
Loading