Skip to content

fix(opencode): avoid rendering oversized snapshot diffs#29874

Open
Yoshi-OOF wants to merge 8 commits into
anomalyco:devfrom
Yoshi-OOF:fix/large-snapshot-diffs
Open

fix(opencode): avoid rendering oversized snapshot diffs#29874
Yoshi-OOF wants to merge 8 commits into
anomalyco:devfrom
Yoshi-OOF:fix/large-snapshot-diffs

Conversation

@Yoshi-OOF
Copy link
Copy Markdown

@Yoshi-OOF Yoshi-OOF commented May 29, 2026

Issue for this PR

Closes #29873

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Prevents very large snapshot diffs from hanging session loading or diff rendering.

The snapshot service now skips oversized per-file patch text while keeping file, additions, deletions, and status metadata. The TUI also avoids rendering huge diff strings, and the web UI defers diff parsing until an expanded diff is actually shown.

How did you verify your code works?

  • bun typecheck in packages/opencode
  • bun typecheck in packages/ui
  • bun test test/snapshot/snapshot.test.ts --timeout 30000 -t "diffFull omits patches that are too large to render safely"
  • bun turbo typecheck via pre-push hook
  • I verified the fix by running cargo fmt in a Rust project with 64 unformatted files totaling several hundred thousand lines.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Large snapshot diffs can hang session loading

1 participant