Skip to content

Add rewind support across all SDKs - #2321

Merged
stephentoub merged 4 commits into
mainfrom
stephentoub-add-rewind-options
Aug 12, 2026
Merged

Add rewind support across all SDKs#2321
stephentoub merged 4 commits into
mainfrom
stephentoub-add-rewind-options

Conversation

@stephentoub

Copy link
Copy Markdown
Collaborator

copilot-agent-runtime now supports rewinding conversation history and tracked file changes, but SDK sessions must explicitly opt into file-change tracking. This change exposes that opt-in consistently across every supported SDK.

Summary

  • Add the optional enableFileChangeTracking session setting to Node, Python, Go, .NET, Rust, and Java.
  • Forward the setting through both session creation and resumption requests while preserving the existing omitted-by-default behavior.
  • Extend request-shape and clone coverage for the new option.
  • Add a shared replay scenario and language-native E2E tests that create a tracked file, list and preview the rewind point, rewind conversation and files, and verify the file and discarded events are removed.

Testing

Not run locally per request; validation is deferred to CI.

Generated by Copilot

Expose file change tracking on create and resume session options in all six SDKs, and add shared replay coverage that verifies conversation-and-file rewind behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 91a7e2ab-88a5-4365-accf-cbea1e1391e9
Copilot AI balanced review requested due to automatic review settings August 12, 2026 16:00
@stephentoub
stephentoub requested a review from a team as a code owner August 12, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds opt-in file-change tracking across all SDKs, enabling rewind operations to restore conversation history and modified files.

Changes:

  • Exposes and forwards enableFileChangeTracking during session creation and resumption.
  • Covers request serialization and configuration cloning.
  • Adds a shared replay fixture and E2E coverage for file and conversation rewind.
Show a summary per file
File Description
test/snapshots/rewind/should_restore_tracked_file_and_conversation.yaml Adds the shared rewind replay scenario.
rust/tests/session_test.rs Tests Rust request forwarding.
rust/tests/e2e/rewind.rs Adds Rust rewind E2E coverage.
rust/tests/e2e.rs Registers the Rust E2E module.
rust/src/wire.rs Adds the option to Rust wire requests.
rust/src/types.rs Exposes and forwards the Rust setting.
python/test_client.py Tests Python request forwarding.
python/e2e/test_rewind_e2e.py Adds Python rewind E2E coverage.
python/copilot/client.py Exposes and forwards the Python option.
nodejs/test/e2e/rewind.e2e.test.ts Adds Node.js rewind E2E coverage.
nodejs/test/client.test.ts Tests Node.js request forwarding.
nodejs/src/types.ts Adds the Node.js configuration property.
nodejs/src/client.ts Forwards the Node.js setting.
java/src/test/java/com/github/copilot/SessionRequestBuilderTest.java Tests Java request construction.
java/src/test/java/com/github/copilot/e2e/RewindIT.java Adds Java rewind E2E coverage.
java/src/test/java/com/github/copilot/ConfigCloneTest.java Tests Java configuration cloning.
java/src/main/java/com/github/copilot/SessionRequestBuilder.java Forwards the Java setting.
java/src/main/java/com/github/copilot/rpc/SessionConfig.java Adds Java create-session configuration.
java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java Adds the Java resume request field.
java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java Adds Java resume-session configuration.
java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java Adds the Java create request field.
go/types.go Adds Go configuration and wire fields.
go/internal/e2e/rewind_e2e_test.go Adds Go rewind E2E coverage.
go/client.go Forwards the Go setting.
go/client_test.go Tests Go request forwarding.
dotnet/test/Unit/SerializationTests.cs Tests .NET request serialization.
dotnet/test/Unit/CloneTests.cs Tests .NET configuration cloning.
dotnet/test/E2E/RewindE2ETests.cs Adds .NET rewind E2E coverage.
dotnet/src/Types.cs Exposes and clones the .NET option.
dotnet/src/Client.cs Forwards the .NET setting in requests.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 30/30 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

This comment has been minimized.

Apply the Java, Python, and Rust formatters required by CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 91a7e2ab-88a5-4365-accf-cbea1e1391e9
@github-actions

This comment has been minimized.

Treat both Windows path separators as equivalent when validating replayed rewind paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 91a7e2ab-88a5-4365-accf-cbea1e1391e9
@github-actions

This comment has been minimized.

Comment thread dotnet/test/E2E/RewindE2ETests.cs Fixed
Use Path.Join so a rooted file name cannot discard the E2E working directory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 91a7e2ab-88a5-4365-accf-cbea1e1391e9
@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR adds enableFileChangeTracking to all six SDK implementations consistently:

SDK Property Name Convention
Node.js/TypeScript enableFileChangeTracking camelCase ✅
Python enable_file_change_tracking snake_case ✅
Go EnableFileChangeTracking PascalCase ✅
.NET EnableFileChangeTracking PascalCase ✅
Java enableFileChangeTracking (via getEnableFileChangeTracking()) camelCase ✅
Rust enable_file_change_tracking snake_case ✅

All SDKs:

  • Add the option to both session creation and resumption configs
  • Use bool?/Option<bool>/*bool (nullable/optional) with omit-by-default behavior
  • Include E2E tests against the shared replay snapshot
  • Forward the field through the wire protocol as enableFileChangeTracking

No consistency issues found. The PR maintains full cross-SDK parity.

Generated by SDK Consistency Review Agent for #2321 · sonnet46 28.7 AIC · ⌖ 5.39 AIC · ⊞ 6.6K ·

@stephentoub
stephentoub merged commit a6d3ed1 into main Aug 12, 2026
103 of 109 checks passed
@stephentoub
stephentoub deleted the stephentoub-add-rewind-options branch August 12, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants