Release/0.2.2 - #106
Merged
Merged
Conversation
…ntrol frames - Delay reader keepalive pings until `start` is received, matching the writer behaviour, to avoid fatal sequence errors when a session registered at request time idles out before the start frame arrives. (session.rs) - Treat `ping`/`pong`/`abort` for tokens without a reader session as teardown lingering or pre-start desync rather than protocol violations. Drop them at debug level instead of raising an error that could abort the stream; data frames (`chunk`/`close`) continue to error. (registry.rs) - Bump SDK submodule to incorporate the changes above.
`ClientOpenStreamHandle::cancel(token, reason)` mirrors the existing `abort` path but works from any `Send` task. `ToolStreamCall` is `!Sync` due to its `BoxFuture`, so `abort(&self)` cannot be awaited inside a `tokio::spawn`. Without `cancel`, dropping a `ToolStreamCall` without aborting leaves the reader session in the registry until the keepalive probe times out. The new method publishes the abort frame and frees the registry slot via the idempotent `abort`/`consumer_abort` pair, giving consumers a clean, Send-safe cancellation mechanism.
The progress_token → event_id index in the server open-stream state was keyed solely by the token string. Since rmcp mints progress tokens from a per-peer counter (every client’s first stream carries token "0"), concurrent clients could clobber each other’s index entry. When one client cleaned up, it would delete the now-shared key, orphaning the other’s still-live writer. That client’s keepalive pings then found no writer, so no pong was sent, ultimately causing a "Probe timeout" on an otherwise-alive stream. This bug only surfaced with ≥2 concurrent clients, eluding single-client test suites. The fix introduces a composite key `client_pubkey:token`, mirrors the TS `getProgressTokenKey` approach and the existing per-peer reader registry. The write path and all removals now construct the key with the client’s hex-encoded pubkey. Slots (keyed by globally-unique event_id) and the already per-peer scoped oversized-transfer reassembly cache are unaffected. Closes the collision bug and restores correct multi-client stream teardown.
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.
No description provided.