Skip to content

fix(agent-runner): honor zero/negative transcript rotate-age override#2595

Merged
gavrielc merged 2 commits into
nanocoai:mainfrom
IamAdamJowett:fix/transcript-rotate-age-zero-disable
May 23, 2026
Merged

fix(agent-runner): honor zero/negative transcript rotate-age override#2595
gavrielc merged 2 commits into
nanocoai:mainfrom
IamAdamJowett:fix/transcript-rotate-age-zero-disable

Conversation

@IamAdamJowett

Copy link
Copy Markdown
Contributor

What

transcriptRotateAgeMs() is documented so that setting CLAUDE_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 0 to 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:

  • unset / blank / non-numeric → 14-day default (unchanged)
  • explicit 0 or negative → Infinity (age check disabled; the byte-size cap alone governs, since the consumer does ageMs > maxAgeMs)
  • positive → that many days

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

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]>
@gavrielc gavrielc merged commit 5443ca8 into nanocoai:main May 23, 2026
1 check passed
@gavrielc

Copy link
Copy Markdown
Collaborator

@IamAdamJowett Thanks for the contribution!

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants