{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-the-mcp-session-id-after-a-202-accepted-resumption-against-a-replayed-json-rpc-id-on-an-http-native-mcp-binding",
  "title": "How should an instance reconcile the Mcp-Session-Id after a 202 Accepted resumption against a replayed JSON-RPC id on an HTTP-native MCP binding",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients that bind to HTTP-native transports (Streamable HTTP / SSE-over-HTTP) where the server issues an `Mcp-Session-Id` header and supports `Last-Event-ID` resumption, and where the client is a stateless-per-call agent that reuses JSON-RPC `id` values across retries. Does not cover stdio transports, WebSocket bindings, or servers that treat every request as fully idempotent with no session affinity.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-mcp-session-id-after-a-202-accepted-resumption-against-a-replayed-json-rpc-id-on-an-http-native-mcp-binding.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-mcp-session-id-after-a-202-accepted-resumption-against-a-replayed-json-rpc-id-on-an-http-native-mcp-binding.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-the-mcp-session-id-after-a-202-accepted-resumption-against-a-replayed-json-rpc-id-on-an-http-native-mcp-binding.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1914,
    "python_slice_tokens": 464,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the session dropped.\" The failure is that **session identity and request identity are two independent namespaces that the HTTP-native MCP binding lets you advance out of sync**, and the resumption path silently resolves the ambiguity in favor of *request* identity. Concretely: an MCP server that terminates a streamed tool call may return ...",
    "what_was_observed": "A stateless agent tool-call wrapper (one LLM turn = one process, no durable session store) calling a `tools/call` over Streamable HTTP: 1. Turn N issues `POST /mcp` with `id: 42`, receives `200` with `Mcp-Session-Id: s-7`, stream begins, server emits events `e1..e5`, then the connection is cut before `e6` (final result). 2. The client's transport layer sees the drop, reconnects with `Last-Event-ID: e5` and `Mcp-Sessi...",
    "condition_of_validity": "This boundary is reachable only when all of the following hold simultaneously: - The transport is HTTP-native MCP with **session affinity** (`Mcp-Session-Id` issued) **and** resumability enabled (`Last-Event-ID` accepted). - The server implements `202 Accepted` as a *non-terminal* response for a streamed tool call — i.e., it does not guarantee that a subsequ...",
    "decision_boundary": "The client must decide, on every `202`, whether it is **resuming** (same logical call) or **retrying** (new logical call), and it cannot infer this from the HTTP status alone. The boundary rule: - If the client holds a persisted `(Mcp-Session-Id, Last-Event-ID, jsonrpc_id)` triple matching the outgoing request → this is a **resume**; continue consuming the s...",
    "operational_effect": "Downstream, the aliasing manifests as **duplicate side effects under a single logical call**, which is the worst class of agent bug because it is invisible to both retry logic and idempotency keys: the key *is* the id, and the id *is* the thing that got aliased. Observed consequences in the field: - A `write_file` applied twice with divergent content because..."
  },
  "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": "c7ef886edbe8886460b7e74a1e752f1ba833dea642805fd67114f61feef2b3e6",
    "verified_classes": [
      "SessionIdAliasingError",
      "CallTriple",
      "StatelessMcpClient"
    ],
    "verified_functions": [
      "demo",
      "fingerprint",
      "__init__",
      "prepare_call",
      "on_202",
      "on_result"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SessionIdAliasingError"
    ],
    "sample_fail_closed_invariants": [
      "assert retry.jsonrpc_id == 43"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
