Repository navigation
fix(indexer): keep session indexing incremental on append - #176
Open
HengYangDS wants to merge 1 commit into
Open
HengYangDS wants to merge 1 commit into
HengYangDS wants to merge 1 commit into
Conversation
HengYangDS
marked this pull request as ready for review
September 26, 2026 05:10
This was referenced Sep 26, 2026
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.
Problem
indexSessionre-embeds and replaces every previously indexed exchange when a transcript grows. Its archive copy is also only created once, so a newly indexed exchange can point to a stale archive that does not contain the appended lines.Change
MAX(line_end)high-water mark, matching the existing incremental-indexing path.Verification
last_indexedof an existing row was replaced. It now verifies the old row is preserved, the appended exchange is indexed, and the archive contains that exchange even when source and archive mtimes match.npm installdid not finish within a 300-second bound; this is not a cold-install claim. The fork PR's Node 22/24 CI is the cold-install gate.Scope and risks
The change applies to the session-specific indexing path; it does not invoke repair or re-summarize historical conversations. It relies on the existing append-only transcript contract and does not reconcile rewritten or truncated sessions. The generated MCP bundle has a large mechanical diff because upstream does not lock transitive dependency layout; the source-level change is in
src/indexer.tsandsrc/sync.ts.Related to the high-water fixes discussed in #84 and #152; both issues are already closed, so this PR does not claim to close them.
Additional local Node matrix (2026-09-26)
On macOS arm64, this current PR head passed
npm run build,node --check dist/mcp-server.js, and the complete test suite on Node 22.23.3 and Node 24.21.0 (351/351 tests on each). Each run used a fresh source snapshot and the corresponding per-Node native dependency tree, with a pre-seeded local embedding-model cache and an isolatedOMP_HOME. The dependency trees were installed from PR #179 (all five PRs have the samepackage.json); this is not a separate empty-cache install for each PR, an Ubuntu result, or an upstream CI pass.