Skip to content

[Improve] Reduce chat memory retained during long sessions - #1466

Draft
zoomote[bot] wants to merge 1 commit into
mainfrom
feature/webview-memory-optimization-0lkgswz0njjgl
Draft

[Improve] Reduce chat memory retained during long sessions#1466
zoomote[bot] wants to merge 1 commit into
mainfrom
feature/webview-memory-optimization-0lkgswz0njjgl

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @taltas. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Intern repeated strings in completed chat messages and task history to reduce duplicate webview allocations during streaming and state broadcasts.
  • Scope message caches to the active task, skip transient partial messages and rejected stale updates, and clear retained message strings on explicit task transitions.
  • Remount the chat tree between tasks and remount message rows when they transition from partial to complete.
  • Add focused coverage for recursive interning, cache lifecycle and stale updates, task-level chat remounts, and virtualized row keys.

Why this change was made

Long-running webview sessions repeatedly deserialize the same message and history strings, while old React closures can retain prior task state. This implements the linked optimization proof of concept with stricter lifecycle handling and regression coverage suitable for production.

Impact

Chat behavior and appearance are unchanged. The webview can release prior-task message data more reliably and avoid retaining duplicate completed-message and history strings, reducing memory pressure during long sessions.

@zoomote zoomote Bot assigned taltas Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review status

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

Current step: Resolve the merge conflicts. The review sequence resumes after the branch is mergeable.

Review-state labels are managed by this workflow; do not edit them manually.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
webview-ui/src/context/ExtensionStateContext.tsx 83.33% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added has-conflicts PR has merge conflicts with the base branch and removed has-conflicts PR has merge conflicts with the base branch labels Sep 1, 2026
@github-actions github-actions Bot added has-conflicts PR has merge conflicts with the base branch and removed has-conflicts PR has merge conflicts with the base branch labels Sep 7, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit-review-active

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b058738c-2d53-477c-b40d-1cc09423b79d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

has-conflicts PR has merge conflicts with the base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant