From 7e794c4cf1e451cd0c366a9291f51e4c91d3c414 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Thu, 16 Apr 2026 11:24:10 -0700 Subject: [PATCH 01/10] Add sessionIdleTimeoutMs option to CopilotClientOptions Add a new optional sessionIdleTimeoutMs field to CopilotClientOptions that allows consumers to configure the server-wide session idle timeout. When set to a positive value, the SDK passes --session-idle-timeout to the CLI process. Sessions have no idle timeout by default (infinite lifetime). The minimum configurable value is 300000ms (5 minutes). Also updates the session persistence documentation to reflect the new default behavior and configuration option. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/features/session-persistence.md | 18 +++++++++++++++--- nodejs/src/client.ts | 5 +++++ nodejs/src/types.ts | 9 +++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/features/session-persistence.md b/docs/features/session-persistence.md index 19e53c385..2576ea50a 100644 --- a/docs/features/session-persistence.md +++ b/docs/features/session-persistence.md @@ -433,14 +433,26 @@ await client.deleteSession("user-123-task-456"); ## Automatic Cleanup: Idle Timeout -The CLI has a built-in 30-minute idle timeout. Sessions without activity are automatically cleaned up: +By default, sessions have **no idle timeout** and live indefinitely until explicitly disconnected or deleted. You can optionally configure a server-wide idle timeout via `CopilotClientOptions.sessionIdleTimeoutMs`: + +```typescript +const client = new CopilotClient({ + sessionIdleTimeoutMs: 30 * 60 * 1000, // 30 minutes +}); +``` + +When a timeout is configured, sessions without activity for that duration are automatically cleaned up. The minimum value is 5 minutes (300,000ms). Set to `0` or omit to disable. + +> **Note:** This option only applies when the SDK spawns the runtime process. When connecting to an existing server via `cliUrl`, the server's own timeout configuration applies. ```mermaid flowchart LR - A["⚡ Last Activity"] --> B["⏳ 25 min
timeout_warning"] --> C["🧹 30 min
destroyed"] + A["⚡ Last Activity"] --> B["⏳ ~5 min before
timeout_warning"] --> C["🧹 Timeout
destroyed"] ``` -Listen for idle events to know when work completes: +Sessions with active work (running commands, background agents) are always protected from idle cleanup, regardless of the timeout setting. + +Listen for idle events to react to session inactivity: ```typescript session.on("session.idle", (event) => { diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index c5b84a6d4..7ff77a930 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -339,6 +339,7 @@ export class CopilotClient { // Default useLoggedInUser to false when githubToken is provided, otherwise true useLoggedInUser: options.useLoggedInUser ?? (options.githubToken ? false : true), telemetry: options.telemetry, + sessionIdleTimeoutMs: options.sessionIdleTimeoutMs ?? 0, }; } @@ -1385,6 +1386,10 @@ export class CopilotClient { args.push("--no-auto-login"); } + if (this.options.sessionIdleTimeoutMs !== undefined && this.options.sessionIdleTimeoutMs > 0) { + args.push("--session-idle-timeout", this.options.sessionIdleTimeoutMs.toString()); + } + // Suppress debug/trace output that might pollute stdout const envWithoutNodeDebug = { ...this.options.env }; delete envWithoutNodeDebug.NODE_DEBUG; diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 0c901f989..150cb2457 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -182,6 +182,15 @@ export interface CopilotClientOptions { * instead of the server's default local filesystem storage. */ sessionFs?: SessionFsConfig; + + /** + * Server-wide idle timeout for sessions in milliseconds. + * Sessions without activity for this duration are automatically cleaned up. + * Set to 0 or omit to disable (sessions live indefinitely). + * Minimum value: 300000 (5 minutes). + * @default 0 (disabled) + */ + sessionIdleTimeoutMs?: number; } /** From 02d0ca246e722938188aab1aba8aa1a346ecdd02 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Thu, 16 Apr 2026 13:47:12 -0700 Subject: [PATCH 02/10] refactor: rename sessionIdleTimeoutMs to sessionIdleTimeoutSeconds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/features/session-persistence.md | 6 +++--- nodejs/src/client.ts | 6 +++--- nodejs/src/types.ts | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/features/session-persistence.md b/docs/features/session-persistence.md index 2576ea50a..a790a117a 100644 --- a/docs/features/session-persistence.md +++ b/docs/features/session-persistence.md @@ -433,15 +433,15 @@ await client.deleteSession("user-123-task-456"); ## Automatic Cleanup: Idle Timeout -By default, sessions have **no idle timeout** and live indefinitely until explicitly disconnected or deleted. You can optionally configure a server-wide idle timeout via `CopilotClientOptions.sessionIdleTimeoutMs`: +By default, sessions have **no idle timeout** and live indefinitely until explicitly disconnected or deleted. You can optionally configure a server-wide idle timeout via `CopilotClientOptions.sessionIdleTimeoutSeconds`: ```typescript const client = new CopilotClient({ - sessionIdleTimeoutMs: 30 * 60 * 1000, // 30 minutes + sessionIdleTimeoutSeconds: 30 * 60, // 30 minutes }); ``` -When a timeout is configured, sessions without activity for that duration are automatically cleaned up. The minimum value is 5 minutes (300,000ms). Set to `0` or omit to disable. +When a timeout is configured, sessions without activity for that duration are automatically cleaned up. The minimum value is 300 seconds (5 minutes). Set to `0` or omit to disable. > **Note:** This option only applies when the SDK spawns the runtime process. When connecting to an existing server via `cliUrl`, the server's own timeout configuration applies. diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index 7ff77a930..c58ea1c66 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -339,7 +339,7 @@ export class CopilotClient { // Default useLoggedInUser to false when githubToken is provided, otherwise true useLoggedInUser: options.useLoggedInUser ?? (options.githubToken ? false : true), telemetry: options.telemetry, - sessionIdleTimeoutMs: options.sessionIdleTimeoutMs ?? 0, + sessionIdleTimeoutSeconds: options.sessionIdleTimeoutSeconds ?? 0, }; } @@ -1386,8 +1386,8 @@ export class CopilotClient { args.push("--no-auto-login"); } - if (this.options.sessionIdleTimeoutMs !== undefined && this.options.sessionIdleTimeoutMs > 0) { - args.push("--session-idle-timeout", this.options.sessionIdleTimeoutMs.toString()); + if (this.options.sessionIdleTimeoutSeconds !== undefined && this.options.sessionIdleTimeoutSeconds > 0) { + args.push("--session-idle-timeout", this.options.sessionIdleTimeoutSeconds.toString()); } // Suppress debug/trace output that might pollute stdout diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 150cb2457..4c715d221 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -184,13 +184,13 @@ export interface CopilotClientOptions { sessionFs?: SessionFsConfig; /** - * Server-wide idle timeout for sessions in milliseconds. + * Server-wide idle timeout for sessions in seconds. * Sessions without activity for this duration are automatically cleaned up. * Set to 0 or omit to disable (sessions live indefinitely). - * Minimum value: 300000 (5 minutes). + * Minimum value: 300 (5 minutes). * @default 0 (disabled) */ - sessionIdleTimeoutMs?: number; + sessionIdleTimeoutSeconds?: number; } /** From 282f1a49eab2c0a5dc47bdf553ed1da47eb41e37 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Thu, 16 Apr 2026 16:00:10 -0700 Subject: [PATCH 03/10] fix: correct @default tag for sessionIdleTimeoutSeconds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 4c715d221..59cbffac9 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -188,7 +188,7 @@ export interface CopilotClientOptions { * Sessions without activity for this duration are automatically cleaned up. * Set to 0 or omit to disable (sessions live indefinitely). * Minimum value: 300 (5 minutes). - * @default 0 (disabled) + * @default undefined (disabled) */ sessionIdleTimeoutSeconds?: number; } From ede32da58537e9ab7b63ac25d284dc738a444bb3 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Thu, 16 Apr 2026 16:34:23 -0700 Subject: [PATCH 04/10] fix: format client.ts with prettier Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/src/client.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index c58ea1c66..fad4e7054 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -1386,8 +1386,14 @@ export class CopilotClient { args.push("--no-auto-login"); } - if (this.options.sessionIdleTimeoutSeconds !== undefined && this.options.sessionIdleTimeoutSeconds > 0) { - args.push("--session-idle-timeout", this.options.sessionIdleTimeoutSeconds.toString()); + if ( + this.options.sessionIdleTimeoutSeconds !== undefined && + this.options.sessionIdleTimeoutSeconds > 0 + ) { + args.push( + "--session-idle-timeout", + this.options.sessionIdleTimeoutSeconds.toString() + ); } // Suppress debug/trace output that might pollute stdout From 8ea4506670b37443ca551ee8154d1b78fbbb5b50 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 10:08:34 -0700 Subject: [PATCH 05/10] feat: add sessionIdleTimeoutSeconds to Go, Python, and .NET SDKs Add the session idle timeout option across all remaining SDK languages, consistent with the Node.js implementation and the runtime CLI's --session-idle-timeout flag. - Go: SessionIdleTimeoutSeconds int on ClientOptions - Python: session_idle_timeout_seconds on SubprocessConfig - .NET: SessionIdleTimeoutSeconds int? on CopilotClientOptions Each SDK passes --session-idle-timeout to the CLI when the value is positive, and omits it otherwise (disabled by default). Includes unit tests for all three languages and updates the .NET clone test to cover the new property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Client.cs | 5 +++++ dotnet/src/Types.cs | 11 +++++++++++ dotnet/test/ClientTests.cs | 19 +++++++++++++++++++ dotnet/test/CloneTests.cs | 2 ++ go/client.go | 10 ++++++++++ go/client_test.go | 20 ++++++++++++++++++++ go/types.go | 7 +++++++ python/copilot/client.py | 11 +++++++++++ python/test_client.py | 20 ++++++++++++++++++++ 9 files changed, 105 insertions(+) diff --git a/dotnet/src/Client.cs b/dotnet/src/Client.cs index 3a161a391..ae507a3c1 100644 --- a/dotnet/src/Client.cs +++ b/dotnet/src/Client.cs @@ -1190,6 +1190,11 @@ private async Task VerifyProtocolVersionAsync(Connection connection, Cancellatio args.Add("--no-auto-login"); } + if (options.SessionIdleTimeoutSeconds is > 0) + { + args.AddRange(["--session-idle-timeout", options.SessionIdleTimeoutSeconds.Value.ToString(CultureInfo.InvariantCulture)]); + } + var (fileName, processArgs) = ResolveCliCommand(cliPath, args); var startInfo = new ProcessStartInfo diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index e42c34f5d..41add67c0 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -69,6 +69,7 @@ protected CopilotClientOptions(CopilotClientOptions? other) UseStdio = other.UseStdio; OnListModels = other.OnListModels; SessionFs = other.SessionFs; + SessionIdleTimeoutSeconds = other.SessionIdleTimeoutSeconds; } /// @@ -165,6 +166,16 @@ public string? GithubToken /// public TelemetryConfig? Telemetry { get; set; } + /// + /// Server-wide idle timeout for sessions in seconds. + /// Sessions without activity for this duration are automatically cleaned up. + /// Set to 0 or leave as to disable (sessions live indefinitely). + /// Minimum value: 300 (5 minutes). + /// This option is only used when the SDK spawns the CLI process; it is ignored + /// when connecting to an external server via . + /// + public int? SessionIdleTimeoutSeconds { get; set; } + /// /// Creates a shallow clone of this instance. /// diff --git a/dotnet/test/ClientTests.cs b/dotnet/test/ClientTests.cs index c62c5bc3f..e8c36776f 100644 --- a/dotnet/test/ClientTests.cs +++ b/dotnet/test/ClientTests.cs @@ -216,6 +216,25 @@ public void Should_Throw_When_UseLoggedInUser_Used_With_CliUrl() }); } + [Fact] + public void Should_Default_SessionIdleTimeoutSeconds_To_Null() + { + var options = new CopilotClientOptions(); + + Assert.Null(options.SessionIdleTimeoutSeconds); + } + + [Fact] + public void Should_Accept_SessionIdleTimeoutSeconds_Option() + { + var options = new CopilotClientOptions + { + SessionIdleTimeoutSeconds = 600 + }; + + Assert.Equal(600, options.SessionIdleTimeoutSeconds); + } + [Fact] public async Task Should_Not_Throw_When_Disposing_Session_After_Stopping_Client() { diff --git a/dotnet/test/CloneTests.cs b/dotnet/test/CloneTests.cs index 5c326dcc4..8ed45b062 100644 --- a/dotnet/test/CloneTests.cs +++ b/dotnet/test/CloneTests.cs @@ -26,6 +26,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties() Environment = new Dictionary { ["KEY"] = "value" }, GitHubToken = "ghp_test", UseLoggedInUser = false, + SessionIdleTimeoutSeconds = 600, }; var clone = original.Clone(); @@ -42,6 +43,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties() Assert.Equal(original.Environment, clone.Environment); Assert.Equal(original.GitHubToken, clone.GitHubToken); Assert.Equal(original.UseLoggedInUser, clone.UseLoggedInUser); + Assert.Equal(original.SessionIdleTimeoutSeconds, clone.SessionIdleTimeoutSeconds); } [Fact] diff --git a/go/client.go b/go/client.go index 4eb56e639..86d5e6e36 100644 --- a/go/client.go +++ b/go/client.go @@ -215,6 +215,12 @@ func NewClient(options *ClientOptions) *Client { sessionFs := *options.SessionFs opts.SessionFs = &sessionFs } + if options.Telemetry != nil { + opts.Telemetry = options.Telemetry + } + if options.SessionIdleTimeoutSeconds > 0 { + opts.SessionIdleTimeoutSeconds = options.SessionIdleTimeoutSeconds + } } // Default Env to current environment if not set @@ -1378,6 +1384,10 @@ func (c *Client) startCLIServer(ctx context.Context) error { args = append(args, "--no-auto-login") } + if c.options.SessionIdleTimeoutSeconds > 0 { + args = append(args, "--session-idle-timeout", strconv.Itoa(c.options.SessionIdleTimeoutSeconds)) + } + // If CLIPath is a .js file, run it with node // Note we can't rely on the shebang as Windows doesn't support it command := cliPath diff --git a/go/client_test.go b/go/client_test.go index 8840e8269..83e791333 100644 --- a/go/client_test.go +++ b/go/client_test.go @@ -391,6 +391,26 @@ func TestClient_EnvOptions(t *testing.T) { }) } +func TestClient_SessionIdleTimeoutSeconds(t *testing.T) { + t.Run("should store SessionIdleTimeoutSeconds option", func(t *testing.T) { + client := NewClient(&ClientOptions{ + SessionIdleTimeoutSeconds: 600, + }) + + if client.options.SessionIdleTimeoutSeconds != 600 { + t.Errorf("Expected SessionIdleTimeoutSeconds to be 600, got %d", client.options.SessionIdleTimeoutSeconds) + } + }) + + t.Run("should default SessionIdleTimeoutSeconds to zero", func(t *testing.T) { + client := NewClient(&ClientOptions{}) + + if client.options.SessionIdleTimeoutSeconds != 0 { + t.Errorf("Expected SessionIdleTimeoutSeconds to be 0, got %d", client.options.SessionIdleTimeoutSeconds) + } + }) +} + func findCLIPathForTest() string { abs, _ := filepath.Abs("../nodejs/node_modules/@github/copilot/index.js") if fileExistsForTest(abs) { diff --git a/go/types.go b/go/types.go index e11d21402..a80408af8 100644 --- a/go/types.go +++ b/go/types.go @@ -71,6 +71,13 @@ type ClientOptions struct { // When non-nil, COPILOT_OTEL_ENABLED=true is set and any populated fields // are mapped to the corresponding environment variables. Telemetry *TelemetryConfig + // SessionIdleTimeoutSeconds configures the server-wide session idle timeout in seconds. + // Sessions without activity for this duration are automatically cleaned up. + // Set to 0 or leave unset to disable (sessions live indefinitely). + // Minimum value: 300 (5 minutes). + // This option is only used when the SDK spawns the CLI process; it is ignored + // when connecting to an external server via CLIUrl. + SessionIdleTimeoutSeconds int } // TelemetryConfig configures OpenTelemetry integration for the Copilot CLI process. diff --git a/python/copilot/client.py b/python/copilot/client.py index a51940a96..12fb88fcf 100644 --- a/python/copilot/client.py +++ b/python/copilot/client.py @@ -150,6 +150,14 @@ class SubprocessConfig: session_fs: SessionFsConfig | None = None """Connection-level session filesystem provider configuration.""" + session_idle_timeout_seconds: int | None = None + """Server-wide session idle timeout in seconds. + + Sessions without activity for this duration are automatically cleaned up. + Set to ``None`` or ``0`` to disable (sessions live indefinitely). + Minimum value: 300 (5 minutes). + """ + @dataclass class ExternalServerConfig: @@ -2261,6 +2269,9 @@ async def _start_cli_server(self) -> None: if not cfg.use_logged_in_user: args.append("--no-auto-login") + if cfg.session_idle_timeout_seconds is not None and cfg.session_idle_timeout_seconds > 0: + args.extend(["--session-idle-timeout", str(cfg.session_idle_timeout_seconds)]) + # If cli_path is a .js file, run it with node # Note that we can't rely on the shebang as Windows doesn't support it if cli_path.endswith(".js"): diff --git a/python/test_client.py b/python/test_client.py index eb132cd0d..79f264521 100644 --- a/python/test_client.py +++ b/python/test_client.py @@ -204,6 +204,26 @@ def test_explicit_use_logged_in_user_false_without_token(self): assert client._config.use_logged_in_user is False +class TestSessionIdleTimeoutSeconds: + def test_accepts_session_idle_timeout_seconds(self): + client = CopilotClient( + SubprocessConfig( + cli_path=CLI_PATH, + session_idle_timeout_seconds=600, + log_level="error", + ) + ) + assert isinstance(client._config, SubprocessConfig) + assert client._config.session_idle_timeout_seconds == 600 + + def test_default_session_idle_timeout_seconds_is_none(self): + client = CopilotClient( + SubprocessConfig(cli_path=CLI_PATH, log_level="error") + ) + assert isinstance(client._config, SubprocessConfig) + assert client._config.session_idle_timeout_seconds is None + + class TestOverridesBuiltInTool: @pytest.mark.asyncio async def test_overrides_built_in_tool_sent_in_tool_definition(self): From f614e6c901dc844a2657ae08adf04910533f003e Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 10:19:18 -0700 Subject: [PATCH 06/10] docs: add external-server caveat to Node.js and Python idle timeout docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/src/types.ts | 2 ++ python/copilot/client.py | 1 + 2 files changed, 3 insertions(+) diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 966e9c7b8..117d84c28 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -190,6 +190,8 @@ export interface CopilotClientOptions { * Sessions without activity for this duration are automatically cleaned up. * Set to 0 or omit to disable (sessions live indefinitely). * Minimum value: 300 (5 minutes). + * This option is only used when the SDK spawns the CLI process; it is ignored + * when connecting to an external server via {@link cliUrl}. * @default undefined (disabled) */ sessionIdleTimeoutSeconds?: number; diff --git a/python/copilot/client.py b/python/copilot/client.py index 12fb88fcf..3abd386ce 100644 --- a/python/copilot/client.py +++ b/python/copilot/client.py @@ -156,6 +156,7 @@ class SubprocessConfig: Sessions without activity for this duration are automatically cleaned up. Set to ``None`` or ``0`` to disable (sessions live indefinitely). Minimum value: 300 (5 minutes). + This option is only used when the SDK spawns the CLI process. """ From 5db3a8a598fad88657219309b0dbe2cfb79f760d Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 10:31:06 -0700 Subject: [PATCH 07/10] test: add Node.js unit tests for sessionIdleTimeoutSeconds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/test/client.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nodejs/test/client.test.ts b/nodejs/test/client.test.ts index 4ea74b576..23824061c 100644 --- a/nodejs/test/client.test.ts +++ b/nodejs/test/client.test.ts @@ -1258,4 +1258,23 @@ describe("CopilotClient", () => { rpcSpy.mockRestore(); }); }); + + describe("sessionIdleTimeoutSeconds", () => { + it("should default to 0 when not specified", () => { + const client = new CopilotClient({ + logLevel: "error", + }); + + expect((client as any).options.sessionIdleTimeoutSeconds).toBe(0); + }); + + it("should store a custom value", () => { + const client = new CopilotClient({ + sessionIdleTimeoutSeconds: 600, + logLevel: "error", + }); + + expect((client as any).options.sessionIdleTimeoutSeconds).toBe(600); + }); + }); }); From 93e1c4ec2f1cbd6d5ed1ffa3c0a11960fbbdc9c5 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 10:33:52 -0700 Subject: [PATCH 08/10] fix: format test_client.py with ruff Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- python/test_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/test_client.py b/python/test_client.py index 79f264521..ac1b735bf 100644 --- a/python/test_client.py +++ b/python/test_client.py @@ -217,9 +217,7 @@ def test_accepts_session_idle_timeout_seconds(self): assert client._config.session_idle_timeout_seconds == 600 def test_default_session_idle_timeout_seconds_is_none(self): - client = CopilotClient( - SubprocessConfig(cli_path=CLI_PATH, log_level="error") - ) + client = CopilotClient(SubprocessConfig(cli_path=CLI_PATH, log_level="error")) assert isinstance(client._config, SubprocessConfig) assert client._config.session_idle_timeout_seconds is None From eb496ba29037186c79d30e87063af4759586052b Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 10:49:55 -0700 Subject: [PATCH 09/10] docs: remove incorrect minimum value from idle timeout docs The runtime does not enforce a minimum value for the session idle timeout - any positive value is accepted. Remove the 'Minimum value: 300 (5 minutes)' note from all SDK docstrings and docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/features/session-persistence.md | 2 +- dotnet/src/Types.cs | 1 - go/types.go | 1 - nodejs/src/types.ts | 1 - python/copilot/client.py | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/features/session-persistence.md b/docs/features/session-persistence.md index a790a117a..53caaff11 100644 --- a/docs/features/session-persistence.md +++ b/docs/features/session-persistence.md @@ -441,7 +441,7 @@ const client = new CopilotClient({ }); ``` -When a timeout is configured, sessions without activity for that duration are automatically cleaned up. The minimum value is 300 seconds (5 minutes). Set to `0` or omit to disable. +When a timeout is configured, sessions without activity for that duration are automatically cleaned up. Set to `0` or omit to disable. > **Note:** This option only applies when the SDK spawns the runtime process. When connecting to an existing server via `cliUrl`, the server's own timeout configuration applies. diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index 41add67c0..d84cd835f 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -170,7 +170,6 @@ public string? GithubToken /// Server-wide idle timeout for sessions in seconds. /// Sessions without activity for this duration are automatically cleaned up. /// Set to 0 or leave as to disable (sessions live indefinitely). - /// Minimum value: 300 (5 minutes). /// This option is only used when the SDK spawns the CLI process; it is ignored /// when connecting to an external server via . /// diff --git a/go/types.go b/go/types.go index a80408af8..14905ec13 100644 --- a/go/types.go +++ b/go/types.go @@ -74,7 +74,6 @@ type ClientOptions struct { // SessionIdleTimeoutSeconds configures the server-wide session idle timeout in seconds. // Sessions without activity for this duration are automatically cleaned up. // Set to 0 or leave unset to disable (sessions live indefinitely). - // Minimum value: 300 (5 minutes). // This option is only used when the SDK spawns the CLI process; it is ignored // when connecting to an external server via CLIUrl. SessionIdleTimeoutSeconds int diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 117d84c28..bb4e862b4 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -189,7 +189,6 @@ export interface CopilotClientOptions { * Server-wide idle timeout for sessions in seconds. * Sessions without activity for this duration are automatically cleaned up. * Set to 0 or omit to disable (sessions live indefinitely). - * Minimum value: 300 (5 minutes). * This option is only used when the SDK spawns the CLI process; it is ignored * when connecting to an external server via {@link cliUrl}. * @default undefined (disabled) diff --git a/python/copilot/client.py b/python/copilot/client.py index 3abd386ce..cf89476ed 100644 --- a/python/copilot/client.py +++ b/python/copilot/client.py @@ -155,7 +155,6 @@ class SubprocessConfig: Sessions without activity for this duration are automatically cleaned up. Set to ``None`` or ``0`` to disable (sessions live indefinitely). - Minimum value: 300 (5 minutes). This option is only used when the SDK spawns the CLI process. """ From 3eda99a19b519a20535ff84627bfef2bbbbabd8c Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 21 Apr 2026 11:10:12 -0700 Subject: [PATCH 10/10] fix: copy SessionIdleTimeoutSeconds unconditionally in Go NewClient() The option was only copied when > 0, which silently normalized negative inputs. Other SDKs preserve the caller's value and gate only at spawn time. Align Go to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- go/client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/go/client.go b/go/client.go index 86d5e6e36..0c72e963f 100644 --- a/go/client.go +++ b/go/client.go @@ -218,9 +218,7 @@ func NewClient(options *ClientOptions) *Client { if options.Telemetry != nil { opts.Telemetry = options.Telemetry } - if options.SessionIdleTimeoutSeconds > 0 { - opts.SessionIdleTimeoutSeconds = options.SessionIdleTimeoutSeconds - } + opts.SessionIdleTimeoutSeconds = options.SessionIdleTimeoutSeconds } // Default Env to current environment if not set