sync wire fix (bare array + string delivery_id), WS delivery acks, dedup, terminal closes — 1.0.31#1
Merged
Merged
Conversation
…dup, terminal closes — 1.0.31
Python mirror of the TS SDK 1.0.21 fix. The /v1/messages/sync drain read
batch.get('envelopes') off what production actually sends (a bare JSON
array) and gated delivery ids on isinstance(int) against string del_
cursors — so every offline drain silently returned zero rows and never
acked. The 1.0.3 release was the directory-auth change only; this path
was never fixed until now.
- sync() -> list[SyncRow] (TypedDict, unknown fields pass through);
sync_ack(str) -> {'acked': int}; last_sync_delivery_id() helper
- drain: cursor pagination, positional ack of the settled prefix,
clean-prefix stop on invalid rows, no-progress guard, errors via
on_error (never silent)
- WS delivery acks per docs/realtime-delivery-ack.md: HELLO advertises
['ack'], dormant unless hello.ok echoes it; ack only after handlers
settle; exception -> no ack -> redelivery
- bounded message-id dedup (default 2048) across live+drain
- close codes 1008/4401/4403 terminal (self HELLO-timeout 1008 exempt)
- paginator audit vs live routes: contacts/agents keys match, no drift
- new wire-contract test suite incl. end-to-end drain over respx mock
ruff + mypy strict + pytest: 136 passed, 1 skipped (live-gated).
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.
What
Python mirror of agentchat-typescript#1. The
/v1/messages/syncdrain readbatch.get('envelopes')off what production actually sends (a bare JSON array) and gated delivery ids onisinstance(int)against stringdel_cursors — every offline drain silently returned zero rows and never acked. The 1.0.3 release was the directory-auth change only; this path was never fixed until now.Changes
sync()→list[SyncRow](TypedDict, unknown fields pass through);sync_ack(str)→{'acked': int};last_sync_delivery_id()helperon_error— the silent failure mode is structurally impossible nowdocs/realtime-delivery-ack.md: dormant unlesshello.okechoes the capability; ack only after handlers settle; exception ⇒ no ack ⇒ redeliverycontacts/agentskeys match — no drift; nothing readsitemsVerification
ruffclean,mypystrict clean,pytest: 136 passed / 1 skipped (live-gated) — the exact CI gate trioRelease
Not published. Follow-up after release: raise agentchat-hermes' SDK floor so the plugin picks up the fixed drain.