You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
emrg: llm.jsonl rotation keeps three backup generations where its constant, docstring and prompt all say two #2697
A live session on this host holds exactly that: llm.jsonl 25 MB plus .1 53 MB, .2 52 MB, .3 52 MB.
Why the code disagrees with itself
The shift loop deletes .3 and then renames .2 into it, so the newest deletion frees nothing:
# Shift existing backups: .2 → .3 (delete), .1 → .2, main → .1
for i in range(_LLM_LOG_BACKUP_COUNT, 0, -1):
...
if i == _LLM_LOG_BACKUP_COUNT and new.exists():
new.unlink()
if old.exists():
old.rename(new)
The comment already describes the intent the loop fails to carry out: .2 is meant to be dropped, not promoted.
What the fix must satisfy
The rotation keeps exactly _LLM_LOG_BACKUP_COUNT backup generations, so the constant, the docstring and the system prompt describe the same file set.
The oldest generation is removed rather than shifted into a new name.
The size bound behaves as documented: one live file plus _LLM_LOG_BACKUP_COUNT backups, i.e. 150 MB at the 50 MB default instead of the 200 MB kept today.
Activity
argszero commentedon Nov 3, 2026
Handled by #2699