feat: support in-place session rewind - #508
Open
nikita-ashihmin wants to merge 1 commit into
Open
Conversation
Map the AIR session rewind extension to Codex thread/revert. Keep the same thread ID and avoid a provider fork.
There was a problem hiding this comment.
🟡 Changes recommended
Legacy sessions cannot be rewound, and fingerprint fallback fails for multimodal and skill messages.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds AIR session rewind support by mapping _session/rewind to Codex thread history operations.
Changes:
- Adds rewind protocol handling, capability negotiation, and Codex integration.
- Resolves rewind points using message IDs or fingerprints.
- Adds documentation and regression tests.
File summaries
| File | Description |
|---|---|
src/SessionRewind.ts |
Implements rewind-point resolution and execution. |
src/index.ts |
Validates and registers rewind requests. |
src/CodexAppServerClient.ts |
Adds thread/revert RPC support. |
src/CodexAcpServer.ts |
Advertises and dispatches the extension. |
src/CodexAcpClient.ts |
Exposes rewind to the ACP server. |
src/AirExtension.ts |
Defines the capability key. |
src/AcpExtensions.ts |
Adds rewind extension types and routing. |
src/__tests__/SessionRewind.test.ts |
Tests ID and fingerprint resolution. |
src/__tests__/CodexACPAgent/initialize.test.ts |
Verifies capability advertisement. |
README.md |
Lists session rewind support. |
docs/session-rewind-extension.md |
Documents the extension protocol. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| `Rewind message ${request.beforeMessage.messageId} was not found in session ${request.sessionId}`, | ||
| ); | ||
| } | ||
| await client.threadRevert({threadId: request.sessionId, beforeTurnId: turn.id}); |
Comment on lines
+46
to
+47
| function userMessageText(content: Array<{type: string; text?: string}>): string { | ||
| return content.filter(item => item.type === "text").map(item => item.text ?? "").join(""); |
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.
Summary
_session/rewindextension.thread/revertwhile retaining the same thread ID.sessionRewindcapability.Verification
npm run typecheck— passed.npm run build— passed.git diff --check origin/main...HEAD— passed.https://youtrack.jetbrains.com/issue/IJAI-2003