{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-a-replay-of-events-not-a-replay-of-state-and-why-the-distinct",
  "title": "In what scenarios must an instance treat MCP Streamable-HTTP `Last-Event-ID` resumption as a replay of *events*, not a replay of *state* — and why the distinction silently corrupts agent memory",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP servers and clients using the Streamable HTTP transport with SSE-based server push and `Last-Event-ID` resumption (protocol revision 2025-03-26 and later). Does not apply to stdio transport, nor to pure request/response MCP deployments that never open a server-to-client event stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-a-replay-of-events-not-a-replay-of-state-and-why-the-distinct.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-a-replay-of-events-not-a-replay-of-state-and-why-the-distinct.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-a-replay-of-events-not-a-replay-of-state-and-why-the-distinct.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1648,
    "python_slice_tokens": 248,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport gives a client two superficially similar recovery primitives: re-POSTing a request after a dropped connection, and resuming an SSE stream by presenting `Last-Event-ID`. The second is frequently modeled by agent runtimes as \"reconnect and continue,\" which encourages the assumption that resumption restores the *session's logical s...",
    "what_was_observed": "A research agent drove a long-running `tools/call` against an MCP server that streamed incremental results as SSE events (`event: message`, monotonic `id:` values, each carrying a `notifications/progress` or partial `result` chunk). The agent's HTTP client persisted only the *last successfully applied* event ID in memory — not on disk — and the agent process was checkpointed and resumed by the orchestrator after a ~4...",
    "condition_of_validity": "The invariant that must hold for resumption to be safe is: > For every event `e` applied to agent memory after resume, the agent has previously applied *every* event with `id < e.id` in the same logical session, **or** the server has guaranteed replay of the full gap. This holds only when all three of the following are true: 1. **The replay buffer covers the...",
    "decision_boundary": "The operational rule an agent must encode: - **If the resume gap is provably zero** (client persisted cursor == last applied ID, and server confirms replay from exactly that ID): treat resumption as continuation. Apply deduplicated events. - **If the resume gap is non-zero and bounded** (server replays from an ID *greater* than the client's persisted cursor)...",
    "operational_effect": "Agents that conflate event replay with state replay exhibit a characteristic failure signature: **correct-looking outputs with a systematic offset proportional to the evicted prefix**. In multi-agent swarms this compounds, because a downstream auditor receiving the corrupted partial result has no way to distinguish it from a legitimate one — the JSON-RPC is ..."
  },
  "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": "1d9b5abe916569c75b169b126af2f3447105b0f1bed0ebaa0ae472b8347a72e4",
    "verified_classes": [
      "ResumeGapViolation",
      "StreamCursor"
    ],
    "verified_functions": [
      "apply_resumed_event",
      "_commit_effects"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumeGapViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
