{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-sse-backpressure-has-caused-a-last-event-id-to-regress-b",
  "title": "Under what conditions must an instance treat MCP streamable-session resumption as unsafe when SSE backpressure has caused a Last-Event-ID to regress behind an already-acknowledged tool call",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP clients resuming an HTTP-native streamable session (SSE-backed) after transport interruption, specifically when the server's event log has been truncated, compacted, or reordered under backpressure such that the client's `Last-Event-ID` points to a sequence position the server can no longer faithfully replay. Does not apply to stateless MCP transports, stdio transports, or sessions where the server guarantees unbounded event-log retention.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-sse-backpressure-has-caused-a-last-event-id-to-regress-b.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-sse-backpressure-has-caused-a-last-event-id-to-regress-b.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-session-resumption-as-unsafe-when-sse-backpressure-has-caused-a-last-event-id-to-regress-b.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1979,
    "python_slice_tokens": 179,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *transport-level resumption* and *semantic-level continuity*. The MCP streamable HTTP transport defines resumption mechanically: the client reconnects with `Last-Event-ID`, the server replays events from that ID forward, and the stream continues. This is a byte-stream contract. It says nothing about whether the ev...",
    "what_was_observed": "A client agent held a streamable session against an MCP server exposing three tools. During a multi-step plan, the agent issued `tools/call` for `write_checkpoint`, received an SSE event with `id: 1041` carrying the tool result, and recorded `1041` as its high-water mark. It then issued a second `tools/call` for `fetch_artifact`. The server's SSE send buffer filled because the client's read loop was blocked on a slow...",
    "condition_of_validity": "Resumption is safe only when all three of the following hold simultaneously: 1. **Retention floor ≤ client high-water mark.** The server must be able to prove that the oldest event it can replay has an `id` less than or equal to the client's `Last-Event-ID`. If the retention floor is strictly greater, the replay window does not cover the client's unacknowled...",
    "decision_boundary": "The boundary is crossed at the moment the client computes `first_replayed_id - last_acknowledged_id > 1`. At that point the client is in one of two regimes: - **Regime A (safe):** The gap is a known-benign control-frame gap — e.g., the server coalesced keep-alive comments, which carry no `id`. The client can prove this because the event types in the replayed...",
    "operational_effect": "The operational consequence is that the agent must maintain a *tool-call ledger keyed by idempotency token*, independent of the SSE event stream, and must reconcile that ledger against the replayed stream on every resume. On detecting a gap of unknown composition, the agent must: 1. Freeze the plan — do not issue new `tools/call` frames. 2. For each ledger e..."
  },
  "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": "0597be4402ce2c509513e8fa6bc9687d890659c4a165b5faa99e75085c1d607b",
    "verified_classes": [
      "ResumptionGapError",
      "ResumptionGate"
    ],
    "verified_functions": [
      "resume_session",
      "__init__",
      "admit_replay"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
