feat(control): log snapshot-conflict triggers with the revision ledger#6080
Merged
SivanCola merged 1 commit intoJul 6, 2026
Merged
Conversation
Field reports of frequent "session changed on disk" notices (esengine#6069) are undiagnosable today: the stale-prefix adoption and the recovery-not-needed adoption emit the same notice text, nothing logs which trigger fired, and the revision ledger that drove the conflict decision is discarded. - Log every recoverSnapshotConflict outcome (stale-prefix adopt, recovery-not-needed adopt, failed adoption, recovery fork) with the conflict kind, save mode, message counts, and the BaseRevision/DiskRevision pair from SessionSnapshotConflictError. - Differentiate the recovery-not-needed notice text ("local changes already covered") so user screenshots identify the trigger. - The recovery-not-needed path whose disk adoption fails used to drop the snapshot silently; it now leaves a warning so "my last turns vanished" reports can be tied to it.
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
Field reports of frequent "session changed on disk" notices (#6069, v1.17.1) are undiagnosable today: the stale-prefix adoption and the recovery-not-needed adoption emit the same notice text, nothing logs which trigger fired, and the
BaseRevision/DiskRevisionpair that drove the conflict decision is discarded. When the next report lands, we still can't tell whether the remaining producer is a rewrite-ownership revocation, a genuine second writer, or something new.recoverSnapshotConflictoutcome — stale-prefix adopt, recovery-not-needed adopt, failed adoption, recovery fork — with the conflict kind, save mode (snapshot/rewrite), disk vs snapshot message counts, and theBaseRevision/DiskRevisionpair extracted fromSessionSnapshotConflictError.No behavior change beyond the added logs and the one clarified notice string.
Verification
TestSnapshotConflictLogAttrsCarryRevisionLedger(typed conflict error → full attrs; bare sentinel error → path/mode only).go test ./internal/controlfull suite green; desktop snapshot-conflict recovery tests green.go vetclean.Cache impact
Cache-impact: none - logging and notice-text only; no save/recovery decision logic, provider request, or prompt changes.
Cache-guard: existing snapshot-conflict recovery tests (
internal/control, desktop autosave suite) cover the touched paths; the new unit test covers attr extraction.System-prompt-review: N/A
Refs #6069, #6054 — first step of narrowing the post-1.17.1 conflict trigger.