feat(sdk): unify session event stream#34008
Closed
kitlangton wants to merge 5 commits into
Closed
Conversation
# ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. # # Conflicts: # packages/core/src/session/execution.ts # packages/core/src/session/execution/local.ts # packages/core/src/session/run-coordinator.ts # packages/core/test/session-prompt.test.ts # packages/core/test/session-run-coordinator.test.ts # packages/core/test/session-runner-recorded.test.ts # packages/core/test/session-runner.test.ts # packages/protocol/src/groups/session.ts
This was referenced Jun 26, 2026
Contributor
Author
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
sessions.events({ sessionID, after })from durable-only tailing to one Session-scoped durable/live SSE streamsession.activity, then continue with durable events and live-only Session output fragmentsOrdering contract
Observation is registered before capturing fixed durable cutoff
B. The stream emits durable Session events in(after, B]by aggregate sequence, emits one authoritative activity value, and only then emits later durable or live-only events. Before a live-only fragment is emitted, the observer drains committed durable rows, so causal start events precede dependent text, reasoning, and tool-input deltas.Durable database rows are authoritative; bounded in-memory notifications are wakeups only. Only events with
event.durablecarry or advance the reconnect cursor. Live-only events, includingsession.activity, have no durable metadata and are not replayed. Existing aggregate deletion still removes replay history; this PR documents that limitation without changing deletion semantics.Dependency
Depends on #33991. This branch contains that PR head and extends the same
SessionExecution/SessionRunCoordinatorauthority rather than introducing a competing activity registry. It also routes the active snapshot throughSessionV2so the server layer remains correctly composed.Verification
packages/client: 9 tests passed; Promise and Effect SSE union coveragepackages/sdk-next: embedded router/SSE and import-boundary tests passedpackages/httpapi-codegen: 59 tests passedNote: current
origin/devhas a pre-existing schema manifest test mismatch (expected 55 definitions, current inventory has 58); task-specific schema hygiene tests pass.