You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/10/17 14:21:31 UTC

[PR] Warn when retire_after is shorter than a runtime keeps its history [skywalking-ai-sessionizer]

wu-sheng opened a new pull request, #74:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/74

   A retired session is never collected again, even when its runtime resumes it (#73). So a `retire_after` shorter than the runtime keeps its own history can retire a session the runtime may still resume. When `storage.retention.retire_after` is set, asz now says how it compares with each enabled runtime.
   
   ### What changes
   - **Claude Code.** asz reads `cleanupPeriodDays` from the user's `settings.json`, in the configuration directory the adapter already resolves, and from the managed settings for the whole machine. These are `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, so a named pipe cannot block startup;
     - a leading byte-order mark stripped, and UTF-16LE after `FF FE`;
     - empty or whitespace-only 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.
   - **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_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 asz warns whenever `kiro-local` is enabled. **LangChain** has no source and gets no warning. With `retire_after` off, 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:
     ```
     warning  : The inspected user settings "/home/me/.claude/settings.json" set cleanupPeriodDays to 30 days.
     warning  : Claude Code's effective retention was not determined. ...
     warning  : For the inspected value: Claude Code keeps a session for 30 days; storage.retention.retire_after is 7 days. A session resumed after it is retired is not collected.
     ```
   - **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`:
     - the user value, an unset one, a managed value over the user's, and a later `managed-settings.d` file over an earlier one;
     - hidden and non-`.json` files ignored, and names ordered by UTF-16 code units;
     - `30.0` counts, while `1.5`, `0`, `-1`, `"30"` and `1e300` are named;
     - an unreadable file or directory, one that does not parse, and a top level that is not an object;
     - a byte-order mark, UTF-16LE and JavaScript whitespace at all three places;
     - named pipes and links to them, on Unix.
   - `cmd/asz`:
     - 7 days against 30 warns, and 60 days does not, but the inspected and "not determined" lines are always said;
     - the default is used only when nothing is set;
     - the user directory is resolved in Claude Code's order;
     - an explicit `source_root`, Kiro, and nothing said with `retire_after` off or for LangChain alone;
     - startup, the status, the first pass once, a first pass that waits, and `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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Warn when retire_after is shorter than a runtime keeps its history [skywalking-ai-sessionizer]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #74:
URL: https://github.com/apache/skywalking-ai-sessionizer/pull/74


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org