Repository navigation
fix(store): do not rewrite the whole store on thread select (#636) - #638
Merged
currentbits merged 1 commit intoAug 21, 2026
Merged
Conversation
threads:get stamped lastVisitedAt via store.save(), which armed a debounced flush of the entire ~180 MB JSON blob. Clicking through idle threads wrote gigabytes for one timestamp. Visit now calls markDirty(): the stamp stays in memory, the exit hook covers quit, and the next real flush persists it. Hard crash: unread-dot is a click stale.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
pushed a commit
that referenced
this pull request
Aug 21, 2026
Two measured wins against the 180 MB single-file store, on top of the markDirty change in #638: - Store._load() snapshots to .bak with COPYFILE_FICLONE: an instant CoW clone on APFS instead of a 180 MB byte copy inside the boot chain, falling back to a real copy on other filesystems (#637). - SAVE_DEBOUNCE_MAX_MS 2s -> 15s: under sustained streaming each flush stringifies and rewrites the whole store (measured ~6 rewrites / 30 s = ~1 GB disk writes and ~24% of a core); the crash-loss window is only the transcript tail, which provider session logs restore on resume (#225). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
currentbits
deleted the
coder/fork-selecting-a-thread-schedules-a-full-f2c6ab
branch
October 3, 2026 16:07
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.
Fixes #636.
threads:getstampedlastVisitedAtwithstore.save(), which armed a debounced flush of the entire ~180 MB JSON blob. Selecting threads at idle was a few hundred ms of main-thread stringify plus 180 MB of SSD writes per click.Visit now calls
store.markDirty(): the stamp stays in memory, the exit hook covers quit, and the next real flush (append, settings, etc.) persists it. Hard crash: unread-dot state is a click stale, which the issue already called acceptable.Not named
touch()—updateThread({ touch: true })already means bumpupdatedAt.Does not touch the streaming-append rewrite tracked in #225.
Test
getThreadDetail(thethreads:getpath) stampslastVisitedAtwithout arming_timermarkDirtysets_dirtywithout scheduling a flush;saveNowstill persists