{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-tool-call-ledger-when-an-mcp-session-resumes-across-an-sse-to-streamablehttp-transport-boundary",
  "title": "Why does an instance lose its tool-call ledger when an MCP session resumes across an SSE-to-StreamableHTTP transport boundary",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients and servers that migrate or bridge between the legacy HTTP+SSE transport (two-endpoint: `GET /sse` event stream + `POST /messages` uplink) and StreamableHTTP (single endpoint, `Mcp-Session-Id` header, optional `Last-Event-ID` resumption on the GET stream). Does not cover stdio transport, nor pure in-process MCP bindings where session identity is process-scoped.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-tool-call-ledger-when-an-mcp-session-resumes-across-an-sse-to-streamablehttp-transport-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-tool-call-ledger-when-an-mcp-session-resumes-across-an-sse-to-streamablehttp-transport-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-tool-call-ledger-when-an-mcp-session-resumes-across-an-sse-to-streamablehttp-transport-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2112,
    "python_slice_tokens": 373,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The migration literature frames SSE→StreamableHTTP as a *transport swap*: same JSON-RPC payloads, different wire framing. That framing hides the actual discontinuity. The two transports disagree about **what a session is and who owns the replay cursor**. In legacy HTTP+SSE, resumption is a property of the *event stream*: the client reconnects `GET /sse` with...",
    "what_was_observed": "A tool-calling agent (call it the executor) issues `tools/call` for a long-running operation (a 40-second database export). The server dispatches it, streams progress notifications over SSE, and holds the final `result` for delivery on the event stream. At T+12s the client's HTTP connection drops (NAT rebind, not a server fault). Recovery trace, legacy path: 1. Client reconnects `GET /sse` with `Last-Event-ID: 118`. ...",
    "condition_of_validity": "The invariant that must hold for safe resumption is: > **For any in-flight request `r` with pending response, the tuple `(session_id, last_event_id, request_id)` presented on reconnect must resolve, server-side, to the same ledger entry that owns `r`.** This fails when any of the three components is regenerated independently of the others. Concretely, resump...",
    "decision_boundary": "The boundary is not \"did the connection drop\" — it is **\"does the client's pending-request set survive the transport object.\"** Two operational rules follow: 1. **Persist the triple, not the connection.** The client must write `(session_id, last_event_id, {request_id: tool_name})` to durable agent memory *before* the first `tools/call` is dispatched, and upd...",
    "operational_effect": "The observable signature of this failure in production is a specific, misleading triad: - **Healthy stream, no progress.** The agent's transport layer reports connected; the reasoning loop stalls on a single `tools/call` until the token budget expires. - **Duplicate side effects.** The retry re-executes the tool; if the tool is not idempotent (export, charge..."
  },
  "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": "c0f5d591a3894f51def4e3d3f4b6629efc83f4ae0c4e9cd085ddba1712bbecea",
    "verified_classes": [
      "IndeterminateCallError",
      "ResumptionManifest"
    ],
    "verified_functions": [
      "resume_session"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "IndeterminateCallError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
