{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-replay-log-has-already-been-truncated-past-the-client-s-last-event-id",
  "title": "What happens when an instance resumes an MCP stream and the server's replay log has already been truncated past the client's Last-Event-ID",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with Server-Sent Events for server→client streaming and `Last-Event-ID` based resumption. Does not apply to stdio transports, nor to HTTP transports that carry no event-ID replay semantics (stateless request/response only).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-replay-log-has-already-been-truncated-past-the-client-s-last-event-id.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-replay-log-has-already-been-truncated-past-the-client-s-last-event-id.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-replay-log-has-already-been-truncated-past-the-client-s-last-event-id.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2033,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Resumable streaming is usually modeled as a *transport* concern: the client reconnects, presents `Last-Event-ID`, and the server replays everything after that ID. The failure boundary is not that the reconnect fails — it is that the reconnect *succeeds* while the server can no longer honor the replay contract, because its bounded replay buffer has evicted th...",
    "what_was_observed": "An agent instance was mid-execution of a long `tools/call` whose result streamed in fragments over SSE (progress notifications interleaved with partial result chunks). The network dropped the TCP connection at event ID `10431`. The client reconnected 40 seconds later with `Last-Event-ID: 10431`. The server, which retains a ring buffer of the last 2,048 events per session, had in the interim produced events `10431`–`1...",
    "condition_of_validity": "The invariant that must hold for `Last-Event-ID` resumption to be sound: > A server MUST NOT accept a `Last-Event-ID` it cannot fully replay from. If the requested ID precedes the oldest retained event, the server MUST fail the resumption explicitly (e.g., `409 Conflict` or an SSE `event: resync-required` frame carrying the oldest available ID and a session ...",
    "decision_boundary": "The practical decision the implementer faces is what to do when `Last-Event-ID` falls outside the retention window. There are exactly three defensible policies, and they are not interchangeable: - **Fail-closed (recommended for tool-call streams):** reject the resumption, force session re-establishment, and require the client to re-issue the in-flight reques...",
    "operational_effect": "The failure is silent and downstream. The agent does not crash; it produces a confident, well-formed, wrong result, and the verification layer — if it only checks structural validity — confirms it. This is the worst class of agent failure: the one that survives its own checks. The guardrail that bounds it is a **continuity assertion at the transport boundary..."
  },
  "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": "b5289241e50bc7ec583e54bab42e416dbcd474aff25deb4c6e94ee17793d1bcb",
    "verified_classes": [
      "StreamContinuityError",
      "ReplayWindow",
      "StreamAssembler"
    ],
    "verified_functions": [
      "resume",
      "accept_event",
      "finalize"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
