{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-a-resumed-mcp-streamable-session-as-a-new-event-source-rather-than-a-continuation-of-the-old-one",
  "title": "How should an instance treat a resumed MCP streamable-session as a *new* event source rather than a continuation of the old one",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP deployments using the HTTP-native *streamable* transport (POST for client→server requests, optional SSE on the response body for server→client push), where a session can survive a dropped connection and be resumed via the `Mcp-Session-Id` header and a `Last-Event-ID` replay cursor. Does not apply to stdio transport, nor to stateless per-request MCP servers with no session affinity.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-resumed-mcp-streamable-session-as-a-new-event-source-rather-than-a-continuation-of-the-old-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-resumed-mcp-streamable-session-as-a-new-event-source-rather-than-a-continuation-of-the-old-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-resumed-mcp-streamable-session-as-a-new-event-source-rather-than-a-continuation-of-the-old-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2158,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two incompatible mental models of \"resumption,\" and the failure lives in the gap between them: - **Continuation model** (what the client's reconnect logic assumes): the session is a single logical stream. After a disconnect, I reconnect, present `Last-Event-ID`, and the server replays everything I missed. From my side the event sequence is gapless ...",
    "what_was_observed": "A long-running agent held an MCP session to a server exposing a `run_analysis` tool that streams progress notifications (`notifications/progress`) over the SSE channel while the tool executes, and emits a final `notifications/message` when done. The tool takes 4–6 minutes. The client's HTTP layer had a 90-second idle timeout on the SSE read. Trace of the boundary failure: 1. Agent calls `tools/call run_analysis`. Ser...",
    "condition_of_validity": "The continuation model is only valid when **all three** of the following hold; if any fails, the instance must fall back to the new-source model: 1. **Server-side replay is durable and monotone across connections.** The server persists the session's event log with a session-scoped (not connection-scoped) monotone counter, and honors `Last-Event-ID` by replay...",
    "decision_boundary": "The instance must decide, on every reconnect of a streamable session, whether it is safe to treat the stream as continuous. The boundary: - **If** a tool call is in flight **and** the reconnect replay is empty **and** the elapsed wall-clock since last event exceeds the server's advertised progress cadence → **do not** assume continuity. The agent must issue ...",
    "operational_effect": "An instance that internalizes the new-source model stops conflating \"session alive\" with \"stream alive.\" Concretely: - It treats `Mcp-Session-Id` as durable state (tool workers, auth context) and the SSE channel as ephemeral transport, and never lets a reconnect reset its belief about in-flight work. - It bounds the wait on any server-push terminal event by ..."
  },
  "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": "3e7024ae61eecd5bf0ca30ce4b4946697f4fddca225c4fd8f4ebc0bd3016842f",
    "verified_classes": [
      "StreamContinuityError",
      "StreamState"
    ],
    "verified_functions": [
      "on_reconnect"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
