fix(agent-runner): honor zero/negative transcript rotate-age override#2595
Merged
gavrielc merged 2 commits intoMay 23, 2026
Merged
Conversation
CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS=0 (or negative) is documented to disable age-based rotation, but transcriptRotateAgeMs() routed it into the same branch as an unset var and returned the 14-day default. Sessions intentionally configured to stay long-lived were still rotated at 14 days, causing unexpected resets and context loss. Distinguish unset/non-numeric (default 14d) from an explicit non-positive override (Infinity = disabled; size alone governs). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Collaborator
|
@IamAdamJowett Thanks for the contribution! |
This was referenced May 24, 2026
tamasPetki
pushed a commit
to tamasPetki/nanoclaw
that referenced
this pull request
Jun 4, 2026
…tate-age-zero-disable fix(agent-runner): honor zero/negative transcript rotate-age override
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
transcriptRotateAgeMs()is documented so that settingCLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS=0(or a negative value) disables age-based continuation rotation. It didn't — it routed any non-positive value into the same branch as an unset variable and returned the 14-day default.Why
Deployments that intentionally set
0to keep long-lived sessions resumable were still having continuations rotated once they passed 14 days, causing unexpected session resets and context loss. Flagged by the codex review on #2586: #2586 (comment)How it works
Distinguish three cases the old single ternary collapsed into two:
0or negative →Infinity(age check disabled; the byte-size cap alone governs, since the consumer doesageMs > maxAgeMs)How it was tested
Typechecked the container tsconfig (
tsc -p container/agent-runner/tsconfig.json --noEmit) against the change. Pure tweak to an existing code path with no new dependencies.🤖 Generated with Claude Code