Uh oh!
There was an error while loading. Please reload this page.
feat(session): harden per-session SQLite sharding - #21012
Conversation
sjawhar
commented
Apr 4, 2026
Review guide for this PR: This PR is intentionally core-only. It does not contain the Postgres implementation; that lives in the external plugin PR at sjawhar/opencode-postgres-sync#1. Please focus review on three things:
|
515595f to
dd37895Compare685d3b7 to
343636aComparetest: add resolve() routing tests for shard/global DB routing 4 tests covering the sharding contract: - hasSession returns true from cache after Session.create() - Database.session() returns shard DB, not global DB - Cold cache uses 8KB file size threshold - Session list queries global DB regardless of shards - hasSession rejects empty/malformed shard files Prevents regression of the resolve() routing that broke when root_session_id was removed.
343636a to
cdc980fCompareThis PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
cdc980f to
fca4d2dComparefca4d2d to
9966cb2CompareThis pull request 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 pull request that follows our guidelines. |
Summary
SQLITE_BUSY*retries with backoff/jitteropencode-postgres-syncdist matches the sibling build and capture execution evidence under.sisyphus/evidenceVerification
bun test test/storage/retry.test.ts test/storage/pragma.test.ts test/storage/db.test.ts test/storage/wal-monitoring.test.ts test/storage/checkpoint-monitoring.test.ts test/storage/write-metrics.test.ts test/session/concurrency-load.test.tsOPENCODE_LOAD_SOAK_MS=300000 bun test test/session/concurrency-load.test.ts -t "soaks multi-process contention for the configured duration"bun testin/home/ubuntu/opencode/opencode-postgres-syncbun run buildin/home/ubuntu/opencode/opencode-postgres-syncdiff -qr /home/ubuntu/opencode/opencode-postgres-sync/dist /home/ubuntu/opencode/db/packages/opencode-postgres-sync/distNotes
< 3.51.3remains expected on this machine