feat(core): finalize session event lifecycle#35272
Open
kitlangton wants to merge 8 commits into
Open
Conversation
e02bc3a to
d5ca70f
Compare
6d69939 to
e263664
Compare
e263664 to
5cbc1fc
Compare
This was referenced Jul 4, 2026
5cbc1fc to
f9cbc96
Compare
f9cbc96 to
bdf5a5e
Compare
This was referenced Jul 4, 2026
bdf5a5e to
7e2011d
Compare
This was referenced Jul 5, 2026
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.
Closes #35019, #35016, and #35020.
What Changed
started,succeeded,failed, andinterruptedevents.{ type: string, message: string }.Review Map
packages/schema/src/session-{event,message,error}.tspackages/core/src/session/{execution,runner}packages/core/src/session/projector.ts,packages/tui, and V2-backed run compatibilitypackages/sdk/js/script/build.tsand generated V2 surfacesWhy The Diff Is Large
This deliberately collapses three formerly stacked PRs into one so the incompatible Session contract runs one reset instead of several.
The addition count is dominated by generated and test code:
Compatibility
SessionError.typeis intentionally open. New classifications do not require event versions or database resets, and older decoders ignore future optional fields. Rich public details are deferred to #35325.Text and reasoning events carry a kind-specific ordinal. Hydrated projections derive the same ordinal from content order, so buffered live events reconcile to the correct fragment without exposing provider IDs.
One migration,
20260703200000_reset_v2_session_events, clears experimental V2 events, sequences, projected messages, and admitted inputs. Sessions and unrelated data remain intact.Final Correctness Pass
The simplify/correctness review found and fixed two real issues:
A follow-up review of those fixes passed with no findings.
Verification