Repository navigation
Cap tool output in session.json and redact nested items - #8
Merged
Merged
Conversation
A long session's .nexus/session.json reached 90 MB (one tool result alone was 15 MB), and every end-of-turn save re-serialized and rewrote all of it. - Saved copies of tool results keep the head and tail of anything over 8 KB (1.5 KB for blocks older than the last 40), with a marker saying how much was trimmed. The live transcript keeps the full output. - Resuming an older, untrimmed session trims it on load. - Nested item fields (tool result/input/diff, text, thinking) are now run through the transcript redactor; only top-level strings were before. - Each saved item copy is cached until the item changes, so a save only processes new output. On a copy of the 90 MB session: file 90 MB -> 34 MB, steady-state save 293 ms -> 140 ms (now including nested redaction). The first save after a resume pays a one-time ~0.8 s to redact the restored history. test/session-save.test.js covers the caps, nested redaction and caching.
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.
Cap tool output in session.json and redact nested items
A long session's .nexus/session.json reached 90 MB (one tool result alone
was 15 MB), and every end-of-turn save re-serialized and rewrote all of it.
8 KB (1.5 KB for blocks older than the last 40), with a marker saying
how much was trimmed. The live transcript keeps the full output.
through the transcript redactor; only top-level strings were before.
processes new output.
On a copy of the 90 MB session: file 90 MB -> 34 MB, steady-state save
293 ms -> 140 ms (now including nested redaction). The first save after
a resume pays a one-time ~0.8 s to redact the restored history.
test/session-save.test.js covers the caps, nested redaction and caching.