Repository navigation
fix(mcp): keep 256 replay events per session as Protean does - #120
Merged
Merged
Conversation
Each MCP session buffers recent server events so a GET stream that reconnects with Last-Event-ID gets what it missed. Protean sizes that buffer with protean.mcp.session.replay-buffer, default 256, and drops the oldest first; Protrus hard-coded 100, so a reconnecting client lost events Protean would still replay. The buffer now defaults to 256 with the same eviction order, and embedders can change it through McpSessionStore::set_session_replay_buffer (0 keeps none). Like the idle timeout, the key is not in Java's ConfigRegistry, so it stays out of the config registry; design 17 records this. Closes #119 Tags: fix, mcp Co-Authored-By: htjulia <htjulia1@gmail.com>
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.
Summary
Protean keeps up to
protean.mcp.session.replay-buffer(default 256) recent events per MCP session forLast-Event-IDreplay and drops the oldest first (McpConfiguration.java:113,McpSession.java:99-100). Protrus hard-coded 100.McpSessionStorenow defaults the replay buffer to 256 (MCP_SESSION_REPLAY_BUFFER) with the same eviction order.McpSessionStore::set_session_replay_buffer(0 keeps none), mirroringset_session_idle_timeoutfrom fix(mcp): bind sessions to their principal and reclaim idle ones #115.ConfigRegistryand so stays out of the config registry: the standalone host uses 256.Tests
mcp_sessions_replay_the_newest_events_up_to_the_buffer_cap: default 256, oldest dropped first, a smaller cap trims on the next event, 0 keeps none.cargo test --workspace --locked: 412 passed, 0 failed, 6 ignored.Closes #119