Skip to content

fix(opencode): avoid snapshotting files over 2MB#19043

Merged
thdxr merged 6 commits intodevfrom
fix/snapshot-skip-large-files
Mar 25, 2026
Merged

fix(opencode): avoid snapshotting files over 2MB#19043
thdxr merged 6 commits intodevfrom
fix/snapshot-skip-large-files

Conversation

@thdxr
Copy link
Member

@thdxr thdxr commented Mar 25, 2026

Summary

  • replace the snapshot git add . with path-by-path staging so changed files can be size-checked first
  • skip files larger than 2MB while still staging deletions and keeping snapshot patch/diff output aligned with the filtered index
  • add regression tests for under-limit files plus oversized added and modified files

Testing

  • bun test test/snapshot/snapshot.test.ts
  • bun typecheck

Size-check changed paths before staging so large files do not end up in the snapshot index. Keep patch and diff output aligned with the filtered staged state.
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@thdxr thdxr added the beta label Mar 25, 2026
@thdxr thdxr enabled auto-merge (squash) March 25, 2026 01:17
@thdxr thdxr merged commit 0a80ef4 into dev Mar 25, 2026
8 checks passed
@thdxr thdxr deleted the fix/snapshot-skip-large-files branch March 25, 2026 04:43
Andres77872 pushed a commit to Andres77872/opencode that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant