fix(session): bound in-memory session mirror - #1225
Open
code-yeongyu wants to merge 15 commits into
Open
Conversation
code-yeongyu
force-pushed
the
fix/mem-session-mirror-budget
branch
from
August 31, 2026 05:41
91d6a12 to
cac7253
Compare
code-yeongyu
force-pushed
the
fix/mem-session-mirror-budget
branch
from
August 31, 2026 06:59
d6089d2 to
1cb8faa
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.
Summary
ResidentStringStoreto a conservative 64 MiB FIFO cache; the JSONL remains authoritative when a blob is evicted.SessionManagermirror while preserving metadata and reloading pruned entries from disk for branching.TDD evidence
RED (commit
4c7cc71cc, before implementation):GREEN (commit
91d6a12b1plus final fixture commit, current HEAD):The literal requested filter
src/core/session-managerwas also attempted, but this repository's Vitest roots contain tests undertest/; that invocation exits 1 withNo test files found. The valid remote filters used above aretest/session-manager/session-mirror-budget.test.tsandtest/session-manager.Verification
MAC_TEST_TIMEOUT_S=2400 bun /tmp/senpi-mac-test.mjs fix/mem-session-mirror-budget -- test/session-manager(exit 0).origin/main(b618e8cd4) before final push.Summary by cubic
Bounds the in-memory session mirror so long-lived sessions no longer consume unbounded RAM.
ResidentStringStorenow evicts the oldest externalized strings past a 64 MiB per-session budget; the JSONL stays authoritative and evicted blobs reload from disk when read.getEntries()loads full history from the JSONL once and caches it so reads stay complete without repeated disk access.Written for commit 5d4e83a. Summary will update on new commits.