Skip to content

feat(control): log snapshot-conflict triggers with the revision ledger#6080

Merged
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/snapshot-conflict-trigger-telemetry
Jul 6, 2026
Merged

feat(control): log snapshot-conflict triggers with the revision ledger#6080
SivanCola merged 1 commit into
esengine:main-v2from
SivanCola:fix/snapshot-conflict-trigger-telemetry

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

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/DiskRevision pair 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.

  • Log every recoverSnapshotConflict outcome — 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 the BaseRevision/DiskRevision pair extracted from SessionSnapshotConflictError.
  • Differentiate the recovery-not-needed notice text ("adopted the newer transcript (local changes already covered)") so a user screenshot alone identifies the trigger.
  • The recovery-not-needed path whose disk adoption fails used to return silently with the snapshot dropped; it now leaves a warning so "my last turns vanished" reports can be tied to this path.

No behavior change beyond the added logs and the one clarified notice string.

Verification

  • New test TestSnapshotConflictLogAttrsCarryRevisionLedger (typed conflict error → full attrs; bare sentinel error → path/mode only).
  • go test ./internal/control full suite green; desktop snapshot-conflict recovery tests green.
  • go vet clean.

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.

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.
@SivanCola SivanCola requested a review from esengine as a code owner July 6, 2026 07:38
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) labels Jul 6, 2026
@SivanCola SivanCola merged commit 67bd9f1 into esengine:main-v2 Jul 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant