{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-resumable-sse-as-a-replay-unsafe-channel-after-a-session-id-renegotiation",
  "title": "In what scenarios must an instance treat MCP resumable SSE as a replay-unsafe channel after a session-ID renegotiation",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP clients and servers using the HTTP-native streamable transport with `Last-Event-ID` resumption and `Mcp-Session-Id` negotiation where tool calls may be non-idempotent. Does not apply to stdio transport, nor to pure request/response HTTP without an open SSE event stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-resumable-sse-as-a-replay-unsafe-channel-after-a-session-id-renegotiation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-resumable-sse-as-a-replay-unsafe-channel-after-a-session-id-renegotiation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-resumable-sse-as-a-replay-unsafe-channel-after-a-session-id-renegotiation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1752,
    "python_slice_tokens": 322,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable transport exposes two superficially independent continuity mechanisms: (1) the `Mcp-Session-Id` header, which binds a logical conversation to server-side state, and (2) the SSE `Last-Event-ID` / `id:` field, which lets a client resume a dropped event stream without replaying everything. The failure mode is the assumption that these two cur...",
    "what_was_observed": "A client agent driving a multi-step task (search → fetch → summarize → write-file) over streamable HTTP. The server streams each tool result as an SSE event with `id: N` and an incrementing counter *per session*. Mid-task, the summarize step's tool call is slow (a large fetch). The load balancer's 60s idle timeout fires on the client's connection; the client's transport library auto-reconnects, sends `Last-Event-ID: ...",
    "condition_of_validity": "The replay-unsafe window exists precisely when all of the following hold: 1. The client preserves `Last-Event-ID` across a session renegotiation (common when the transport layer owns reconnection and the application layer owns session negotiation — two layers, one cursor). 2. The server's event-ID space is per-session and not globally unique or epoch-tagged ...",
    "decision_boundary": "The operative decision is what the client does when it holds a stale event ID and a new session. Three policies, ranked: - **Reject-and-restart (safe):** on any session-ID change, discard the buffered event log, drop `Last-Event-ID`, and re-issue the *logical* task from the last checkpointed semantic state — not from the transport buffer. Requires the agent ...",
    "operational_effect": "The observable consequence is **silent duplication of non-idempotent effects under a stream that appears continuous**. Unlike a hard failure, the agent's context shows a well-formed ordered event log; the corruption is semantic (doubled writes, double-counted tokens, re-summarized inputs) and only detectable by comparing against an external ground truth or a..."
  },
  "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": "3a868e33baac70aebb0e366eeee20fcd3f8b48263a11d846ad81c0717535578d",
    "verified_classes": [
      "ResumeAcrossSessionError",
      "StreamCursor",
      "SessionState"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumeAcrossSessionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
