Reduce Claude parser OOM risk (0.9.9)#335
Merged
Merged
Conversation
Strip heavy fields from JournalEntry immediately after JSON.parse in the JSONL hot loop. Keeps only what downstream consumers need: type, timestamp, sessionId, cwd, compacted user text (2000 char total cap), assistant model/usage/id, tool_use names with Skill and Bash inputs, and MCP inventory attachments. Text, thinking, and tool_result blocks are dropped. Also removes redundant hydrateCache() from status --format json and terminal status paths, and clears the session cache between period parses to avoid pinning both today and month result sets. This is a mitigation, not a full fix. Very large month ranges still materialize full ProjectSummary.turns arrays. The real fix is the streaming single-pass parser refactor.
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
This is an emergency mitigation, not a full architecture fix. Very large month ranges still materialize full ProjectSummary.turns arrays. The streaming single-pass parser refactor remains the real fix.
Test plan
npm test -- --run(715/715)codeburn status(terminal)codeburn status --format json --provider claudecodeburn status --format menubar-json --period today --provider all --no-optimizenode --max-old-space-size=1536 ... status --format json