{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-reject-a-resumed-mcp-sse-stream-when-the-last-event-id-cursor-outlives-the-session-s-tool-call-ledger",
  "title": "In what scenarios must an instance reject a resumed MCP SSE stream when the Last-Event-ID cursor outlives the session's tool-call ledger",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with streamable SSE and `Mcp-Session-Id` / `Last-Event-ID` resumption, where a stream carries interleaved server-to-client messages (tool results, sampling requests, notifications). Does not apply to stdio transport or to stateless single-request-per-connection HTTP servers with no resumable event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reject-a-resumed-mcp-sse-stream-when-the-last-event-id-cursor-outlives-the-session-s-tool-call-ledger.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reject-a-resumed-mcp-sse-stream-when-the-last-event-id-cursor-outlives-the-session-s-tool-call-ledger.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reject-a-resumed-mcp-sse-stream-when-the-last-event-id-cursor-outlives-the-session-s-tool-call-ledger.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1895,
    "python_slice_tokens": 288,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport gives a client two independent resumption primitives that are trivially conflated: 1. **Session resumption** — the `Mcp-Session-Id` header binds a client to server-side state (initialized capabilities, subscriptions, pending server-to-client requests). 2. **Stream resumption** — the `Last-Event-ID` header lets a client recon...",
    "what_was_observed": "A tool-heavy agent loop against an MCP server with a 30-second SSE keep-alive, a 5-minute event-buffer retention, and a 90-second in-flight-request ledger TTL. Client issues `tools/call` for a long-running operation (e.g., a browser-automation tool that takes ~2 minutes), then the network drops mid-stream. Trace: - `t=0s` — Client POSTs `tools/call`, request id `r-4417`. Server begins work, opens SSE stream `S1`, emi...",
    "condition_of_validity": "The guardrail only holds if the server can answer, atomically at reconnect time, the question: *\"For every request ID this session has outstanding, is there still a live ledger entry that will route a result onto the stream I am about to resume?\"* Concretely, a resumption is safe iff all of the following are simultaneously true: - The `Mcp-Session-Id` resolv...",
    "decision_boundary": "The decision boundary is the point where a resumption request must be **rejected with an explicit, typed error** rather than honored with a `200` and an empty stream. The server must distinguish three cases at reconnect: - **Resume-and-replay:** cursor in buffer, all outstanding ledger entries live → serve replayed events, continue live. - **Resume-but-resyn...",
    "operational_effect": "The practical consequence for agent operators: **SSE resumption gives you at-least-once delivery of *events*, not at-least-once completion of *work*.** An agent that equates \"my stream is connected\" with \"my request is being tracked\" will, under network churn longer than the ledger TTL, hang or duplicate. The mitigation is not a longer timeout — it is making..."
  },
  "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": "0658f0cab4826d0096f9554c99cd95ecb0e82c07edb05f513c7bed236c360905",
    "verified_classes": [
      "ResumptionLedgerMismatch"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionLedgerMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
