Repository navigation
feat(streaming): add automatic Thread SSE resumption - #36
Merged
Merged
Conversation
This was referenced Oct 29, 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.
Summary
Add
sessions.threads.events.resumable_stream(sync and async) to Forward and Managed. Retryable disconnects resume from the last received SSE cursor with request options preserved;session.thread_status_idlekeeps the subscription open, while Thread/Session termination or Session deletion ends it. Add a typedLast-Event-IDparameter to Managed Thread streams and keep the existing one-shot API available.Why
Thread event streams currently expose only a single connection, so callers must manage reconnection and cursor recovery themselves. The new opt-in helper reuses the Session retry engine while treating Thread termination as a normal end to the subscription.
Verification
uv run make lintuv run make typecheckuv run make testuv run make docs-check--helpsmoke checks4309 offline tests passed; 73 account-backed cases were deselected. Sync and async tests cover real local HTTP truncation, EOF, cursor/header preservation, retryable and non-retryable statuses, idle/termination semantics, and cancellation. The package build, 34 README snippet checks, changelog validation, and 25 release automation tests passed. Standalone examples were unchanged; their
--helpchecks were not run. Account-backed integration and QA-package acceptance remain pending after merge.Impact
CHANGELOG.mdunderUnreleased.env.live, logs, or generated test output committedAdditional context: this adds an SDK helper over existing HTTP routes, so the endpoint fixture inventory is unchanged. Dedicated behavioral contract tests and helper inventory entries were added. The change is additive and does not require migration or a version bump in this PR. The three SDK changes are submitted together on
codex/thread-sse-resumption.Related SDK PRs: go, ts.