Commit b4ef955
Add configurable session idle timeout option (#1093)
* 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>
* refactor: rename sessionIdleTimeoutMs to sessionIdleTimeoutSeconds
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: correct @default tag for sessionIdleTimeoutSeconds
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: format client.ts with prettier
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* 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 <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>
* docs: add external-server caveat to Node.js and Python idle timeout docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: add Node.js unit tests for sessionIdleTimeoutSeconds
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: format test_client.py with ruff
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* 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>
* 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>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a3e273c commit b4ef955
13 files changed
Lines changed: 154 additions & 3 deletions
File tree
- docs/features
- dotnet
- src
- test
- go
- nodejs
- src
- test
- python
- copilot
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
437 | 447 | | |
438 | 448 | | |
439 | 449 | | |
440 | | - | |
| 450 | + | |
441 | 451 | | |
442 | 452 | | |
443 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
444 | 456 | | |
445 | 457 | | |
446 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1193 | 1198 | | |
1194 | 1199 | | |
1195 | 1200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
219 | 238 | | |
220 | 239 | | |
221 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| |||
1378 | 1382 | | |
1379 | 1383 | | |
1380 | 1384 | | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1381 | 1389 | | |
1382 | 1390 | | |
1383 | 1391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
394 | 414 | | |
395 | 415 | | |
396 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| |||
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1417 | 1428 | | |
1418 | 1429 | | |
1419 | 1430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
187 | 197 | | |
188 | 198 | | |
189 | 199 | | |
| |||
0 commit comments