{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-stream-resumes-under-a-rotated-oauth-2-1-access-token",
  "title": "Why does an instance lose tool-call continuity when an MCP Streamable HTTP SSE stream resumes under a rotated OAuth 2.1 access token?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers implementing the Streamable HTTP transport with `Last-Event-ID` SSE resumption and OAuth 2.1 resource-server binding (RFC 8707 audience-bound tokens, RFC 6750 bearer presentation). Does not apply to stdio transport, nor to SSE streams resumed within a single token lifetime where no `401` re-challenge occurs mid-stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-stream-resumes-under-a-rotated-oauth-2-1-access-token.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-stream-resumes-under-a-rotated-oauth-2-1-access-token.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-stream-resumes-under-a-rotated-oauth-2-1-access-token.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2143,
    "python_slice_tokens": 394,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not token expiry, and it is not SSE reconnect in isolation. It is the *interaction*: the MCP spec requires that a client resuming a stream present `Last-Event-ID`, and the OAuth 2.1 resource-server binding requires that every request carry a token whose `aud` claim equals the resource server identifier and whose `exp` has not passed. When a lo...",
    "what_was_observed": "A retrieval tool on an MCP server (`streamable-http`, `Mcp-Session-Id` issued at `initialize`) was invoked by an agent with a 60-second access token (short-lived by design for a sensitive corpus). The tool streamed 40 progress events over 74 seconds. At t≈61s the token expired. The transport emitted: The client's OAuth 2.1 flow performed a refresh, obtained a token with the same `aud` but new `jti` and `exp`, and rec...",
    "condition_of_validity": "The invariant holds — and the failure is reachable — only when all of the following are simultaneously true: 1. **The tool invocation lifetime exceeds the access token lifetime.** This is the trigger. If token TTL > max tool duration, no mid-stream re-challenge occurs and the event-ID namespace never rebinds. 2. **The server's event store is keyed by any aut...",
    "decision_boundary": "The architect must choose, explicitly, where the event-ID namespace lives. Three options, with distinct consequences: - **Namespace by session, authorize by current token.** Event store keyed by `Mcp-Session-Id`; every resumption request re-validates the *presenting* token's `aud` and scope against the session's recorded authorization context at `initialize`...",
    "operational_effect": "The observable effect is a *silent null tool result* that the agent's reasoning layer cannot distinguish from a legitimate empty result. Error compounding proceeds from there: the agent's next step conditions on absence-of-evidence as evidence-of-absence. In retrieval agents this manifests as \"the corpus does not contain X\" when in fact the stream was severe..."
  },
  "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": "5cbbf63543f07b682856ae4b25ca3301467af35cafccfbe1efe891ba17989128",
    "verified_classes": [
      "StreamResumptionAuthMismatch"
    ],
    "verified_functions": [
      "resume_stream",
      "close_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "StreamResumptionAuthMismatch"
    ],
    "sample_fail_closed_invariants": [
      "stream closed without terminal JSON-RPC result/error; client must map this to a retryable transport error, not success"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
