Area
Agents & chat
What happened
Session snapshot retention deletes numerically newer snapshots while preserving
older ones because numbered snapshot filenames are sorted lexicographically.
At tick 158 with a 100-snapshot cap, the retained tick ranges were 2-9,
16-99, and 151-158. The expected retained range was 59-158.
The complete sanitized observation is attached as
condor-snapshot-retention-evidence.txt.
Expected
Retention should keep the newest 100 numeric ticks and delete the oldest numeric
ticks, regardless of how many digits appear in the filename.
Likely source path
A minimal fix is to sort valid snapshot paths by the parsed integer tick before
pruning. A regression test should cross the filename-width boundary: with ticks
1 through 102 and a cap of 100, cleanup should retain exactly ticks 3 through
102. Existing snapshot listing tests are in
tests/test_sessions_index_snapshots.py; retention cleanup currently lacks this
boundary case.
Steps to reproduce
- Create an isolated temporary session snapshots directory.
- Create
snapshot_1.md through snapshot_102.md.
- Invoke
JournalManager._cleanup_old_snapshots().
- Observe that lexicographic cleanup removes
snapshot_1.md and
snapshot_10.md.
- The correct numeric cleanup would remove
snapshot_1.md and
snapshot_2.md.
Environment
Observed in a private downstream checkout; no private branch or source is
published with this report. The same cleanup implementation was independently
confirmed in public upstream Condor commit
a3997a2b.
Logs
Attach: condor-snapshot-retention-evidence.txt
Area
Agents & chat
What happened
Session snapshot retention deletes numerically newer snapshots while preserving
older ones because numbered snapshot filenames are sorted lexicographically.
At tick 158 with a 100-snapshot cap, the retained tick ranges were
2-9,16-99, and151-158. The expected retained range was59-158.The complete sanitized observation is attached as
condor-snapshot-retention-evidence.txt.Expected
Retention should keep the newest 100 numeric ticks and delete the oldest numeric
ticks, regardless of how many digits appear in the filename.
Likely source path
MAX_SNAPSHOTS = 100_cleanup_old_snapshots()callssorted()directly onsnapshot_*.mdpaths, producing lexicographic rather than numeric tick order.A minimal fix is to sort valid snapshot paths by the parsed integer tick before
pruning. A regression test should cross the filename-width boundary: with ticks
1 through 102 and a cap of 100, cleanup should retain exactly ticks 3 through
102. Existing snapshot listing tests are in
tests/test_sessions_index_snapshots.py; retention cleanup currently lacks thisboundary case.
Steps to reproduce
snapshot_1.mdthroughsnapshot_102.md.JournalManager._cleanup_old_snapshots().snapshot_1.mdandsnapshot_10.md.snapshot_1.mdandsnapshot_2.md.Environment
Observed in a private downstream checkout; no private branch or source is
published with this report. The same cleanup implementation was independently
confirmed in public upstream Condor commit
a3997a2b.Logs
Attach:
condor-snapshot-retention-evidence.txt