You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash recovery hydrates working-thread transcripts at boot (#639 leftover) #643
Parent: #639 lazy-hydrates messagesByThread so boot does not JSON.parse transcripts.
recoverInterruptedRuns (electron/store.js) still does data.messagesByThread[t.id] for every thread with status === working. That goes through the lazy proxy and hydrates the full array before appending the crash event. A force-quit with N in-flight runs reintroduces N JSON.parse of transcript blobs on the next boot.
Plan
Append the crash event onto the lazy JSON range (string splice before ]) without parsing the array.
Fall back to a tiny hydrated [event] only when the thread has no lazy range.
Keep lazy.intact when the splice lands in the existing raw blob so the first save does not skip-scan every transcript.
Tests
Lazy fixture with a working thread and a large tool payload must not JSON.parse that payload during Store construct.
Thread stays unhydrated; getMessages later includes the crash event; sibling idle threads stay lazy.
Two working threads (range shift) + save/reload persist the event.
Live store is ~/Library/Application Support/Solenta/coder-store.json — read-only.
Implemented on coder/fork-fork-fork-boot-600-ms-synchronous-j-f9107c (on top of the #639 lazy-hydrate checkpoint).
recoverInterruptedRuns no longer reads data.messagesByThread[id] (that hydrates via the proxy). It splices the crash event onto the lazy JSON range with appendJsonArrayItem and keeps lazy.intact, so the first save does not skip-scan every transcript. Missing-key threads get a tiny hydrated [event].
Tests: 70 pass (store + json-envelope + threads-summaries), including two working threads with 8 KB tool canaries that must not be JSON.parsed during Store construct.
Live store (read-only, envelope only): 194 MB, 626 threads, 2 currently working. Envelope parse ~15 ms. Did not construct Store against the live file.
Audit 2026-08-22: not on main. appendJsonArrayItem does not exist in the tree — the fix is still only on coder/fork-fork-fork-boot-600-ms-synchronous-j-f9107c. Relabelled plan:doing.
Landed on main in the 2026-08-22 backlog merge (2d33d30..bf7c4dc), as part of the #639 lazy-hydrate branch.
Evidence on main: recoverInterruptedRuns(store, data) (electron/store.js:1013) now calls store._appendLazyMessage() (store.js:1286), which splices the crash-recovery message into the raw JSON range instead of hydrating the transcript. The comment at store.js:1007 cites this issue directly.
Activity
currentbits commentedon Aug 21, 2026
Implemented on
coder/fork-fork-fork-boot-600-ms-synchronous-j-f9107c(on top of the #639 lazy-hydrate checkpoint).recoverInterruptedRunsno longer readsdata.messagesByThread[id](that hydrates via the proxy). It splices the crash event onto the lazy JSON range withappendJsonArrayItemand keepslazy.intact, so the first save does not skip-scan every transcript. Missing-key threads get a tiny hydrated[event].Tests: 70 pass (store + json-envelope + threads-summaries), including two working threads with 8 KB tool canaries that must not be
JSON.parsed duringStoreconstruct.Live store (read-only, envelope only): 194 MB, 626 threads, 2 currently
working. Envelope parse ~15 ms. Did not constructStoreagainst the live file.currentbits commentedon Aug 22, 2026
Audit 2026-08-22: not on
main.appendJsonArrayItemdoes not exist in the tree — the fix is still only oncoder/fork-fork-fork-boot-600-ms-synchronous-j-f9107c. Relabelled plan:doing.currentbits commentedon Aug 22, 2026
Landed on
mainin the 2026-08-22 backlog merge (2d33d30..bf7c4dc), as part of the #639 lazy-hydrate branch.Evidence on main:
recoverInterruptedRuns(store, data)(electron/store.js:1013) now callsstore._appendLazyMessage()(store.js:1286), which splices the crash-recovery message into the raw JSON range instead of hydrating the transcript. The comment at store.js:1007 cites this issue directly.