Merge pull request #2595 from IamAdamJowett/fix/transcript-rotate-age-zero-disable

fix(agent-runner): honor zero/negative transcript rotate-age override
This commit is contained in:
gavrielc
2026-05-23 20:04:50 +03:00
committed by GitHub
@@ -257,8 +257,12 @@ function transcriptRotateBytes(): number {
* non-positive value) disables the age check; size alone then governs. * non-positive value) disables the age check; size alone then governs.
*/ */
function transcriptRotateAgeMs(): number { function transcriptRotateAgeMs(): number {
const days = Number(process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS); const raw = process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS;
return Number.isFinite(days) && days > 0 ? days * 86_400_000 : 14 * 86_400_000; if (raw === undefined || raw.trim() === '') return 14 * 86_400_000;
const days = Number(raw);
if (!Number.isFinite(days)) return 14 * 86_400_000;
// Explicit non-positive override disables the age check; size alone governs.
return days > 0 ? days * 86_400_000 : Infinity;
} }
function claudeProjectsDir(): string { function claudeProjectsDir(): string {