{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-fresh-capability-negotiation-rather-than-a-replay-and-how-does-the-s",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resumption as a fresh capability negotiation rather than a replay, and how does the SSE-to-StreamableHTTP migration silently violate that invariant?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers that resume a broken server-to-client stream via `Last-Event-ID` over the StreamableHTTP transport, especially when the server was migrated from the legacy HTTP+SSE transport. Does not apply to stdio transports, nor to stateless request/response MCP servers with no resumable event stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-fresh-capability-negotiation-rather-than-a-replay-and-how-does-the-s.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-fresh-capability-negotiation-rather-than-a-replay-and-how-does-the-s.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-fresh-capability-negotiation-rather-than-a-replay-and-how-does-the-s.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1899,
    "python_slice_tokens": 233,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure hinges on a distinction that the MCP spec leaves implicit: **a resumption token is an offset into an event log, not a reference to a session's negotiated state.** When a client reconnects with `Last-Event-ID`, the StreamableHTTP transport guarantees *at-least-once delivery of events after that ID* — it does **not** guarantee that the server still...",
    "what_was_observed": "A representative trace from an agent runtime migrating a filesystem MCP server from SSE to StreamableHTTP: 1. Client opens `POST /mcp` with `initialize`, receives `Mcp-Session-Id: s-7f2a` and negotiated `capabilities: {tools: {}, resources: {subscribe: true}}`. Stream opens with `Last-Event-ID` absent; events begin at `id: 100`. 2. The agent runs a long tool chain. At event `id: 147` the connection drops (proxy idle ...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **only** when all of the following hold simultaneously: - The server's event log is *causally bound* to the session state that produced it — i.e., the server can emit a fingerprint of the negotiated capability surface and protocol version at stream open, and re-emit the same fingerprint on resume. If the fingerprint differs...",
    "decision_boundary": "The operative rule for an agent instance: - If the resume response carries a capability fingerprint (or `protocolVersion` + `capabilities` echo) **identical** to the one captured at stream open, and the event IDs are contiguous from `Last-Event-ID`, treat it as a true replay: apply events in order, suppress duplicate side effects via idempotency keys on outb...",
    "operational_effect": "Without the fingerprint check, long-running agents exhibit a characteristic failure signature: they complete the current tool call (the replayed event stream carries it through), then diverge on the *next* capability-dependent step. The divergence is delayed by exactly one planning cycle, which makes it look like a reasoning error rather than a transport err..."
  },
  "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": "895ccf712e90873f2302914c75513a6b9e2f28833447a1e806eeeb4087abffca",
    "verified_classes": [
      "CapabilityDriftOnResume",
      "StreamOpenState",
      "ResumeResponse"
    ],
    "verified_functions": [
      "validate_resumption",
      "fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CapabilityDriftOnResume"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
