Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Describe the enhancement you want to request
OpenCode currently stores per-message file diffs inline on user messages via message.summary.diffs, where each diff item includes full before and after file contents.
This has a major downside for long-lived coding sessions: message rows can become extremely large, especially when a turn touches generated files, large source maps, workflow files, or other bulky assets. Since session open/switch flows still load message rows from the session database, this can noticeably slow down the desktop app when switching between sessions.
I’d like to request a change to make per-message diffs lazy-loaded instead of embedding the full diff payload in MessageTable.data.
Proposed direction
- Keep lightweight per-message summary metadata inline on the message row (for example: title/body/files/additions/deletions)
- Move the full per-message diff payload (
before/aftercontent) into separate storage, ideally a dedicated table keyed bymessage_id - Reuse or extend the existing diff API path so full per-message diffs are only fetched when the user actually opens turn-level review
- Leave session-level review diffs as a separate/lazy path as well
Why this would help
- Prevent very large
messagerows in SQLite - Improve session switching/opening performance in the desktop app
- Reduce the cost of session prefetching
- Keep the review UX intact while moving heavy payloads off the hot path
Why I think this is worth doing
From local investigation, the main database growth came from oversized message rows containing summary.diffs[].after content. The hot path cost came from deserializing large message JSON blobs during normal session loading.
Minimal implementation shape
A low-risk version of this could be:
- add a
message_difftable (or equivalent separate storage) - stop persisting full
summary.diffsinline on user messages - keep only lightweight summary counts inline
- make the existing diff fetch path support
messageID-scoped lazy loading - update the turn review UI to fetch full per-message diffs only when needed
I’d be happy to help create a PR for this feature
Activity
ualtinok commentedon Mar 12, 2026
Tagging also: #14543
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.