You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9c270c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@ existing `0.1.0` release; earlier development prereleases are not listed.
5
5
6
6
## [Unreleased]
7
7
8
+
### Added
9
+
10
+
- Add automatic Thread SSE resumption for Forward and Managed, preserving the latest event cursor and request options across retryable disconnects; thread termination stops the subscription while idle events keep it open.
11
+
- Add a typed `Last-Event-ID` parameter to Managed Thread streams.
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -492,6 +492,38 @@ with client.sessions.events.stream(
492
492
493
493
Reuse one `session_id` for the whole conversation, and reuse one idempotency key across HTTP retries of the same logical message. `event_deltas` opts into incremental events for the listed types; those previews are not deduplicated, and the final event repeats the complete content, so render deltas but treat the final event as the source of truth. An idle status does not by itself mean success — the session may be waiting for a confirmation or have reached its budget, so check `stop_reason` and the final reply.
494
494
495
+
496
+
### Thread event resumption
497
+
498
+
Forward and Managed also support automatic resumption for a single Thread. Use the
499
+
same retry and cancellation behavior as Session streams, with a thread-scoped
500
+
`Last-Event-ID` cursor:
501
+
502
+
```python
503
+
# Forward and Managed use the same call shape.
504
+
with client.sessions.threads.events.resumable_stream(
`session.thread_status_idle` ends only the current turn, so the subscription stays
519
+
open. `session.thread_status_terminated`, `session.status_terminated`, or
520
+
`session.deleted` ends it normally. A non-retryable error (including an invalid
521
+
cursor or missing thread) is returned to the caller; the SDK never clears the
522
+
cursor to silently start over. The existing one-shot Thread stream remains
523
+
available. See the [Forward Thread stream](https://docs.qoder.com/cloud-agents/api/forward/sessions/stream-thread-events)
524
+
and [Managed Thread stream](https://docs.qoder.com/cloud-agents/api/sessions/threads/events/stream)
525
+
contracts for cursor validity.
526
+
495
527
## Resuming a stream
496
528
497
529
The low-level `stream()` method exposes `stream.last_event_id` but does not reconnect. Use the handwritten `resumable_stream()` helper to reconnect automatically after EOF, timeouts, transient transport failures, and retryable HTTP statuses. It checkpoints only complete events and sends the latest checkpoint as `Last-Event-ID`; close it with a context manager when finished.
0 commit comments