Skip to content
Merged
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
4 changes: 4 additions & 0 deletions dotnet/src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
config.ClientName,
config.ReasoningEffort,
config.ReasoningSummary,
config.ContextTier,
config.Tools?.Select(ToolDefinition.FromAIFunction).ToList(),
wireSystemMessage,
toolFilter.AvailableTools,
Expand Down Expand Up @@ -1083,6 +1084,7 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
config.Model,
config.ReasoningEffort,
config.ReasoningSummary,
config.ContextTier,
config.Tools?.Select(ToolDefinition.FromAIFunction).ToList(),
wireSystemMessage,
toolFilter.AvailableTools,
Expand Down Expand Up @@ -2274,6 +2276,7 @@ internal record CreateSessionRequest(
string? ClientName,
string? ReasoningEffort,
ReasoningSummary? ReasoningSummary,
string? ContextTier,
IList<ToolDefinition>? Tools,
SystemMessageConfig? SystemMessage,
IList<string>? AvailableTools,
Expand Down Expand Up @@ -2359,6 +2362,7 @@ internal record ResumeSessionRequest(
string? Model,
string? ReasoningEffort,
ReasoningSummary? ReasoningSummary,
string? ContextTier,
IList<ToolDefinition>? Tools,
SystemMessageConfig? SystemMessage,
IList<string>? AvailableTools,
Expand Down
71 changes: 69 additions & 2 deletions dotnet/src/Generated/Rpc.cs

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

7 changes: 7 additions & 0 deletions dotnet/src/Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,7 @@ protected SessionConfigBase(SessionConfigBase? other)
ManageScheduleEnabled = other.ManageScheduleEnabled;
ReasoningEffort = other.ReasoningEffort;
ReasoningSummary = other.ReasoningSummary;
ContextTier = other.ContextTier;
CreateSessionFsProvider = other.CreateSessionFsProvider;
GitHubToken = other.GitHubToken;
RemoteSession = other.RemoteSession;
Expand Down Expand Up @@ -2494,6 +2495,12 @@ protected SessionConfigBase(SessionConfigBase? other)
/// </remarks>
public ReasoningSummary? ReasoningSummary { get; set; }

/// <summary>
/// Context window tier for models that support it.
/// Valid values: "default", "long_context".
/// </summary>
public string? ContextTier { get; set; }
Copy link
Copy Markdown
Collaborator

@stephentoub stephentoub May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be used a strongly-typed string enum, no?


/// <summary>Per-property overrides for model capabilities, deep-merged over runtime defaults.</summary>
public ModelCapabilitiesOverride? ModelCapabilities { get; set; }

Expand Down
15 changes: 15 additions & 0 deletions dotnet/test/Unit/CloneTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void SessionConfig_Clone_CopiesAllProperties()
Model = "gpt-4",
ReasoningEffort = "high",
ReasoningSummary = ReasoningSummary.Detailed,
ContextTier = "long_context",
ConfigDirectory = "/config",
AvailableTools = ["tool1", "tool2"],
ExcludedTools = ["tool3"],
Expand Down Expand Up @@ -107,6 +108,7 @@ public void SessionConfig_Clone_CopiesAllProperties()
Assert.Equal(original.Model, clone.Model);
Assert.Equal(original.ReasoningEffort, clone.ReasoningEffort);
Assert.Equal(original.ReasoningSummary, clone.ReasoningSummary);
Assert.Equal(original.ContextTier, clone.ContextTier);
Assert.Equal(original.ConfigDirectory, clone.ConfigDirectory);
Assert.Equal(original.AvailableTools, clone.AvailableTools);
Assert.Equal(original.ExcludedTools, clone.ExcludedTools);
Expand Down Expand Up @@ -379,6 +381,19 @@ public void ResumeSessionConfig_Clone_CopiesReasoningSummary()
Assert.Equal(original.ReasoningSummary, clone.ReasoningSummary);
}

[Fact]
public void ResumeSessionConfig_Clone_CopiesContextTier()
{
var original = new ResumeSessionConfig
{
ContextTier = "long_context",
};

var clone = original.Clone();

Assert.Equal(original.ContextTier, clone.ContextTier);
}

[Fact]
public void ResumeSessionConfig_Clone_CopiesPluginDirectoriesAndLargeOutput()
{
Expand Down
2 changes: 2 additions & 0 deletions go/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses
req.ClientName = config.ClientName
req.ReasoningEffort = config.ReasoningEffort
req.ReasoningSummary = config.ReasoningSummary
req.ContextTier = config.ContextTier
req.ConfigDir = config.ConfigDirectory
if config.EnableConfigDiscovery {
req.EnableConfigDiscovery = Bool(true)
Expand Down Expand Up @@ -917,6 +918,7 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string,
req.Model = config.Model
req.ReasoningEffort = config.ReasoningEffort
req.ReasoningSummary = config.ReasoningSummary
req.ContextTier = config.ContextTier
systemMessage := c.systemMessageForMode(config.SystemMessage)
wireSystemMessage, transformCallbacks := extractTransformCallbacks(systemMessage)
req.SystemMessage = wireSystemMessage
Expand Down
32 changes: 32 additions & 0 deletions go/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,38 @@ func TestSessionRequests_ReasoningSummary(t *testing.T) {
})
}

func TestSessionRequests_ContextTier(t *testing.T) {
t.Run("create includes contextTier in JSON when set", func(t *testing.T) {
req := createSessionRequest{ContextTier: "long_context"}
data, err := json.Marshal(req)
if err != nil {
t.Fatalf("Failed to marshal: %v", err)
}
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
t.Fatalf("Failed to unmarshal: %v", err)
}
if m["contextTier"] != "long_context" {
t.Errorf("Expected contextTier to be 'long_context', got %v", m["contextTier"])
}
})

t.Run("resume includes contextTier in JSON when set", func(t *testing.T) {
req := resumeSessionRequest{SessionID: "s1", ContextTier: "default"}
data, err := json.Marshal(req)
if err != nil {
t.Fatalf("Failed to marshal: %v", err)
}
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
t.Fatalf("Failed to unmarshal: %v", err)
}
if m["contextTier"] != "default" {
t.Errorf("Expected contextTier to be 'default', got %v", m["contextTier"])
}
})
}

func TestSessionRequests_PluginDirectoriesAndLargeOutput(t *testing.T) {
pluginDirs := []string{"/tmp/plugins/a", "/tmp/plugins/b"}
enabled := true
Expand Down
20 changes: 18 additions & 2 deletions go/rpc/zrpc.go

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

8 changes: 8 additions & 0 deletions go/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@ type SessionConfig struct {
// ReasoningSummary mode for models that support configurable reasoning summaries.
// Use ReasoningSummaryNone to suppress summary output regardless of whether reasoning is enabled.
ReasoningSummary ReasoningSummary
// ContextTier pins the session to a context window tier for models that support it.
// Valid values: "default", "long_context".
ContextTier string
// ConfigDirectory overrides the default configuration directory location.
// When specified, the session will use this directory for storing config and state.
ConfigDirectory string
Expand Down Expand Up @@ -1294,6 +1297,9 @@ type ResumeSessionConfig struct {
// ReasoningSummary mode for models that support configurable reasoning summaries.
// Use ReasoningSummaryNone to suppress summary output regardless of whether reasoning is enabled.
ReasoningSummary ReasoningSummary
// ContextTier pins the session to a context window tier for models that support it.
// Valid values: "default", "long_context".
ContextTier string
// OnPermissionRequest is an optional handler for permission requests from the server.
// When nil, permission requests are surfaced as events and left pending for the
// consumer to resolve via pending permission RPCs.
Expand Down Expand Up @@ -1654,6 +1660,7 @@ type createSessionRequest struct {
ClientName string `json:"clientName,omitempty"`
ReasoningEffort string `json:"reasoningEffort,omitempty"`
ReasoningSummary ReasoningSummary `json:"reasoningSummary,omitempty"`
ContextTier string `json:"contextTier,omitempty"`
Tools []Tool `json:"tools,omitempty"`
SystemMessage *SystemMessageConfig `json:"systemMessage,omitempty"`
AvailableTools []string `json:"availableTools"`
Expand Down Expand Up @@ -1731,6 +1738,7 @@ type resumeSessionRequest struct {
Model string `json:"model,omitempty"`
ReasoningEffort string `json:"reasoningEffort,omitempty"`
ReasoningSummary ReasoningSummary `json:"reasoningSummary,omitempty"`
ContextTier string `json:"contextTier,omitempty"`
Tools []Tool `json:"tools,omitempty"`
SystemMessage *SystemMessageConfig `json:"systemMessage,omitempty"`
AvailableTools []string `json:"availableTools"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static CreateSessionRequest buildCreateRequest(SessionConfig config, String sess
request.setClientName(config.getClientName());
request.setReasoningEffort(config.getReasoningEffort());
request.setReasoningSummary(config.getReasoningSummary());
request.setContextTier(config.getContextTier());
request.setTools(config.getTools());
request.setSystemMessage(config.getSystemMessage());
request.setAvailableTools(config.getAvailableTools());
Expand Down Expand Up @@ -217,6 +218,7 @@ static ResumeSessionRequest buildResumeRequest(String sessionId, ResumeSessionCo
request.setClientName(config.getClientName());
request.setReasoningEffort(config.getReasoningEffort());
request.setReasoningSummary(config.getReasoningSummary());
request.setContextTier(config.getContextTier());
request.setTools(config.getTools());
request.setSystemMessage(config.getSystemMessage());
request.setAvailableTools(config.getAvailableTools());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public final class CreateSessionRequest {
@JsonProperty("reasoningSummary")
private String reasoningSummary;

@JsonProperty("contextTier")
private String contextTier;

@JsonProperty("tools")
private List<ToolDefinition> tools;

Expand Down Expand Up @@ -234,6 +237,16 @@ public void setReasoningSummary(String reasoningSummary) {
this.reasoningSummary = reasoningSummary;
}

/** Gets the context window tier. @return the context window tier */
public String getContextTier() {
return contextTier;
}

/** Sets the context window tier. @param contextTier the context window tier */
public void setContextTier(String contextTier) {
this.contextTier = contextTier;
}

/** Gets the tools. @return the tool definitions */
public List<ToolDefinition> getTools() {
return tools == null ? null : Collections.unmodifiableList(tools);
Expand Down
Loading
Loading