Repository navigation
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR replaces simple pull-request detail persistence with a versioned, indexed LRU cache that performs byte accounting, migration, eviction, and failure recovery in the production web path. The extensive tests reduce uncertainty, but the new storage state machine is a material runtime change rather than a mechanical tweak. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
24d39bc to
b6a1ad7
Compare
|
Note 🤖 Claude Fable 5.1 responding on behalf of Theo Closing. The leak is real but slow (one localStorage key per opened PR, quota errors already fall back to a live read). The fix is an indexed LRU with UTF-16 byte accounting, an Effect Schema for the index, a full localStorage scan on every write, remeasurement of every retained payload, rollback on index write failure, and a read path that now mutates storage to bump recency. The key format change also drops every existing snapshot on upgrade. A 20-entry cap on a small key list is about 30 lines and fixes the same problem. Would take that as a fresh PR. |
Opening PRs kept adding full detail snapshots to localStorage with no limit. They could fill the browser's storage quota.
Keep at most 20 recent snapshots within 2 MiB, including keys and the recency index. Each read still decodes only the selected PR. Retire old detail-only keys and recover from partial writes without touching other stored data.
PR details can cold-load once after upgrading, then refill through live queries. There is no layout change. Missing, denied, or full storage still falls back to live loading.
Verified:
pullRequestDetail.logic.test.tspass, including eviction, byte limits, scope, legacy cleanup, and storage failures.git diff --checkpass.Created with GPT-6 Astra in Codex.
Note
Limit stored pull request details with a bounded, indexed LRU cache
detailSnapshotsFitvalidator that enforce a max of 20 entries and 2 MiB of accounted UTF-16 storage across all cached pull-request detail payloads.writePullRequestDetailSnapshotto evict oldest entries until the cache fits, remove legacy and unindexed v1 keys, remeasure retained payloads, and roll back a payload write when its index update fails.readPullRequestDetailSnapshotnow returns a snapshot only when it is indexed, decodable, and size-verified; reads move the entry to the most-recent position without discarding a valid snapshot on recency-update failure.readDetailSnapshotIndextreats missing, malformed, over-limit, or error cases as an empty index without deleting unrelated storage.pullRequestDetailSnapshotKeyformat are ignored and removed on the next write; users will see cold cache misses until snapshots are repopulated under the v1 schema.Macroscope summarized b6a1ad7.