Skip to content

feat(streaming): add automatic Thread SSE resumption - #37

Merged
moonyue-w merged 1 commit into
mainfrom
codex/thread-sse-resumption
Oct 29, 2026
Merged

moonyue-w merged 1 commit into
mainfrom
codex/thread-sse-resumption

Conversation

@moonyue-w

@moonyue-w moonyue-w commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add sessions.threads.events.resumableStream to Forward and Managed. Retryable disconnects resume from the last received SSE cursor with request options preserved; session.thread_status_idle keeps the subscription open, while Thread/Session termination or Session deletion ends it. Add a typed Last-Event-ID parameter 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

  • npm run build
  • npm run typecheck
  • npm test
  • npm run docs:check
  • Relevant examples run or import successfully
  • Account-backed integration tests run, or not required

4450 offline tests passed, including public type checks and local HTTP truncation tests. Tests cover cursor/header preservation, retryable and non-retryable statuses, idle/termination semantics, cancellation, and unchanged Session behavior. All 36 README snippets compiled; npm pack --dry-run, changelog validation, and 25 release automation tests passed. Standalone examples were unchanged and were not run against an account. Account-backed integration and QA-package acceptance remain pending after merge.

Impact

  • Public API or behavior changed
  • User-facing changes added to CHANGELOG.md under Unreleased
  • Generated API documentation updated
  • CommonJS, ESM, and subpath exports remain valid
  • Contract fixtures updated
  • Go, Python, and TypeScript parity considered
  • Migration notes added for a breaking change
  • No credentials, .env.live, logs, or generated test output committed

Additional 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, python.

@moonyue-w
moonyue-w merged commit 6a0593d into main Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant