fix(sessions): cap transcript payloads to stop renderer OOM - #3778
Closed
charlesvien wants to merge 3 commits into
Closed
fix(sessions): cap transcript payloads to stop renderer OOM#3778charlesvien wants to merge 3 commits into
charlesvien wants to merge 3 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "log transcript sizes when loading sessio..." | Re-trigger Greptile |
charlesvien
force-pushed
the
fix/renderer-crash-loop-recovery
branch
from
July 24, 2026 01:19
6fb915c to
0438991
Compare
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
Opening a task with a huge session transcript OOMs the renderer (V8 "young object promotion failed") and the app crash-loops on that route. A user hit this 46 times on one task across three app versions. Transcript entries are loaded at full fidelity: whole-file tool outputs, diffs, terminal dumps and pasted media all stay uncapped in renderer heap, and resume chains fetch and stringify two full transcripts.
Changes
capStoredEntryPayloadsbounds every stored transcript entry at acquisition: strings inside toolrawInput/rawOutput/_metaand diff old/new text truncate at 100k chars with a marker (structure preserved so tool views still render), text blocks truncate the same way, and media blocks over 10M chars become a text placeholder instead of a broken truncated base64 blob.How did you test this?
sessionEntryCaps.test.ts(19 cases) anduseRendererHeapWatchdog.test.ts.@posthog/core(2508) and@posthog/ui(2021) suites, typecheck oncode,@posthog/coreand@posthog/ui,biome lint packages/corewith zero noRestrictedImports.Automatic notifications