Repository navigation
Write nothing of a retired session again - #72
Merged
Merged
Conversation
A retired session is one whose marker _retired/<session> is in the root: an empty file named by its id. Nothing makes one yet. The level that retires a session comes in its own change, with its setting and its docs. This change makes every writer leave a retired session alone first, so a session retired once is never collected, derived, parsed or sent again, whatever is left of it. Each writer checks the marker before it creates a session or a chain directory, or takes a lock that would create one. A marker that cannot be read is an error, never taken for no marker, and the writer changes nothing of that session in that pass. - Claude Code, the change recorder and Kiro pass over a retired source session, and lost-source marking skips it. - Provider bodies of a retired session are marked retired in seen.state and never read again. A marker that cannot be read leaves seen.state as it was. - LangSmith: a run whose conversation is decided and retired never waits. It is remembered in that conversation, so its later updates, and runs inside it, are known to be retired too, also after a restart and after the run above it is forgotten. - parse, the metrics deriver and the SD scenario build do nothing for a retired id. A marker the deriver cannot read keeps the first pass's look-back. - push sends no landed file of a retired session. It still reads each round under a retired session's directory by the session the round's header names, and spooled metrics requests still go. - repack and the scenario runner refuse a root holding a retired session, and a destination where the session is retired. The runner copies only into a new directory. - The pass log says each retired session once per process, asz sources names them for every adapter, and asz verify counts them.
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 one whose marker
_retired/<session>is in the root: an empty file named by its id. Nothing makes one yet. The level that retires a session (storage.retention.retire_after) comes in the next change, together with its docs and changelog entry, so no setting exists before its behavior. This change makes every writer leave a retired session alone first. A session retired once is then never collected, derived, parsed or sent again, whatever is left of it on disk.What changes
storage.Retiredandstorage.RetiredSessionsread_retired/. A marker that cannot be read is an error, never taken for no marker. A writer that meets one changes nothing of that session in that pass.retiredinseen.stateand never read again. A response is attributed through a retired request too. A marker that cannot be read leavesseen.stateas it was.asz parse, the metrics deriver and an SD-format scenario build do nothing for a retired id. A marker the deriver cannot read keeps the first pass's look-back.asz pushsends no landed file of a retired session. It still reads each round under a retired session's conversation directory by the session in the round's header. Spooled metrics requests still go.asz repackand the scenario runner refuse a root holding a retired session, and a destination where the session is retired. The runner copies only into a new directory.asz sourcesnames them for every adapter, andasz verifycounts them.Tests
tests/chain,TestARetiredSessionIsNeverWrittenAgain:all-kindsandprovider-bodies-long, each with what is left of the session in four states: everything but its index, its directory alone, its chain alone, and nothing. The provider'sseen.stateis lost each time, and the sources grow. Nothing under the session or chain changes, no file of it is sent, and every spooled metrics request reaches the receiver.tests/chain,TestARoundOfALiveSessionUnderARetiredDirectoryIsSent, andTestRepackRefusesARetiredSessionfor direct calls and unreadable markers.asz sourcesandasz verify.Each new guard was proven by reverting it.
make test, the JSON v1 step (GOEXPERIMENT=nojsonv2),make scenarios, lint, and the Windows build and vet pass.