Repository navigation
Warn when retire_after is shorter than a runtime keeps its history - #74
Merged
Merged
Conversation
A retired session is never collected again, even when its runtime resumes it. When storage.retention.retire_after is set, asz now says how it compares with how long each enabled runtime keeps a session. For Claude Code, asz reads cleanupPeriodDays from the user's settings.json and from the managed settings for the whole machine: managed-settings.json, then managed-settings.d/*.json in the order Claude Code sorts them. A managed value wins over the user's. A file is read as Claude Code reads it: a regular file only, a leading byte-order mark stripped, UTF-16LE after FF FE, and empty settings by JavaScript's trim. Only a whole number of days of at least 1 counts. A file asz cannot read or parse, and an invalid value, is named, and nothing is assumed for it. This is an inspected value, never the effective one. asz always says that Claude Code's effective retention was not determined: other settings can change it, Claude Desktop and Cowork keep sessions at any age by default, and settings it cannot read pause its cleanup. It warns in addition when retire_after is shorter than the inspected value, or than the default of 30 days when none is set. With an explicit source_root it inspects nothing and says so. Kiro keeps a session until it is deleted, so it warns whenever kiro-local is enabled. LangChain has no source and gets no warning. The lines are said at startup, in asz sources, on the list page's status, and once in the first pass's log.
wu-sheng
force-pushed
the
retention-warning
branch
from
October 17, 2026 14:26
28bc1a1 to
21f3036
Compare
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.
A retired session is never collected again, even when its runtime resumes it (#73). So a
retire_aftershorter than the runtime keeps its own history can retire a session the runtime may still resume. Whenstorage.retention.retire_afteris set, asz now says how it compares with each enabled runtime.What changes
Claude Code. asz reads
cleanupPeriodDaysfrom the user'ssettings.json, in the configuration directory the adapter already resolves, and from the managed settings for the whole machine. These aremanaged-settings.json, thenmanaged-settings.d/*.jsonin the order Claude Code sorts them. A managed value wins over the user's. A file is read as Claude Code reads it:FF FE;Only a whole number of days of at least 1 counts. A file asz cannot read or parse, and an invalid value, is named, and nothing is assumed for it.
An inspected value, never the effective one. asz always says that Claude Code's effective retention was not determined. Project, command-line, device and server-managed settings can change it. Claude Desktop and Cowork keep sessions at any age by default. Settings Claude Code cannot read pause its cleanup unless managed settings provide the value. It warns in addition when
retire_afteris shorter than the inspected value, or than the default of 30 days when none is set. With an explicitsource_root, it inspects nothing and says so.Kiro keeps a session until it is deleted, so asz warns whenever
kiro-localis enabled. LangChain has no source and gets no warning. Withretire_afteroff, nothing is said.Where. At startup, in
asz sources, on the list page's status (with the full text in its title), and once in the first pass's log:Docs. The storage root's Retirement section says what is inspected, how, and its limits, with the Claude Code documentation it follows. The configuration page, the command-line page, the Claude Code and Kiro pages and the changelog are updated.
The facts about Claude Code come from its documentation, read on 2026-10-17: the cleanup and its exemptions, the managed settings paths and merge order, and the default.
Tests
internal/adapters/claudecode:managed-settings.dfile over an earlier one;.jsonfiles ignored, and names ordered by UTF-16 code units;30.0counts, while1.5,0,-1,"30"and1e300are named;cmd/asz:source_root, Kiro, and nothing said withretire_afteroff or for LangChain alone;asz sources.internal/view: the status carries the warning.No test reads the machine's real settings. Each guard was proven by reverting it.
make test, the JSON v1 step (GOEXPERIMENT=nojsonv2),make scenarios, lint, and the Windows build and vet pass.