Skip to content

[BUG] read_file contents persisted in ui_messages.json cause bloat/gray screen #8690

@hannesrudolph

Description

@hannesrudolph

Type

Bug

Problem / Value

When files are read during a task, their full contents are saved into the chat history snapshots (ui_messages.json) via clineMessages, even though the app doesn’t use those contents after that turn. This bloats storage and can lead to the UI becoming unusable (gray screen). Fixing this reduces disk usage, lowers privacy exposure, and prevents UI failures.

Context

  • The chat history array (“clineMessages”) is persisted to snapshots (ui_messages.json), which currently include full read_file payloads.
  • Rehydration loads API conversation history (api_conversation_history.json), not these snapshot copies, so the large stored file texts are unused by runtime but still increase snapshot size and risk.
  • Impact is highest when large files or many read_file operations occur within a task.

Constraints/Preferences

  • Stop saving full read_file contents to snapshots going forward (store only path and a brief preview/reason if needed).
  • On rehydration of existing tasks, purge stored file contents from snapshots to maintain backward compatibility and allow old tasks to load reliably and avoid gray-screen failures.

References: Global names for ui_messages.json and api_conversation_history.json are declared in src/shared/globalFileNames.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions