mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-04 10:14:47 +08:00
6686315a10
A long-lived hub session never rotates its continuation, so the on-disk .jsonl grows without bound — days of history plus base64 image blocks the agent Read (screenshots from QA lanes, etc.). The SDK reloads the whole transcript on every --resume, and past a threshold the first turn alone exceeds the host's 30-min idle ceiling: the container is SIGKILLed before it can reply, then the next message repeats the cycle forever. Symptom: a hub that was responsive for days suddenly goes silent on a heavy turn. Before resuming, the Claude provider now checks the transcript backing the stored continuation; if it exceeds a size cap (default 12MB) or age cap (default 14 days, from the first entry's timestamp) it archives a markdown summary to conversations/ and starts a fresh session. Both caps are operator-overridable via CLAUDE_TRANSCRIPT_ROTATE_BYTES / CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS. The PreCompact archiver is refactored into a shared archiveTranscriptFile() reused by the rotation path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>