fix(app): drop retained base64 screenshots from side panel chat state#1976
Merged
Dani Akash (DaniAkash) merged 1 commit intoJul 22, 2026
Merged
Conversation
The AI SDK keeps every message resident for the whole session, and on the default provider path browser tool results carry inline base64 screenshots. The side panel never renders those images, so they only pile up in the tab's heap (and in persisted history) until the renderer runs out of memory and the panel auto-closes (#1972). Add a pure helper that swaps base64 image blocks in tool-result outputs for a short text marker. Apply it when persisting a conversation, and after a turn settles, strip older messages in memory while leaving the latest turn intact. This is safe for multi-turn context: the client already sends only a bounded text history plus the new message, so the server, not the transcript, holds the working context.
Contributor
Greptile SummaryThis PR removes retained base64 screenshots from side-panel chat messages. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(app): drop retained base64 screensho..." | Re-trigger Greptile |
Contributor
✅ Tests passed — 1635/1639
|
Dani Akash (DaniAkash)
deleted the
fix/sidepanel-strip-retained-tool-output
branch
July 22, 2026 15:17
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
The Assistant side panel grows to multiple GB during active use and eventually OOMs the renderer, auto-closing the panel (#1972). One contributor is that the AI SDK keeps the entire conversation resident in memory for the whole session, and on the default provider path browser tool results carry inline base64 screenshots (structured image data). The side panel never renders those images (the chat only shows a tool label), so the screenshots accumulate in the tab's heap, in the resident set of recent conversations, and in persisted history, with nothing releasing them.
Change
Add a small pure helper (
tool-output-strip.ts) that replaces base64 image blocks inside tool-result outputs with a short text marker, preserving everything else (text blocks,isError, and outputmetadatasuch as the active tab id). It returns the same array reference when there is nothing to strip so callers can skip a redundant update.Apply it in two places:
useChatstate while leaving the latest turn intact.Why it is safe
Scope / notes
Validation
apps/apptypecheck passes (after GraphQL codegen); Biome clean on the changed files.