Fix session conflict diagnostics and depth-cap baseline / 修复会话冲突诊断与深度上限基线#6120
Merged
SivanCola merged 2 commits intoJul 6, 2026
Merged
Conversation
This was referenced Jul 6, 2026
SivanCola
pushed a commit
that referenced
this pull request
Jul 6, 2026
The controller kept savedRewriteVersion as external bookkeeping about the executor's session object, so every SetSession had to be paired with a manual baseline reset and snapshot() had to guess whether recovery had swapped the object — the guess that broke depth-cap force-saves (#6120). Store persistedRewriteVersion on the Session itself: save paths advance it with the rewriteVersion captured in the same lock window as the message snapshot (a compaction landing mid-save stays unpersisted, and a slower save cannot roll it backwards), clones carry it, and swapped sessions take their baseline with them. snapshotRewriteDecision and both mark helpers plus their seven call-site pairings collapse into Session.NeedsRewriteSave. Behavior fix folded in: installing a clone that still holds an unpersisted rewrite no longer stamps it persisted-by-construction; the next snapshot correctly runs as an owned rewrite.
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
reasonix doctor session <branch-id-or-path> --zip [--out PATH]to bundle transcripts, session sidecars, and the recovery parent chain for support. The command warns that bundled transcripts are not redacted.Refs #6117 — this covers the recurring-warning mitigation and the diagnostics needed to pin down the initial conflict; it does not claim to fix the first-conflict root cause.
Tests
go test ./...(cd desktop && go test ./...)golangci-lint run(clean, CI-matching v2.12.2)