You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Webview gray screen on long tasks: file-edit tool messages ship the entire pre-edit file (originalContent) on every state push #1885
File-edit tool messages embed originalContent, the full pre-edit file text, in their JSON text. Every message posted to the webview carries it, so the webview heap grows with the sum of all edited files' sizes and eventually turns gray (OOM).
Context (who is affected and when)
Users on long-running or multi-turn tasks that edit many or large files. The state payload keeps growing with each edit, and the webview holds all of it in memory even though originalContent is only needed when the user opens a diff in the File Changes panel. Related gray-screen reports: #1675, #448.
Reproduction steps
Zoo Code 3.84.0, any provider. Start a task that edits many large files (or one with a very long history).
Keep the task running so that clineMessages accumulates many tool messages containing originalContent.
Watch the webview heap (DevTools → Memory) grow with each edit. On long sessions, the chat panel turns gray.
Expected result
The webview receives only what it needs to render. The pre-edit file content is fetched on demand.
Actual result
Each file-edit tool message includes the whole original file in every state push, so webview memory scales with total edited file size and can end in a gray screen.
Variations tried (optional)
A fix is on branch fix/webview-omit-original-content:
The extension host replaces originalContent with originalContentLength before posting messages to the webview.
FileChangesPanel requests the content on demand through a new originalContent message.
It includes unit tests and scripts/gray-screen/* heap-measurement tooling.
Activity