Repository navigation
Conversation
albin-zhu
force-pushed
the
fix/incremental-rollout-read
branch
from
November 11, 2026 04:25
c2372aa to
e5ab365
Compare
This branch has not been deployed
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
Repeated Stop hooks currently load and parse the entire main rollout, including already acknowledged turns. This change checkpoints acknowledged byte boundaries and parser context so ordinary main-thread hooks read only the newly appended suffix. It adds no daemon, SQLite dependency, model routing change, or exporter replacement.
<rollout>.langfuse.cursorcheckpoint with parser context, bounded conversation suffix, original turn count and source guards.max_history_chars: 0; directory discovery remains unchanged. This is explicitly a main-rollout optimization, not a claim that all plugin I/O is incremental.Why
#119 / #122 address generation-history allocation/flush pressure. Reading and parsing the acknowledged rollout prefix on each subsequent hook remains a separate cost. This PR reduces that repeated logical input; it does not assert physical disk bytes, an across-the-board machine-lag root cause, or lossless provider-wire history.
Verification
pnpm run lint: formatting and TypeScript passed.pnpm test: 11 files / 136 tests passed.Both warm runs emitted one new root and preserved the previous turn's generation context. Reads also include fixed source guards, metadata discovery and checkpoint/receipt files; the measured suffix is not total physical disk I/O. Published 0.4.3 warm runs on equivalent fixtures took 83 ms and 92 ms; these single-run timings are descriptive, not a performance guarantee.
Review points
The checkpoint contains transcript content and is documented as private (POSIX 0600; Windows inherited directory ACLs). First use/cold rebuild still reads the history. Concurrent writers can roll the optimization back to an older acknowledged position (extra reads) rather than risking skipped delivery. Subagents deliberately remain on the existing fidelity path.
Also included: opt-in
LANGFUSE_CODEX_DIAGNOSTICShook progress records (no transcript content, credentials, raw errors or full paths), and bounded subagent discovery — the day pruning never matched on Windows becausepath.relativereturns backslashes, so every hook walked the entire session history.