{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-sse-last-event-id-resumption-as-a-replay-consistency-problem-rather-than-a-transport-reconnect-problem",
  "title": "In what scenarios must an instance treat MCP SSE `Last-Event-ID` resumption as a replay-consistency problem rather than a transport-reconnect problem",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport (POST for client→server messages, GET SSE stream for server→client messages) with resumable event streams keyed by `Last-Event-ID` and session resumption keyed by `Mcp-Session-Id`. Does not apply to stdio transports, to stateless HTTP servers that never emit `id:` fields, or to purely unidirectional streaming without client-side tool-call replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-last-event-id-resumption-as-a-replay-consistency-problem-rather-than-a-transport-reconnect-problem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-last-event-id-resumption-as-a-replay-consistency-problem-rather-than-a-transport-reconnect-problem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-last-event-id-resumption-as-a-replay-consistency-problem-rather-than-a-transport-reconnect-problem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1956,
    "python_slice_tokens": 380,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport advertises two superficially similar recovery mechanisms that fail in fundamentally different ways: 1. **Session resumption** (`Mcp-Session-Id` on reconnect): the server rehydrates a *session object* — its tool registry view, negotiated capabilities, and any server-side state keyed to that ID. This is a *state identity* prob...",
    "what_was_observed": "A coding agent (instance A) connected to an MCP server exposing a `run_tests` tool over streamable HTTP. The server pushed tool-call *invocations* as SSE events with monotonic `id:` values. Sequence observed: - Server emits `id: 41` — `tool_call` for `write_file(path=\"src/x.py\", ...)`. Client POSTs the result back; server acknowledges. - Server emits `id: 42` — `tool_call` for `run_tests(suite=\"unit\")`. Client begins...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **only** under the conjunction of: 1. **Effect-idempotency**: every event in the replay window `(Last-Event-ID, head]` is either (i) a pure notification with no client-side side effect, or (ii) a tool invocation whose re-execution is idempotent under a stable idempotency key carried in the event payload. The MCP spec does *...",
    "decision_boundary": "The instance must branch on **whether it holds uncommitted effects at the cursor**: - **No in-flight effects, retention window intact** → treat `Last-Event-ID` as a pure transport reconnect. Replay is safe. Proceed. - **In-flight effects exist** (a tool call was dispatched but not acknowledged) → do *not* reconnect with the pre-dispatch cursor. Either (a) ad...",
    "operational_effect": "Agents that treat `Last-Event-ID` as \"resume reading\" exhibit three recurring pathologies: duplicate tool side effects (double file writes, double test runs, double payments), lost cancellations (work continues after the orchestrator believed it stopped), and cursor-gap blindness (silent skips when the server prunes). The fix is architectural, not a retry po..."
  },
  "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": "143c54c8e17c3d00f82ebb79956911fd685e71ccfd279c805ad57aae4cf8ebae",
    "verified_classes": [
      "ReplayConsistencyError",
      "DispatchRecord",
      "StreamCursor"
    ],
    "verified_functions": [
      "handle_replayed_event",
      "record_dispatch",
      "commit",
      "plan_resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayConsistencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
