{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-sse-last-event-id-resumption-against-mcp-session-state-when-the-streamable-http-transport-reconnects-mid-tool-call",
  "title": "Where must an instance reconcile SSE `Last-Event-ID` resumption against MCP session state when the streamable HTTP transport reconnects mid-tool-call",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients/servers using the Streamable HTTP transport where a server-initiated SSE stream carries JSON-RPC responses/notifications and the client resumes via `Last-Event-ID` after a disconnect. Does not apply to the deprecated HTTP+SSE dual-endpoint transport, stdio transports, or streams that carry no event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-last-event-id-resumption-against-mcp-session-state-when-the-streamable-http-transport-reconnects-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-last-event-id-resumption-against-mcp-session-state-when-the-streamable-http-transport-reconnects-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-last-event-id-resumption-against-mcp-session-state-when-the-streamable-http-transport-reconnects-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1694,
    "python_slice_tokens": 398,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent notions of \"resume\" in MCP-over-Streamable-HTTP, and they are routinely conflated: 1. **Transport-level resumption** — the SSE layer's `Last-Event-ID` replay buffer. This guarantees that *bytes the server already emitted* are re-delivered in order after a reconnect. It is a replay of a log, not a re-execution of logic. 2. **Session-...",
    "what_was_observed": "A tool call (`tools/call` with a long-running server-side operation, e.g. a code-execution or retrieval tool taking 40–90s) was issued over the Streamable HTTP transport. The server streamed progress notifications as SSE events with monotonically increasing `id:` fields, then held the connection open awaiting the final `result`. At T+35s the client's HTTP connection dropped (LB idle timeout, not a server event). The ...",
    "condition_of_validity": "The `Last-Event-ID` resume contract is only sound under a conjunction that the spec does not enforce: - The server MUST scope event IDs to the session (and ideally to the stream), not to a process-global counter. IDs are only meaningful relative to the buffer that produced them. - The server MUST retain in-flight tool-call state across a transport disconnect...",
    "decision_boundary": "The operative rule: > A replayed SSE stream is evidence about the *log*, not about the *session*. Resumption is only valid if the replayed event's correlation id maps to a live pending request AND the server's session state for that request survived the disconnect. Absent an explicit terminal event, the client must escalate to session-level recovery (re-issu...",
    "operational_effect": "Without this boundary, agents exhibit a *silent hang*: the reasoning loop blocks on a tool result that will never arrive, the token budget drains on heartbeats and retries, and the orchestrator's liveness probe (which checks SSE connectivity) reports green. The failure surfaces only at the outer timeout, misattributed to the tool or the model rather than to ..."
  },
  "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": "ab96bae15196f362f31fc6c412a1797bb14b0e82625740df923c95e6816212de",
    "verified_classes": [
      "SessionResumeDivergence",
      "PendingRequest",
      "ResumeState"
    ],
    "verified_functions": [
      "handle_replayed_event",
      "reconcile_after_reconnect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionResumeDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
