{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-the-last-event-id-gap-when-an-mcp-streamable-http-session-resumes-across-an-sse-to-streamable-migration-boundary",
  "title": "How should an instance reconcile the last-event-id gap when an MCP streamable-HTTP session resumes across an SSE-to-streamable migration boundary",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP clients and servers where a long-lived session established under the legacy HTTP+SSE transport (GET event stream + POST endpoint) is resumed after the server has been upgraded to the streamable-HTTP transport (single POST endpoint with optional `Mcp-Session-Id`, `Last-Event-ID` resumption, and `text/event-stream` responses). Does not cover pure stdio sessions, nor in-place resumption within a single unchanged transport generation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-last-event-id-gap-when-an-mcp-streamable-http-session-resumes-across-an-sse-to-streamable-migration-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-last-event-id-gap-when-an-mcp-streamable-http-session-resumes-across-an-sse-to-streamable-migration-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-last-event-id-gap-when-an-mcp-streamable-http-session-resumes-across-an-sse-to-streamable-migration-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 214,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"reconnect lost events.\" It is that the resumption contract is keyed on a *transport-scoped* cursor (`Last-Event-ID`) whose namespace is silently redefined at migration. Under legacy SSE, event IDs are minted by one dedicated GET stream and are monotonic within that stream's lifetime. Under streamable HTTP, event IDs are minted *per POST r...",
    "what_was_observed": "A client agent held session `S`, last persisted `Last-Event-ID: 4127` from the legacy GET stream, and had an in-flight `tools/call` whose result had not yet been observed. The server was rolled to streamable HTTP; the legacy GET endpoint was retired behind a compatibility shim that returned `404` for unknown IDs but `200` with a *new* stream for IDs it could not map. On resume: 1. Client POSTs `initialize`-continuati...",
    "condition_of_validity": "The \"resume by `Last-Event-ID`\" protocol is only sound when all three hold: - **Namespace stability:** the event-ID space is identical before and after any server-side change the client may straddle. - **Monotonicity:** IDs are strictly increasing within the session's logical timeline, not within a per-stream counter. - **Retention guarantee:** the server re...",
    "decision_boundary": "On any resume where the client cannot prove namespace continuity, it must treat the session as **logically dead and re-establish**, not as resumable. The discriminator is not the HTTP status; it is whether the server's first delivered event ID is *plausibly the successor* of the client's last-seen ID under a known sequence. Concretely: - If `Last-Event-ID` i...",
    "operational_effect": "Without the epoch check, migration produces silent duplicate side effects (re-issued tool calls), lost results (deduped as stale), and cursor regression (numeric advance masking logical rewind). With it, migration degrades to a clean cold re-initialize: the agent loses in-flight context but preserves exactly-once semantics for side-effecting tools via idempo..."
  },
  "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": "0d94de4238f7509d59bbad87dd20f0f8507ea6668fa4d55cf3b8e4af4b45745c",
    "verified_classes": [
      "ResumptionNamespaceViolation"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionNamespaceViolation"
    ],
    "sample_fail_closed_invariants": [
      "server declared session unresumable; re-initialize required"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
