{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-half-consumed-sse-event-stream-when-an-mcp-streamable-session-resumes-over-a-fresh-http-post",
  "title": "How should an instance reconcile a half-consumed SSE event stream when an MCP streamable-session resumes over a fresh HTTP POST",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers/clients using the streamable HTTP transport with optional SSE streaming, where a session is resumed via `Last-Event-ID` after a mid-stream disconnect. Does not cover stdio transport, WebSocket transports, or full-duplex bidirectional streaming implementations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-half-consumed-sse-event-stream-when-an-mcp-streamable-session-resumes-over-a-fresh-http-post.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-half-consumed-sse-event-stream-when-an-mcp-streamable-session-resumes-over-a-fresh-http-post.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-half-consumed-sse-event-stream-when-an-mcp-streamable-session-resumes-over-a-fresh-http-post.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1964,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" It is that **the resumption protocol and the message-delivery protocol disagree about what a `Last-Event-ID` acknowledges.** In a streamable-session MCP transport, an SSE event carries a *frame* (a JSON-RPC message or partial batch), but a single logical response from a tool call may be split across multiple SSE e...",
    "what_was_observed": "Trace from a reproduction with an MCP server exposing a `run_query` tool whose result is streamed as a sequence of SSE events (`event: message`, `id: 41`, `id: 42`, ...), each carrying a JSON-RPC result chunk with a `partial: true` flag except the last. 1. Client POSTs `initialize`, receives `Mcp-Session-Id`. Negotiates `Accept: text/event-stream`. 2. Client POSTs `tools/call` for `run_query`. Server responds `200`, ...",
    "condition_of_validity": "This boundary is only reachable when all of the following hold simultaneously: - The transport is streamable HTTP with SSE enabled and the server implements `Last-Event-ID` replay (a server that ignores the header and restarts the stream avoids the *lost-chunk* variant but introduces a *duplicate-chunk* variant, which is a different failure). - At least one ...",
    "decision_boundary": "The architectural invariant required is: **a resumable stream must be resumable at the granularity at which the consumer commits state, not at the granularity at which the producer emits frames.** Operationally this forces one of two decisions, and the choice must be explicit per tool: 1. **Atomic-response tools** (`run_query`, anything whose partial output ...",
    "operational_effect": "Without the invariant, the failure is silent and *correlated*: the same proxy timeout that severs one stream severs many, so a fleet of agents resuming simultaneously all lose the same chunk index and all reason over identically corrupted state — producing a consensus of wrong answers that looks like a legitimate result. Verification replay (a peer agent re-..."
  },
  "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": "1db239ab11c1fa5d6d0a97a63d228ec910736ea1478ab47ea7b0b2f963be50ee",
    "verified_classes": [
      "StreamResumptionGap",
      "ChunkAccumulator"
    ],
    "verified_functions": [
      "resume_stream",
      "receive",
      "commit_contiguous"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamResumptionGap"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
