Skip to content

fix: safely sync large session files - #76

Merged
iHildy merged 1 commit into
mainfrom
ian/fix-large-session-files
Aug 31, 2026
Merged

fix: safely sync large session files#76
iHildy merged 1 commit into
mainfrom
ian/fix-large-session-files

Conversation

@iHildy

@iHildy iHildy commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace oversized opencode.db bundles and legacy storage/message files with a versioned, content-addressed chunk representation
  • validate strict count/size/mode/SHA-256 metadata, reject symlinks and corrupt/missing/extra parts, and reconstruct through staged atomic replacement
  • protect the reserved chunk namespace with a versioned ownership marker, bounded known-location cleanup, and realpath containment
  • detect oversized blobs in unpushed Git ancestry and fail closed with exact backup-branch/rebuild commands instead of silently rewriting history

This is a fresh replacement for the already-closed #48. It preserves plain legacy session files and normal non-session files.

Closes #45

Safety and compatibility

  • chunks start above 50 MiB and are at most 40 MiB each
  • v1 pointers cap reconstructed files at 4 GiB and 128 parts
  • database, WAL, and SHM files validate and install or roll back as one bundle
  • file modes are retained in pointer metadata
  • stale/corrupt pointers, source mutation, filename collisions, namespace collisions, and ancestor symlink escapes fail closed
  • old failed oversized commits are not rewritten automatically; the error first instructs creation of an exact backup branch, then rebuilds only unpushed history when the user elects to run the commands

Verification

  • bun run check
  • bun test — 129 passed, 0 failed
  • bun run build
  • independent final focused audit — 33 passed, 0 failed; no blocker
  • realistic production-threshold two-home exercise: 52 MiB opencode.db and 51 MiB legacy message round-tripped A→B and modified B→A with matching SHA-256 and modes 0600/0640; largest committed blob was 41,943,040 bytes
  • isolated two-instance GitHub E2E — passed; sentinel replicated and ephemeral private repo deleted
  • isolated GitHub E2E with --enable-sessions — passed; repo session titles verified after link and pull, with expected restart requirement for the live local database; ephemeral private repo deleted

Expected harness-only warnings were the unsecured loopback test server, duplicate copied sandbox skill, live local DB restart requirement, and local AGENTS.md lag while repo replication was confirmed.

@iHildy
iHildy merged commit 5be4e06 into main Aug 31, 2026
2 checks passed
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.

Push fails when session message files exceed GitHub's 100MB file size limit

1 participant