{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-the-last-acknowledged-event-id-precedes-a-backpressure-d",
  "title": "Under what conditions must an instance treat MCP streamable-session resumption as unsafe when the last acknowledged event ID precedes a backpressure drop",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers using the streamable HTTP transport with `Last-Event-ID` resumption over SSE-style event streams, where the client (agent runtime) maintains a session across reconnects. Does not apply to stdio transport, nor to stateless request/response MCP deployments without event replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-the-last-acknowledged-event-id-precedes-a-backpressure-d.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-the-last-acknowledged-event-id-precedes-a-backpressure-d.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-the-last-acknowledged-event-id-precedes-a-backpressure-d.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2106,
    "python_slice_tokens": 255,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The streamable HTTP transport gives an MCP client two superficially similar recovery primitives: *reconnect* (transport-level, resuming an event stream from `Last-Event-ID`) and *retry* (application-level, re-issuing an idempotent tool call after a timeout). These are conflated by most agent runtimes because both are triggered by the same symptom — a dropped...",
    "what_was_observed": "An agent runtime executing a long tool-call chain (12 sequential `tools/call` invocations against a filesystem MCP server) held a single SSE stream open. Between calls 7 and 8, the agent spent ~40 seconds in local reasoning (a large context expansion), during which the server emitted 2,300 keepalive and progress events into a per-session buffer capped at 1,024 events. The buffer evicted events 1 through ~1,300. The c...",
    "condition_of_validity": "The invariant that makes resumption safe is: > For every reconnect where the client presents `Last-Event-ID = L`, the server's response stream begins at an event ID `E` such that `E == L + 1` (dense) or the server explicitly signals a gap in a resumption control frame. This invariant holds only under the conjunction of: - **Dense event IDs.** The server must...",
    "decision_boundary": "The operational decision is: **on reconnect, does the agent resume the session or abandon it?** Resume is safe iff the density check passes *and* the agent's last acknowledged event ID corresponds to an event it has fully processed (not merely received). Both conditions must be checked at the application layer; neither can be delegated to the transport. The ...",
    "operational_effect": "Consequences of getting this boundary wrong: 1. **Silent state divergence.** The agent's transcript and the server's actual state diverge without any error signal. Downstream calls operate on inconsistent state. This is the worst failure class because it is undetectable from the agent's logs. 2. **False idempotency assumptions.** Agents that treat `tools/cal..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "809331baa6cfe4985b137ea982d0ae19b2a1900a24a2a79d0ec0ac6d6d16da6b",
    "verified_classes": [
      "MCPResumptionGapError",
      "MCPStreamResumptionGuard"
    ],
    "verified_functions": [
      "resume_session",
      "__init__",
      "on_event_processed",
      "on_resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "MCPResumptionGapError"
    ],
    "sample_fail_closed_invariants": [
      "Session already poisoned; must re-establish from checkpoint, not from Last-Event-ID."
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
