Repository navigation
fix(server): rolling back a Claude fork's first run keeps its inherited history - #21188
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused Claude rollback bug fix with backward-compatible optional metadata, preserved fallback behavior, and targeted coverage for forked and non-forked threads. Its runtime impact is localized to restoring inherited history for the affected fork rollback path. You can add or adjust custom eligibility rules. Learn more. |
|
Warning Review limit reachedOnly developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing. Next included review available in 3 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Taking over this one for maintainer batch claude-08. I’ll merge current main, reduce the tests, rebuild the fork rollback path, and verify SDK fork/resume behavior before independent reviews. The original author’s commits will be preserved. |
…ed history (pingdotgg#21188) Co-authored-by: Julius Marminge <julius0216@outlook.com> Fork adaptation: The fork rewinds Claude turns by forking the session at the exact boundary (exact history rewind) and no longer has upstream's resumeSessionAt rollback resolver. Rolling a forked thread back to its start therefore forks the session again up to the recorded inherited head and switches to that new session, instead of resuming the old session at the head, which would leave the discarded runs in the session file where the complete-history rewind reads them as retained. Turn rewinds carry the inherited head over to the new session's remapped id. The history worker imports getSessionMessages, which the fork had dropped. Upstream's thread-start rollback test is adapted to expect the new fork, and a test covers the head remapping. (cherry picked from commit 0c39430) Upstream-PR: 21188 Fork-Feature: claude-exact-history-rewind
Rolling back a Claude fork’s first run previously created an empty native session. The timeline retained inherited messages, but the next provider request lost that history. The fork now records the copied transcript’s remapped head, then resumes the same session at that head after rollback. Ordinary threads and forks without a recorded head keep the existing fresh-session fallback.
Thanks @fixfon for #21188. The contributor’s commits are preserved, with current main merged. The optional cursor metadata and adapter behavior remain together because neither provides the fix independently.
Fixes #21166, confirmed on main by a maintainer.
Verification:
Current-head CI passes after rerunning a failed web job caused by a Playwright route-handling rejection. Macroscope has no check on this rebuilt head; its approval comment is for the original contributor head, so fresh approval remains a maintainer follow-up.
Maintainer takeover: Codex gpt-6-astra tests and gpt-6.1-sol implementation, with independent Claude Opus 5.5 and Codex gpt-6-sol review through T3 Code.