{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-server-recycles-its-sse-event-id-namespace-mid-session",
  "title": "Why does an instance lose tool-call continuity when an MCP Streamable HTTP server recycles its SSE event ID namespace mid-session",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients using the HTTP-native transport (Streamable HTTP with `text/event-stream` upgrade and `Last-Event-ID` resumption) against a stateless or horizontally-scaled MCP server. Does not apply to stdio transport, nor to servers that pin a session to a single process for its lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-server-recycles-its-sse-event-id-namespace-mid-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-server-recycles-its-sse-event-id-namespace-mid-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-server-recycles-its-sse-event-id-namespace-mid-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1530,
    "python_slice_tokens": 278,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not a dropped connection. TCP reconnection works fine, the client reissues the GET with `Last-Event-ID`, and the server responds `200 OK` with a fresh event stream. The failure is that **the SSE event ID is a per-process monotonic counter, not a per-session monotonic counter**. When the server recycles a worker (deploy, autoscale-down, or...",
    "what_was_observed": "An agent issued a `tools/call` for a long-running operation (`analyze_repository`, ~40s). The MCP server streamed progress notifications over SSE with IDs `1001, 1002, 1003...`. At event `1047` the connection dropped (idle proxy timeout at 30s). The client reconnected with `Last-Event-ID: 1047`. The load balancer routed the resume GET to replica B, whose event counter was at `12`. The server, being stateless, did not...",
    "condition_of_validity": "The monotonic-dedup client logic is only valid when *all* of the following hold: 1. Event IDs are generated by a component whose state is co-located with session state (i.e., the same process that holds the session, or a shared durable counter). 2. The server honors `Last-Event-ID` by replaying from a buffer, not by starting fresh — i.e., it can distinguish ...",
    "decision_boundary": "The agent must decide, on each resume, whether the server's event-ID space is trustworthy. This is not knowable from the transport handshake alone. The boundary is: - **If** the server advertises a session-affinity guarantee (e.g., `Mcp-Session-Id` echoed and a `Mcp-Event-Id-Scope: session` header, or a documented `Last-Event-ID` replay contract) **then** mo...",
    "operational_effect": "The observable symptom is not an error — it is an agent that hangs, retries, and burns budget while the transport reports healthy. Logs show `200 OK` on every resume, no exceptions, and a growing count of duplicate `tools/call` invocations. This is the worst failure class for autonomous systems: silent, self-amplifying (retries re-trigger the expensive opera..."
  },
  "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": "f74cef57986d575d2acfd7e09ab3f2c44db572414e62adf4ebfe2d07105c3fd1",
    "verified_classes": [
      "EventIdRegressionError"
    ],
    "verified_functions": [
      "validate_resume_stream",
      "resume_mcp_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EventIdRegressionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
