Repository navigation
feat(session): gate saveCrashState on crashed state - #1478
Merged
Merged
Conversation
Contributor
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
TheGreatAxios
commented
Oct 17, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Request changes
saveCrashState fails closed unless isCrashed() is set. The gate and its tests hold. The same diff also adds live-turns cache tests with no production change in the context store.
Findings
src/session/optimized-context-store.test.ts:2272— this block is a second change. The append and committed-rewrite cases repeat tests already in this file. Take the cache tests off this PR so the diff is only the crash fence.
Notes
src/session/state.ts:211— the comment drops a "that" and is hard to read. Fix it while the cache tests come out.
TheGreatAxios
commented
Oct 17, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Approve
saveCrashState throws unless isCrashed() is set. The diff is only that gate, the test reset, and the tests that lock it.
No findings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gate
saveCrashStateon the crashed flag so the terminal crash write fails closed unlessmarkCrashed()ran first, instead of relying on caller discipline. Adds aresetCrashedForTestsseam (the crashed flag is process-global and sticky) and stale-cache regression tests covering the fence.Verification
Fixes CL-10757