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
Streamable HTTP server replays the event named by Last-Event-ID on resume #1577
When a client reconnects with Last-Event-ID, LocalSessionManager (no external EventStore) replays the cached events starting at that id, not after it. The client gets the last event it already read a second time.
CachedTx::sync(index) in crates/rmcp/src/transport/streamable_http_server/session/local.rs skips index - front.index cached events and sends the rest, so the event at index is sent again. Both resume paths in LocalSessionWorker::resume pass last_event_id.index to it.
The standalone GET stream also has two events with id 0: the priming event that tower.rs puts in front of the stream, and the first cached event (CachedTx::new_common starts at index 0). Last-Event-ID: 0 is ambiguous there.
To Reproduce
On main (3725772), in the completed_channel_resume_tests style:
create_local_session, establish_request_wise_channel, register a progress token for it.
Send two progress notifications. The stream holds 0/0 (priming), 1/0, 2/0.
worker.resume("1/0".parse().unwrap()).
The resumed stream yields 1/0 and 2/0.
Over HTTP: open the standalone GET stream, let the server send one notification, read its id:, drop the connection, GET again with that id in Last-Event-ID. The notification arrives again.
Expected behavior
Only 2/0 is replayed. The transport spec says the header "indicate[s] the last event ID it received" and the server may "replay messages that would have been sent after the last event ID". EventStore::replay_events_after already has this contract; the in-memory path differs from it.
Impact
The rmcp client keeps the id of the last event it read and reconnects with it, and does not drop repeats. After a reconnect it handles that event twice: a notification handler runs twice, and a server request routed to the request's stream (elicitation, sampling) is executed twice.
Additional context
#1165 reported the same offset together with another change and was closed as stale without review. The other change landed in #1487.
I have a fix with tests and can open a PR.
AI disclosure: found, reproduced and written up with Claude Code (an AI coding agent).
Activity
github-actions commentedon Dec 5, 2026
@connor4312 is on triage rotation this week and is the reviewer for this one.
Automated classification did not run for this one, so it needs a full manual pass.
Automated triage. Labels are a first pass and the assigned maintainer has the final say.