Repository navigation
fix(ai-vault-search): prevent parent-string retention during indexing - #22545
Merged
OrcaWin merged 1 commit intoSep 23, 2026
Merged
Conversation
Contributor
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
Co-authored-by: Andre Ambrósio <56239028+sirambrosio@users.noreply.github.com>
OrcaWin
force-pushed
the
OrcaWin/bug-session-scanner-ooms-on-large-codex-transcri
branch
from
September 23, 2026 20:24
38b1561 to
03bdcd9
Compare
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
OrcaWin
deleted the
OrcaWin/bug-session-scanner-ooms-on-large-codex-transcri
branch
September 23, 2026 20:28
8 of 9 tasks
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.

ELI5
Large transcript messages were being stored as short string slices that still kept the full JSONL record alive. The search scanner now stores an independent copy of each bounded row, so indexing releases the large source string.
What Changed
The session search writer detaches every row's text with a UTF-16 round trip immediately before buffering it. This applies at the shared writer boundary used by all local Agent Session History providers, including Codex, Claude, Cursor, Gemini, OpenCode, and the other indexed readers.
Why
The scanner's 32 MiB character counter measured only visible slices, while V8 retained their multi-megabyte parent strings. Copying at the buffer boundary fixes the retention without changing searchable text or requiring a larger heap. The JSONL reader already copies partial byte tails; no separate reader-specific fix is needed.
Linked Issue
Fixes #22296
Visual Proof
N/A — this is a background indexing memory fix with no UI change.
Testing
pnpm test src/main/ai-vault-search/session-search-index-writer.test.ts src/main/ai-vault-search/session-search-file-write.test.ts src/main/ai-vault-search/session-search-message-rows.test.tspnpm tc:nodepnpm run check:code-quality:changedgit diff --checkAI Disclosure
Codex (GPT-6) assisted with investigation and implementation.
Review
The change is intentionally at the shared indexing boundary so all local transcript readers receive the same protection. UTF-16 round-tripping preserves JavaScript code units, including unpaired surrogates.
Agent skill upstream boundary
Notes
No SSH or remote-wire behavior changes. Remote history listing does not feed the local session search writer. The change is platform-neutral Node code.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (CI will cover full repository checks; focused checks above pass)