Skip to content

fix: lazy load chat diffs#8846

Draft
kilo-code-bot[bot] wants to merge 3 commits intomainfrom
fix/chat-diff-memory
Draft

fix: lazy load chat diffs#8846
kilo-code-bot[bot] wants to merge 3 commits intomainfrom
fix/chat-diff-memory

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 13, 2026

Summary

  • Keep chat diff summaries lightweight by stripping full file contents from message summaries and session diff events.
  • Lazily fetch full per-message diffs only when chat changes are expanded, then release them when collapsed.

Related to #8607.

@markijbema markijbema marked this pull request as draft April 13, 2026 12:26
userMsg.summary = {
...userMsg.summary,
diffs,
diffs: slim(diffs), // kilocode_change
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Normalize summary diff paths before storing them

SessionSummary.diff({ messageID }) now runs clean() and unquotes git-escaped filenames, but summarizeMessage() still stores slim(diffs) with the raw computeDiff() paths. In the webview, fullByFile().get(diff.file) uses the summary filename as the lookup key, so files whose paths are quoted/escaped by git (for example paths with spaces or non-ASCII characters) will never find their loaded diff and will stay on the "no changes" placeholder. Store the same normalized filename here as the lazy-load path.

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 13, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/session/summary.ts 127 Lazy-loaded per-message diffs can fail to match summary entries for git-escaped paths

Fix these issues in Kilo Cloud

Other Observations (not in diff)

No additional observations.

Files Reviewed (10 files)
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/kilo-vscode/src/services/cli-backend/connection-utils.ts - 0 issues
  • packages/kilo-vscode/tests/unit/connection-utils.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/VscodeSessionTurn.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/session.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages.ts - 0 issues
  • packages/opencode/src/session/index.ts - 0 issues
  • packages/opencode/src/session/revert.ts - 0 issues
  • packages/opencode/src/session/summary.ts - 1 issue
  • packages/opencode/test/kilocode/session-summary.test.ts - 0 issues

Reviewed by gpt-5.4-20260305 · 1,483,536 tokens

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant