GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Session summaries should cap or filter huge generated/vendor diffs in message.data.summary.diffs · Issue #30165 · anomalyco/opencode

Session summaries should cap or filter huge generated/vendor diffs in message.data.summary.diffs #30165

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Session summaries should cap or filter huge generated/vendor diffs in message.data.summary.diffs#30165
Copy link
Assignees
kitlangton

Description

@rayzhangxql-design
rayzhangxql-design
opened on Jun 1, 2026
Issue body actions

Summary

OpenCode can store very large diffs inside SQLite message.data.summary.diffs.

When generated/vendor/cache files are included, this can create huge message rows and cause downstream consumers such as Claudian/Obsidian to freeze or show blank restored sessions.

I think OpenCode should add filtering and size caps for session summary diffs before they are written into persistent message data.

Environment

  • OpenCode provider used through Claudian
  • Storage: SQLite DB at ~/.local/share/opencode/opencode.db
  • Affected field: message.data.summary.diffs
  • Downstream consumer: Claudian Obsidian plugin

What Happened

Some OpenCode session messages contained very large summary.diffs.

In one affected session, a single message was around 2.69 MB because summary.diffs contained 13 generated/vendor diffs from a Vite dependency cache path similar to:

frontend/node_modules/.vite/deps/...

These diffs were not meaningful conversation content. They were generated dependency/cache files.

The large message row caused downstream session rendering problems in Claudian/Obsidian.

After removing only generated/vendor/cache entries from message.data.summary.diffs, the session became much safer to load while preserving all actual conversation rows and parts.

Later, for two sessions that still showed blank content in Claudian, removing only their summary.diffs metadata reduced the largest message rows significantly:

Before:
max message length: 738756 bytes
summary diff bytes: 1638126

After:
max message length: 460 bytes
summary diff bytes: 0

The actual conversation content was preserved:

messages unchanged
parts unchanged
text parts unchanged
text bytes unchanged

Why This Is a Problem

summary.diffs is useful metadata, but storing full large diffs in message rows can cause:

  • very large SQLite rows
  • slow session restore
  • high memory usage during JSON parsing
  • downstream UI freezes
  • blank session rendering in integrations
  • polluted summaries with generated files that users do not care about

Generated/vendor/cache diffs are especially problematic because they are usually not useful for human review.

Expected Behavior

OpenCode should avoid storing huge generated/vendor/cache diffs in message.data.summary.diffs.

Instead, it should either:

  • omit them
  • summarize them
  • store only metadata
  • cap them by byte/line count
  • lazy-load full diff content only if explicitly requested

Suggested Default Filters

OpenCode should exclude or summarize-only paths matching common generated/vendor/cache patterns:

node_modules/
.vite/
dist/
build/
out/
coverage/
.cache/
cache/
caches/
__pycache__/
*.pyc
*.pyo
*.pyd
.pytest_cache/
.mypy_cache/
.ruff_cache/
.next/
.nuxt/
.turbo/
vendor/
third_party/
site-packages/
.venv/
venv/

Suggested Size Caps

Possible default limits:

  • max bytes per diff entry
  • max diff entries per message
  • max total summary.diffs bytes per message
  • max total summary.diffs bytes per session
  • max rendered/stored lines per diff

For example:

per file diff cap: 50-100 KB
per message summary diff cap: 250-500 KB
per session summary diff cap: configurable

If a diff exceeds the cap, store metadata instead of full patch content:

{
  "file": "frontend/node_modules/.vite/deps/chunk-xyz.js",
  "omitted": true,
  "reason": "generated_or_too_large",
  "originalBytes": 734221,
  "originalEntries": 1
}

Related Issues

These existing issues seem related to large diffs / session restore performance:

  • session_diff stores full file contents and can cause huge memory usage:
    session_diff stores full file contents via git show, causes multi-GB memory on resume #20990

  • Diff pipeline causes severe UI lag due to full-context patches and synchronous parsing:
    perf: diff pipeline causes severe UI lag on desktop — full-context patches + synchronous parsing on main thread #22650

  • Oversized summary.diffs can create huge session/message payloads:
    Blank session history after restart when summary diffs embed huge file contents #17622

  • Session summary/diff can be worktree-global rather than session-scoped:
    Session summary/diff is worktree-global (not session-scoped) causing cross-session attribution #11802

Suggested Implementation Direction

1. Add path filtering before writing message.data.summary.diffs

Filter generated/vendor/cache paths before persisting summary diffs.

2. Add byte/entry caps

Even non-generated real code diffs can become large. Summary diffs should be bounded.

3. Store omitted metadata instead of full patches

Keep the summary useful without storing huge payloads.

4. Make full diffs lazy/on-demand

If full diffs are needed, store them outside the main message row and load only when requested.

5. Make the filter configurable

Users should be able to add custom ignore patterns for summary diffs.

Acceptance Criteria

  • Generated/vendor/cache paths are not stored as full patches in message.data.summary.diffs.
  • Oversized diffs are capped or replaced with omitted metadata.
  • SQLite message rows remain bounded in size.
  • Session restore does not require parsing megabytes of summary diffs.
  • Downstream consumers can safely hydrate sessions without custom cleanup.
  • Existing conversation content remains unaffected.

Activity

  1. github-actions
    assigned
    kitlangton
    on Jun 1, 2026
  2. github-actions commented on Jun 1, 2026

    @github-actions
    github-actionsBot
    on Jun 1, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This appears to be a Feature Request but does not use the Feature Request template. The title should start with [FEATURE]: and the issue should include the required verification checkbox confirming the feature does not already exist.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • Blank session history after restart when summary diffs embed huge file contents #17622: Same root cause — oversized summary.diffs embedded in message.data cause blank session rendering; includes a proposed two-layer fix (write-side bounding + read-side sanitization)
    • perf: diff pipeline causes severe UI lag on desktop — full-context patches + synchronous parsing on main thread #22650: Related — diff pipeline performance issues causing UI lag due to full-context patches

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. github-actions
    added
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Jun 1, 2026
  4. github-actions commented on Jun 1, 2026

    @github-actions
    github-actionsBot
    on Jun 1, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

  5. github-actions
    removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Jun 1, 2026
  6. github-actions
    closed this as not plannedon Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.