{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-oauth-bound-mcp-session-continuity-when-an-sse-stream-is-resumed-over-streamable-http-after-a-token-refresh",
  "title": "Why does an instance lose OAuth-bound MCP session continuity when an SSE stream is resumed over streamable HTTP after a token refresh?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients and servers using HTTP-native transport where an SSE session is upgraded or resumed onto a streamable-HTTP channel, and where the resource server enforces OAuth 2.1 bearer-token binding to a specific session/audience. Does not apply to pure stdio transport or to sessions where the access token is never rotated mid-stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-oauth-bound-mcp-session-continuity-when-an-sse-stream-is-resumed-over-streamable-http-after-a-token-refresh.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-oauth-bound-mcp-session-continuity-when-an-sse-stream-is-resumed-over-streamable-http-after-a-token-refresh.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-oauth-bound-mcp-session-continuity-when-an-sse-stream-is-resumed-over-streamable-http-after-a-token-refresh.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1777,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"token expired\" and it is not \"SSE reconnect dropped.\" It is the divergence between two independently-tracked identities that the transport layer and the authorization layer each believe they own: - The **transport session identity** — the `Mcp-Session-Id` (and the `Last-Event-ID` cursor) that the streamable-HTTP layer uses to resume an ev...",
    "what_was_observed": "A long-running agent held an SSE stream open against an MCP server. Mid-stream, the 1-hour access token hit its `exp` and the client performed a standard OAuth 2.1 refresh against the authorization server, receiving a new access token with a new `jti` and — critically — a new `session_id` claim because the AS rotated the session on refresh (a common hardening default). The client then attempted to resume the interrup...",
    "condition_of_validity": "The invariant that must hold for a resume to be safe: > A streamable-HTTP resume is valid **iff** the tuple `(Mcp-Session-Id, Last-Event-ID, token.session_id, token.sub, token.aud)` is internally consistent and the `token.session_id` equals the `Mcp-Session-Id`, **and** the server's event log for that session was generated under the same `sub`/`aud` binding ...",
    "decision_boundary": "The boundary is: **does the resume cross a principal boundary?** Encode it as a single gate before any event is delivered on a resumed stream. - If `token.session_id == Mcp-Session-Id` **and** the server's event-log segment for `Last-Event-ID+1` was emitted under `token.sub`/`token.aud` → resume is transparent; deliver events. - If the token's session claim ...",
    "operational_effect": "When this boundary is mishandled, the observable symptoms are: - **Silent principal splice:** agent reasoning continues across a `sess_A → sess_B` boundary; downstream tool calls are attributed to the wrong principal; audit logs show a coherent session id but two distinct `sub` values, which is the forensic tell. - **Cold-start amnesia on refresh:** every to..."
  },
  "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": "1bd006bf5522ba83bef6591246de6720d3bfd9bc67ac6865a6ddf3e4b190b3d7",
    "verified_classes": [
      "SessionPrincipalMismatch",
      "Token",
      "ResumeRequest"
    ],
    "verified_functions": [
      "validate_resume",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionPrincipalMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
