fix: archive role-ordering reset transcripts#97544
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 2:20 PM ET / 18:20 UTC. Summary PR surface: Source -26, Tests +10. Total -16 across 2 files. Reproducibility: yes. at source level: current main routes role-ordering conflicts into cleanupPreviousResetTranscripts, which unlinks transcript candidates after bounded replay. I did not run a live provider-triggered reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow archive-based storage-boundary fix after maintainer review accepts the session-state artifact behavior and required CI is acceptable. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main routes role-ordering conflicts into cleanupPreviousResetTranscripts, which unlinks transcript candidates after bounded replay. I did not run a live provider-triggered reproduction in this read-only review. Is this the best way to solve the issue? Yes. Reusing archivePreviousSessionTranscript is the narrowest maintainable fix because it preserves the existing reset archive contract instead of creating a parallel cleanup path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b70d1aae57bc. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -26, Tests +10. Total -16 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
CI triage note after the current-head re-review: I checked the only red current check,
with That shard is |
|
Thanks for checking. Could a maintainer rerun |
* fix: archive role-ordering reset transcripts * test: fix session reset archive lint
* fix: archive role-ordering reset transcripts * test: fix session reset archive lint
* fix: archive role-ordering reset transcripts * test: fix session reset archive lint
* fix: archive role-ordering reset transcripts * test: fix session reset archive lint
Closes #97529
AI-assisted by Codex.
What Problem This Solves
Fixes an issue where users whose sessions hit an automatic role-ordering-conflict reset would silently lose the previous session transcript. The reset replayed only a bounded message tail into the new session, then hard-deleted the full previous transcript instead of preserving it as a reset archive.
Why This Change Was Made
The role-ordering reset lifecycle now uses the existing reset transcript archive path instead of the unlink-only cleanup path. This keeps the behavior aligned with adjacent reset and rollover lifecycle flows while preserving the bounded replay into the new session.
User Impact
Users retain a recoverable
.jsonl.reset.<timestamp>archive for the full pre-reset transcript, so long conversations are not silently reduced to the replayed tail after this automatic recovery path runs.Evidence
node scripts/run-vitest.mjs src/config/sessions/session-accessor.test.tsnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions/session-accessor.test.ts src/config/sessions/session-accessor.tsgit diff --checkgit diff --numstat origin/main...HEADsrc/config/sessions/session-accessor.test.ts:11 1src/config/sessions/session-accessor.ts:5 31persistSessionResetLifecyclefromsrc/config/sessions/session-accessor.tsagainst an actual file-backedagents/main/sessions/layout:.agents/skills/autoreview/scripts/autoreview --mode local --prompt 'Review the fix for GitHub issue #97529. Scope: preserve previous session transcript during role-ordering-conflict reset by archiving instead of unlinking, with focused session-accessor regression test. Focus on data-loss/session lifecycle regressions and whether proof covers the touched surface.'No live provider reproduction was run. The real behavior proof drives the fixed file-backed session lifecycle directly: it writes a 25-turn previous transcript in the real sessions directory shape, runs the reset lifecycle with cleanup enabled, verifies the previous transcript is preserved as exactly one
.jsonl.reset.<timestamp>archive, and verifies the replayed tail still lands in the new transcript.