Skip to content

Release/0.2.2 - #106

Merged
ContextVM-org merged 5 commits into
mainfrom
release/0.2.2
Jul 29, 2026
Merged

Release/0.2.2#106
ContextVM-org merged 5 commits into
mainfrom
release/0.2.2

Conversation

@ContextVM-org

Copy link
Copy Markdown
Collaborator

No description provided.

…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.
@ContextVM-org
ContextVM-org merged commit bb17cc8 into main Jul 29, 2026
9 of 10 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