Conversation
- Add InfiniteSessionConfig type with thresholds - Add infiniteSessions option to SessionConfig - Expose workspacePath on CopilotSession - Pass config to server and capture workspace path in create/resume
- Add InfiniteSessionConfig TypedDict with thresholds - Add infinite_sessions option to SessionConfig - Expose workspace_path property on CopilotSession - Convert snake_case to camelCase for wire format
- Add InfiniteSessionConfig struct with pointer fields for optional values - Add InfiniteSessions field to SessionConfig - Add WorkspacePath() method to Session - Pass config in CreateSession and capture path in create/resume
- Add InfiniteSessionConfig class with threshold properties - Add InfiniteSessions property to SessionConfig - Add WorkspacePath property to CopilotSession - Pass config in CreateSessionAsync and capture path in create/resume
- Add InfiniteSessionConfig documentation to SessionConfig options - Document workspacePath property on CopilotSession - Add Infinite Sessions section with examples for each SDK - Document compaction events
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for infinite sessions with automatic context compaction and workspace persistence across all language SDKs (Python, Node.js, Go, and .NET). Sessions can now automatically manage context window limits through background compaction and persist state to workspace directories.
Changes:
- Added
InfiniteSessionConfigtype across all SDKs with configurable thresholds for background compaction and buffer exhaustion - Updated session objects to include
workspace_pathproperty that points to the session's persistent workspace directory - Modified create and resume session methods to accept infinite session configuration and return workspace paths
- Added comprehensive documentation with usage examples for all supported languages
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| python/copilot/types.py | Added InfiniteSessionConfig TypedDict and infinite_sessions field to SessionConfig |
| python/copilot/session.py | Added workspace_path parameter and property to CopilotSession |
| python/copilot/client.py | Updated create_session and resume_session to handle infinite sessions config and workspace path |
| python/README.md | Added Infinite Sessions documentation section with Python examples |
| nodejs/src/types.ts | Added InfiniteSessionConfig interface and infiniteSessions field to SessionConfig |
| nodejs/src/session.ts | Added workspacePath parameter and getter to CopilotSession |
| nodejs/src/index.ts | Exported InfiniteSessionConfig type |
| nodejs/src/client.ts | Updated createSession and resumeSession to handle infinite sessions config and workspace path |
| nodejs/README.md | Added Infinite Sessions documentation section with TypeScript examples |
| go/types.go | Added InfiniteSessionConfig struct and InfiniteSessions field to SessionConfig |
| go/session.go | Added workspacePath field and WorkspacePath() method to Session |
| go/client.go | Updated CreateSession and ResumeSessionWithOptions to handle infinite sessions config and workspace path |
| go/README.md | Added Infinite Sessions documentation section with Go examples |
| dotnet/src/Types.cs | Added InfiniteSessionConfig class and InfiniteSessions property to SessionConfig |
| dotnet/src/Session.cs | Added WorkspacePath parameter and property to CopilotSession |
| dotnet/src/Client.cs | Updated CreateSessionAsync and ResumeSessionAsync to handle infinite sessions config and workspace path |
| dotnet/README.md | Added Infinite Sessions documentation section with C# examples |
Comments suppressed due to low confidence (1)
go/README.md:286
- The function call references
Float64(0.95)but should becopilot.Float64(0.95)to be consistent with thecopilot.Bool(true)on line 284. This appears to be a missing package prefix.
BufferExhaustionThreshold: Float64(0.95), // Block at 95% until compaction completes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
patniko
previously approved these changes
Jan 22, 2026
- Test compaction triggers with low thresholds (0.5%/1%) - Test session.usage_info events show token limits - Test assistant.usage events - Test no compaction events when infinite sessions disabled
The compaction trigger test requires real API calls to get realistic token counts. The replay proxy doesn't provide the token usage data needed for the CLI to trigger compaction.
The test requires a CLI build with infinite sessions support. Run locally with COPILOT_CLI_PATH pointing to a local CLI build.
Add e2e tests for context compaction to Go, Python, and .NET SDKs: - Test that compaction triggers with low thresholds and emits events - Test that no compaction events occur when infinite sessions disabled - Verify session still works after compaction (context preserved via summary) These tests mirror the existing Node.js compaction tests.
patniko
approved these changes
Jan 24, 2026
This was referenced Feb 6, 2026
5 tasks
This was referenced Feb 16, 2026
icode4fuud
pushed a commit
to icode4fuud/copilot-sdk
that referenced
this pull request
Feb 23, 2026
* feat(nodejs): add infinite sessions configuration - Add InfiniteSessionConfig type with thresholds - Add infiniteSessions option to SessionConfig - Expose workspacePath on CopilotSession - Pass config to server and capture workspace path in create/resume * feat(python): add infinite sessions configuration - Add InfiniteSessionConfig TypedDict with thresholds - Add infinite_sessions option to SessionConfig - Expose workspace_path property on CopilotSession - Convert snake_case to camelCase for wire format * feat(go): add infinite sessions configuration - Add InfiniteSessionConfig struct with pointer fields for optional values - Add InfiniteSessions field to SessionConfig - Add WorkspacePath() method to Session - Pass config in CreateSession and capture path in create/resume * feat(dotnet): add infinite sessions configuration - Add InfiniteSessionConfig class with threshold properties - Add InfiniteSessions property to SessionConfig - Add WorkspacePath property to CopilotSession - Pass config in CreateSessionAsync and capture path in create/resume * docs: document infinite sessions feature in all SDKs - Add InfiniteSessionConfig documentation to SessionConfig options - Document workspacePath property on CopilotSession - Add Infinite Sessions section with examples for each SDK - Document compaction events * docs: fix missing copilot. prefix in Go README example * fix: wrap long line in Python docstring * chore: remove accidentally committed node_modules, add .gitignore * test(nodejs): add e2e tests for compaction and usage events - Test compaction triggers with low thresholds (0.5%/1%) - Test session.usage_info events show token limits - Test assistant.usage events - Test no compaction events when infinite sessions disabled * test: skip compaction trigger test in CI The compaction trigger test requires real API calls to get realistic token counts. The replay proxy doesn't provide the token usage data needed for the CLI to trigger compaction. * fix(dotnet): fix syntax errors from merge conflict resolution * test: remove usage event tests (not part of this PR) * test: enable compaction test in CI * fix(dotnet): change records to internal for JSON serializer * test: skip compaction trigger test in CI until CLI is released The test requires a CLI build with infinite sessions support. Run locally with COPILOT_CLI_PATH pointing to a local CLI build. * test: revert skip - will update after CLI release * test: add compaction e2e tests for all SDK flavors Add e2e tests for context compaction to Go, Python, and .NET SDKs: - Test that compaction triggers with low thresholds and emits events - Test that no compaction events occur when infinite sessions disabled - Verify session still works after compaction (context preserved via summary) These tests mirror the existing Node.js compaction tests. * fix: use %v format for float64 tokensRemoved in Go test * chore: update @github/copilot CLI to 0.0.394 Updates CLI dependency for Node.js SDK and shared test harness to support protocol version 2 (infinite sessions). * style: format compaction tests for all SDKs * fix: use dict instead of Dict in Python SDK * fix: correct SessionEventType import in Python compaction test * feat(go): add Float64 helper function for pointer values * test: skip .NET compaction tests due to Windows CI proxy timing issues The compaction tests require the shared test harness proxy, which has timing issues on Windows CI causing TimeoutException during fixture initialization. Tests pass on macOS and Ubuntu. * test: remove .NET compaction tests causing Windows CI fixture issues The CompactionTests class was causing the E2ETestFixture to fail initialization on Windows, which cascaded to other test classes. Removing the tests to unblock CI - the compaction feature is still tested via Node.js, Go, and Python SDKs. * Revert "test: remove .NET compaction tests causing Windows CI fixture issues" This reverts commit bc261a3. * test: enable .NET compaction tests (remove Skip attributes) Tests pass locally on macOS and the proxy timeout issue appears to be unrelated to these specific tests. The ToolsTests fixture timeout that was seen in CI is a pre-existing flaky issue on Windows. * fix: increase proxy timeout to 30s on Windows Windows CI has slower process startup times, especially when multiple test classes initialize their fixtures in parallel. Increase the proxy startup timeout from 10s to 30s on Windows to reduce flakiness.
icode4fuud
pushed a commit
to icode4fuud/copilot-sdk
that referenced
this pull request
Mar 30, 2026
* feat(nodejs): add infinite sessions configuration - Add InfiniteSessionConfig type with thresholds - Add infiniteSessions option to SessionConfig - Expose workspacePath on CopilotSession - Pass config to server and capture workspace path in create/resume * feat(python): add infinite sessions configuration - Add InfiniteSessionConfig TypedDict with thresholds - Add infinite_sessions option to SessionConfig - Expose workspace_path property on CopilotSession - Convert snake_case to camelCase for wire format * feat(go): add infinite sessions configuration - Add InfiniteSessionConfig struct with pointer fields for optional values - Add InfiniteSessions field to SessionConfig - Add WorkspacePath() method to Session - Pass config in CreateSession and capture path in create/resume * feat(dotnet): add infinite sessions configuration - Add InfiniteSessionConfig class with threshold properties - Add InfiniteSessions property to SessionConfig - Add WorkspacePath property to CopilotSession - Pass config in CreateSessionAsync and capture path in create/resume * docs: document infinite sessions feature in all SDKs - Add InfiniteSessionConfig documentation to SessionConfig options - Document workspacePath property on CopilotSession - Add Infinite Sessions section with examples for each SDK - Document compaction events * docs: fix missing copilot. prefix in Go README example * fix: wrap long line in Python docstring * chore: remove accidentally committed node_modules, add .gitignore * test(nodejs): add e2e tests for compaction and usage events - Test compaction triggers with low thresholds (0.5%/1%) - Test session.usage_info events show token limits - Test assistant.usage events - Test no compaction events when infinite sessions disabled * test: skip compaction trigger test in CI The compaction trigger test requires real API calls to get realistic token counts. The replay proxy doesn't provide the token usage data needed for the CLI to trigger compaction. * fix(dotnet): fix syntax errors from merge conflict resolution * test: remove usage event tests (not part of this PR) * test: enable compaction test in CI * fix(dotnet): change records to internal for JSON serializer * test: skip compaction trigger test in CI until CLI is released The test requires a CLI build with infinite sessions support. Run locally with COPILOT_CLI_PATH pointing to a local CLI build. * test: revert skip - will update after CLI release * test: add compaction e2e tests for all SDK flavors Add e2e tests for context compaction to Go, Python, and .NET SDKs: - Test that compaction triggers with low thresholds and emits events - Test that no compaction events occur when infinite sessions disabled - Verify session still works after compaction (context preserved via summary) These tests mirror the existing Node.js compaction tests. * fix: use %v format for float64 tokensRemoved in Go test * chore: update @github/copilot CLI to 0.0.394 Updates CLI dependency for Node.js SDK and shared test harness to support protocol version 2 (infinite sessions). * style: format compaction tests for all SDKs * fix: use dict instead of Dict in Python SDK * fix: correct SessionEventType import in Python compaction test * feat(go): add Float64 helper function for pointer values * test: skip .NET compaction tests due to Windows CI proxy timing issues The compaction tests require the shared test harness proxy, which has timing issues on Windows CI causing TimeoutException during fixture initialization. Tests pass on macOS and Ubuntu. * test: remove .NET compaction tests causing Windows CI fixture issues The CompactionTests class was causing the E2ETestFixture to fail initialization on Windows, which cascaded to other test classes. Removing the tests to unblock CI - the compaction feature is still tested via Node.js, Go, and Python SDKs. * Revert "test: remove .NET compaction tests causing Windows CI fixture issues" This reverts commit bc261a3. * test: enable .NET compaction tests (remove Skip attributes) Tests pass locally on macOS and the proxy timeout issue appears to be unrelated to these specific tests. The ToolsTests fixture timeout that was seen in CI is a pre-existing flaky issue on Windows. * fix: increase proxy timeout to 30s on Windows Windows CI has slower process startup times, especially when multiple test classes initialize their fixtures in parallel. Increase the proxy startup timeout from 10s to 30s on Windows to reduce flakiness.
This was referenced Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow configuration of infinite sessions and compaction thresholds.