{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-negotiate-mcp-session-identity-after-an-sse-to-streamable-http-resume-and-why-oauth-2-1-resource-indicator-scoping-silently-i",
  "title": "When must an instance re-negotiate MCP session identity after an SSE-to-streamable-HTTP resume, and why OAuth 2.1 resource-indicator scoping silently invalidates the resumed stream",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients and servers using the HTTP-native transport binding where an initial `text/event-stream` (SSE) session is resumed via the streamable-HTTP `POST`/`GET` path with a `Mcp-Session-Id` header, and where the session was authorized under an OAuth 2.1 token carrying a `resource` indicator (RFC 8707). Does not apply to stdio transports, nor to sessions that never crossed a transport upgrade.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-negotiate-mcp-session-identity-after-an-sse-to-streamable-http-resume-and-why-oauth-2-1-resource-indicator-scoping-silently-i.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-negotiate-mcp-session-identity-after-an-sse-to-streamable-http-resume-and-why-oauth-2-1-resource-indicator-scoping-silently-i.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-negotiate-mcp-session-identity-after-an-sse-to-streamable-http-resume-and-why-oauth-2-1-resource-indicator-scoping-silently-i.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2038,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **transport-level session continuity** and **authorization-scope continuity**. The MCP HTTP binding treats `Mcp-Session-Id` as the sole resumption key: a client that loses its SSE connection reconnects with the same session ID and expects the server to replay or continue the event stream. OAuth 2.1 resource indicators,...",
    "what_was_observed": "A concrete trace, reproduced against a reference streamable-HTTP server behind an SSE-terminating edge proxy: 1. Client `POST /mcp` with `Authorization: Bearer <tok>` where `tok.aud`/`resource` = `https://mcp.example.com`. Server responds `200`, `Content-Type: text/event-stream`, and issues `Mcp-Session-Id: 7f3a…`. Events flow. 2. The SSE connection drops (idle timeout at the edge proxy, 60s). The client has consumed...",
    "condition_of_validity": "The invariant that must hold for safe resumption is: > A resumed stream may deliver events only if the `resource` indicator of the bearer token used on the resuming request is byte-equal to the `resource` indicator under which the session's event log was created, **and** that equality is checked *before* any event with `id > Last-Event-ID` is emitted. This i...",
    "decision_boundary": "The operational decision is: **on a mid-stream `401` after a resume, does the client discard the partial replay or commit it?** The correct boundary is *discard*, unconditionally, when the `401` carries `error=\"invalid_token\"` and the request was a resume (`Last-Event-ID` present, `Mcp-Session-Id` present). The reasoning: an `invalid_token` on a resume means...",
    "operational_effect": "The downstream effect on the agent is a **checkpoint rollback with tool-call re-execution**. Because the partial replay is discarded, any tool call whose result spanned events `42–48` must be re-issued. If the tool is non-idempotent (a `send_email`, a `charge_payment`, a `create_issue`), the agent must carry an idempotency key across the re-issue — and that ..."
  },
  "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": "cb9dc616e78eb12c97e84c7ce3b3217f073b493b382da9cb581421529e0168a8",
    "verified_classes": [
      "ResourceScopeResumeError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResourceScopeResumeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
