Skip to content

[BUG] Webview gray screen on long tasks: file-edit tool messages ship the entire pre-edit file (originalContent) on every state push #1885

Closed

Description

@daewoongoh

Problem (one or two sentences)

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

  1. Zoo Code 3.84.0, any provider. Start a task that edits many large files (or one with a very long history).
  2. Keep the task running so that clineMessages accumulates many tool messages containing originalContent.
  3. 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.

App Version

3.84.0

API Provider (optional)

Not Applicable / Other

Model Used (optional)

N/A

Related issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions