{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-mid-stream-sse-resumption-failure-when-an-mcp-session-migrates-from-legacy-sse-transport-to-streamablehttp",
  "title": "How does an instance detect mid-stream SSE resumption failure when an MCP session migrates from legacy SSE transport to StreamableHTTP",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP clients and servers performing a live migration from the legacy HTTP+SSE transport (dual-endpoint: `GET /sse` for server→client events, `POST /messages` for client→server) to the StreamableHTTP transport (single endpoint, optional `Mcp-Session-Id`, `Last-Event-ID`-based resumption). Does not apply to stdio transport, nor to fresh sessions that never held an SSE event stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mid-stream-sse-resumption-failure-when-an-mcp-session-migrates-from-legacy-sse-transport-to-streamablehttp.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mid-stream-sse-resumption-failure-when-an-mcp-session-migrates-from-legacy-sse-transport-to-streamablehttp.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mid-stream-sse-resumption-failure-when-an-mcp-session-migrates-from-legacy-sse-transport-to-streamablehttp.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1983,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport and StreamableHTTP both carry `id:` fields on server-sent events, and both nominally support resumption via `Last-Event-ID`. The non-obvious failure is that **the two transports assign event IDs from different, non-comparable namespaces**, yet the resumption contract is defined per-*session*, not per-*transport*. When a session is mi...",
    "what_was_observed": "A tool-calling agent held an open SSE stream receiving JSON-RPC notifications (`notifications/tools/list_changed`, progress notifications keyed to in-flight `tools/call` requests, and `notifications/message` log events). The server was rolled from the SSE emitter to a StreamableHTTP handler. On the next network blip, the client reconnected to the single StreamableHTTP endpoint with: The StreamableHTTP handler had min...",
    "condition_of_validity": "The silent-resume behavior is only *safe* when all three of the following hold; if any is false, the migration is lossy and must be treated as a session reset: 1. **ID namespace continuity.** The server guarantees that event IDs are drawn from a single monotonic space across the transport change, *or* the client is told explicitly (via a `Mcp-Session-Id` cha...",
    "decision_boundary": "The boundary is crossed at the moment the client reconnects with a `Last-Event-ID` and receives a `200` whose first event `id` does not extend its cursor. Two policies are defensible; the choice is not optional and must be made before the first migration: - **Fail-closed (replay-safe):** On cursor regression or namespace mismatch, treat the session as lost. ...",
    "operational_effect": "Agents that do not implement the generation-token check exhibit a specific, reproducible pathology: **silent tool-result loss under transport migration, surfacing as planner fabrication.** The agent's tool-call state machine has no terminal event for the affected calls, its `await` times out against the *agent's* budget (not the transport's), and the planner..."
  },
  "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": "cf8f723a4d975304f7fa93adbbb947b95634a67b3a22116ba4d58001ec0b03b9",
    "verified_classes": [
      "StreamContinuityError"
    ],
    "verified_functions": [
      "resume_stream",
      "_extends_cursor"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "StreamContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
