Merge remote-tracking branch 'origin/main' into feat/support-agent-sandbox

This commit is contained in:
yyh
2026-03-25 11:50:33 +08:00
82 changed files with 1074 additions and 1135 deletions

View File

@ -125,7 +125,8 @@ class BroadcastChannel(Protocol):
a specific topic, all subscription should receive the published message.
There are no restriction for the persistence of messages. Once a subscription is created, it
should receive all subsequent messages published.
should receive all subsequent messages published. However, a subscription should not receive
any message published before the subscription is established.
`BroadcastChannel` implementations must be thread-safe and support concurrent use by multiple threads.
"""

View File

@ -64,7 +64,10 @@ class _StreamsSubscription(Subscription):
self._client = client
self._key = key
self._closed = threading.Event()
self._last_id = "0-0"
# Setting initial last id to `$` to signal redis that we only want new messages.
#
# ref: https://redis.io/docs/latest/commands/xread/#the-special--id
self._last_id = "$"
self._queue: queue.Queue[object] = queue.Queue()
self._start_lock = threading.Lock()
self._listener: threading.Thread | None = None