{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-resume-an-sse-stream-after-mcp-session-re-authentication-because-the-last-event-id-cursor-belongs-to-a-pr",
  "title": "In what scenarios must an instance refuse to resume an SSE stream after MCP session re-authentication because the `Last-Event-ID` cursor belongs to a prior authorization epoch",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport (POST for requests, GET for the server-to-client SSE channel) where the SSE stream is resumable via `Last-Event-ID` and sessions are bound to per-session auth tokens negotiated at initialize time. Does not apply to stdio transport, nor to stateless SSE endpoints where event IDs are globally monotonic and not scoped to an auth context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-resume-an-sse-stream-after-mcp-session-re-authentication-because-the-last-event-id-cursor-belongs-to-a-pr.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-resume-an-sse-stream-after-mcp-session-re-authentication-because-the-last-event-id-cursor-belongs-to-a-pr.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-resume-an-sse-stream-after-mcp-session-re-authentication-because-the-last-event-id-cursor-belongs-to-a-pr.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2081,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumable SSE contract and the per-session auth contract are negotiated independently and neither is aware of the other's epoch. `Last-Event-ID` is defined as an opaque cursor into the *event log of a session*, and the MCP spec treats session continuity as a property of the `Mcp-Session-Id` alone. Auth negotiation, by contrast, is a property of the *bear...",
    "what_was_observed": "A long-lived MCP session streamed tool-progress and partial-result events to a client over SSE. Mid-stream, the client's short-lived OAuth token expired. The client performed a normal re-auth (silent refresh against the IdP) and re-issued the GET with the same `Mcp-Session-Id`, the same `Last-Event-ID`, and the new token. The server's transport layer validated the session ID against its session table, validated the c...",
    "condition_of_validity": "The guardrail invariant is: **an SSE resume is only valid if the authorization epoch of the presented credential is a superset of (or equal to) the authorization epoch under which every event between `Last-Event-ID` and the current head was emitted.** Equality is the safe default; superset is permissible only if the event log records per-event the principal/...",
    "decision_boundary": "The decision to resume versus restart is a three-way branch, not a boolean: - **Resume permitted:** token epoch unchanged since cursor, OR every event in the replay window is scope-stamped and all stamps are contained in the current token's scope. Replay `(Last-Event-ID, head]`. - **Resume refused, restart from head:** token epoch changed and the server cann...",
    "operational_effect": "The practical consequence is that `Last-Event-ID` is not a safe cursor to hand back blindly on reconnect. An agent that persists its cursor across a token refresh is persisting a pointer into a log it may no longer be allowed to read, and a server that honors that pointer without an epoch check is performing an authorization-blind replay. The agent-side miti..."
  },
  "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": "c7d6615fa31ec507f61ecbce1c79d43e84ddbe2c8e7778c72f05237449ea1953",
    "verified_classes": [
      "CrossEpochResumeError"
    ],
    "verified_functions": [
      "authorize_resume",
      "handle_sse_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CrossEpochResumeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
