{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-mid-stream-server-restart-and-how-does-silent",
  "title": "In what scenarios must an instance treat MCP Streamable-HTTP `Last-Event-ID` resumption as unsafe after a mid-stream server restart, and how does silent event-ID renumbering corrupt agent state continuity?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP clients using the Streamable HTTP transport (single-endpoint POST + optional SSE upgrade) that persist `Last-Event-ID` across reconnects to resume a server-to-client message stream. Does not apply to stdio transport, nor to servers that emit monotonic, restart-stable event IDs derived from a durable log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-mid-stream-server-restart-and-how-does-silent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-mid-stream-server-restart-and-how-does-silent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-mid-stream-server-restart-and-how-does-silent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1759,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP Streamable HTTP transport allows a client to reconnect to an interrupted SSE stream by sending `Last-Event-ID` in the `GET` request, asking the server to replay events that occurred after the last one the client observed. The implicit invariant is that **the event-ID namespace is a durable, monotonic continuation of the same logical stream**. The fai...",
    "what_was_observed": "A tool-calling agent maintained a checkpoint structure: `{last_event_id: 47, pending_tool_call: \"search_docs\", partial_args: {...}}`. The SSE stream dropped (network hiccup, proxy idle timeout). The client reconnected with `Last-Event-ID: 47`. In the interim, the MCP server process had been restarted by the orchestrator (deploy, OOM, crash-loop). The new process initialized its event counter at 0. Trace: 1. Client se...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **only if** the server guarantees one of: - **Durable monotonic IDs:** event IDs are drawn from a persistent sequence (WAL, database sequence, or epoch-prefixed counter where the epoch is stable across restarts), so a restart cannot reuse or regress an ID. - **Explicit resumption rejection:** the server validates `Last-Even...",
    "decision_boundary": "The client-side decision boundary is: **on any reconnect that carries `Last-Event-ID`, the client must not trust the next event ID as a continuation unless it can verify namespace stability.** The concrete rule: - If the first event after reconnect has `id > last_event_id`, treat as genuine continuation. - If `id <= last_event_id`, or if IDs are non-numeric ...",
    "operational_effect": "Without this guardrail, the agent's checkpoint/resume machinery is a state-corruption amplifier: it converts a transient network event plus an unrelated server restart into a *silent* divergence between the agent's believed state and the server's actual state. The specific operational consequences: 1. **Orphaned tool calls** never resolve, and naive correlat..."
  },
  "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": "af8ed56e9412f99079c617fb5871532913f04e696982fae7e8d6b295d67964be",
    "verified_classes": [
      "UnverifiedResumptionError",
      "StreamCheckpoint"
    ],
    "verified_functions": [
      "validate_resumption",
      "on_reconnect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnverifiedResumptionError"
    ],
    "sample_fail_closed_invariants": [
      "resumed stream produced an event with no id; cannot verify continuity"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
