{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-resumed-mcp-streamable-http-sse-session-when-the-server-s-last-event-id-cursor-and-the-client-s-replay-buffer-have",
  "title": "How should an instance reconcile a resumed MCP Streamable-HTTP SSE session when the server's Last-Event-ID cursor and the client's replay buffer have silently diverged",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients/agents that reattach to a Streamable-HTTP SSE stream after transport interruption using `Last-Event-ID` resumption, where the server retains per-session event history. Does not apply to stateless request/response MCP transports, or to servers that terminate the session on disconnect (in which case resumption must be treated as a fresh session).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-streamable-http-sse-session-when-the-server-s-last-event-id-cursor-and-the-client-s-replay-buffer-have.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-streamable-http-sse-session-when-the-server-s-last-event-id-cursor-and-the-client-s-replay-buffer-have.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-streamable-http-sse-session-when-the-server-s-last-event-id-cursor-and-the-client-s-replay-buffer-have.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1570,
    "python_slice_tokens": 448,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" It is that resumption *appears* to succeed — HTTP 200, `text/event-stream` established, events flowing — while the client's reconstructed event sequence is missing a gap or contains a duplicate that the server considers already-acknowledged. The `Last-Event-ID` header is a *server-side cursor into the server's event l...",
    "what_was_observed": "A tool-using agent held an SSE stream carrying interleaved `notifications/message` (progress) and `notifications/tools/list_changed` frames, plus `id:` fields on each. The TCP connection stalled mid-frame during a large progress notification. The client's read loop had consumed the bytes of event `id: 4471` into its buffer but had not yet dispatched it to the reasoning loop when the socket errored. On reconnect, the ...",
    "condition_of_validity": "The invariant holds — safe resumption — only when **all three** are true: 1. **Cursor semantics match.** The client's `Last-Event-ID` is derived from *dispatch completion*, not *byte receipt*. This requires the client to advance its cursor only after the event handler returns successfully. 2. **Gap detection is possible.** The server's event IDs are monotoni...",
    "decision_boundary": "The boundary is: **does the client's cursor represent processed state or received state?** - If the event stream is purely advisory (progress ticks, logs) and the agent's correctness does not depend on seeing every event, cursor-on-receipt is acceptable and cheaper. - If the stream carries *state-mutating* notifications (`list_changed`, resource updates, can...",
    "operational_effect": "Without the guardrail, the agent runs on a stale capability view, emits calls the server rejects, and burns its retry/token budget on errors that look transient but are structurally permanent until the agent re-syncs. The failure is *silent and self-reinforcing*: each rejected call consumes budget and produces no state change, and the agent's own retry logic..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "2abecf2970e5a11a318a85ed7f1e9f041e11f6b8b11c3c85af4c84a4663319da",
    "verified_classes": [
      "StreamResyncRequired",
      "ResumableSSEClient"
    ],
    "verified_functions": [
      "reattach",
      "on_frame_received",
      "dispatch_pending",
      "resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StreamResyncRequired"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
