Add configurable session idle timeout option#1093
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Node SDK client option to configure a server-wide session idle timeout and wires it through to the spawned Copilot CLI runtime via a new --session-idle-timeout argument, with accompanying documentation updates.
Changes:
- Adds
sessionIdleTimeoutMs?: numbertoCopilotClientOptionswith documented defaults/minimums. - Sets a default of
0(disabled) and forwards--session-idle-timeout <ms>when configured to a positive value. - Updates session persistence docs to describe the new default behavior and configuration caveats (only applies when the SDK spawns the runtime).
Show a summary per file
| File | Description |
|---|---|
| nodejs/src/types.ts | Introduces the new CopilotClientOptions.sessionIdleTimeoutMs option and documents intended semantics. |
| nodejs/src/client.ts | Applies defaulting and forwards the new option to the CLI as --session-idle-timeout. |
| docs/features/session-persistence.md | Documents the new option, updated defaults, and cliUrl caveat. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f3008df to
ede32da
Compare
…sion-idle-timeout-option
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1093 · ● 603.8K
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 <seconds> 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>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1093 · ● 278.9K
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1093 · ● 291.2K
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
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>
This comment has been minimized.
This comment has been minimized.
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>
Cross-SDK Consistency Review ✅This PR maintains excellent cross-language consistency for the new
Observations:
Minor note (no action needed): Go uses a non-nullable No consistency gaps found. 🎉
|
Summary
Adds SDK-side support for configurable session idle timeout across all four SDK languages, addressing github/copilot-sdk-partners#28.
The corresponding runtime changes that add the
--session-idle-timeoutCLI arg are in github/copilot-agent-runtime#6414.Changes
Node.js
nodejs/src/types.ts-- AddedsessionIdleTimeoutSeconds?: numbertoCopilotClientOptions.nodejs/src/client.ts-- Defaults to0(disabled); passes--session-idle-timeout <seconds>to the CLI when positive.nodejs/test/client.test.ts-- Unit tests for default and custom values.Go
go/types.go-- AddedSessionIdleTimeoutSeconds inttoClientOptions.go/client.go-- Copies the option inNewClient()and passes--session-idle-timeout <seconds>to the CLI when positive.go/client_test.go-- Unit tests for default and custom values.Python
python/copilot/client.py-- Addedsession_idle_timeout_seconds: int | None = NonetoSubprocessConfig; passes--session-idle-timeout <seconds>to the CLI when positive.python/test_client.py-- Unit tests for default and custom values..NET
dotnet/src/Types.cs-- AddedSessionIdleTimeoutSeconds int?toCopilotClientOptions(including copy constructor).dotnet/src/Client.cs-- Passes--session-idle-timeout <seconds>to the CLI when positive.dotnet/test/ClientTests.cs-- Unit tests for default and custom values.dotnet/test/CloneTests.cs-- Clone test updated.Docs
docs/features/session-persistence.md-- Updated the "Automatic Cleanup: Idle Timeout" section to reflect that sessions now have no idle timeout by default and document the new option.Notes
CopilotClientOptionsfield (server/process level), not a per-session config.cliUrlto connect to an existing server).