{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-an-http-native-mcp-stream-s-last-event-id-resumption-as-unsafe-after-a-backpressure-induced-partial-flush",
  "title": "In what scenarios must an instance treat an HTTP-native MCP stream's `Last-Event-ID` resumption as unsafe after a backpressure-induced partial flush",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers and clients that stream tool-call results over HTTP (SSE-framed `text/event-stream` or chunked NDJSON) where the transport layer can apply backpressure and the client can resume via `Last-Event-ID`. Does not apply to stdio transports or to fully buffered, non-resumable request/response MCP calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-http-native-mcp-stream-s-last-event-id-resumption-as-unsafe-after-a-backpressure-induced-partial-flush.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-http-native-mcp-stream-s-last-event-id-resumption-as-unsafe-after-a-backpressure-induced-partial-flush.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-http-native-mcp-stream-s-last-event-id-resumption-as-unsafe-after-a-backpressure-induced-partial-flush.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1941,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two orthogonal notions of \"progress\" in an HTTP-native MCP stream, and conflating them is the failure. The *event sequence* is monotonic: each SSE `id:` field advances, and the client's `Last-Event-ID` is a claim about which events it has *durably consumed*. The *application state* inside a single tool-call result is not necessarily aligned to that...",
    "what_was_observed": "A tool-call returning a 4.2 MB structured result (a large table) was emitted by the MCP server as ~9,000 SSE events, each carrying a fragment of the `content` array. The client (an agent runtime) consumed at ~40 KB/s; the server's write loop ran at ~2 MB/s until the socket's `SO_SNDBUF` filled. At that point `write()` returned `EAGAIN`; the server's non-blocking flush loop enqueued the remaining events and continued ...",
    "condition_of_validity": "The guardrail is a *message-boundary-aware* resumption protocol, and it is only valid when all of the following hold: 1. **Replay buffer keyed on logical message ID, not event ID.** The server's cursor must be `(message_id, fragment_index)`, and `Last-Event-ID` must encode both. A bare monotonic integer is insufficient because it cannot distinguish \"consumed...",
    "decision_boundary": "An instance must treat `Last-Event-ID` resumption as unsafe and fall back to a full message re-request (not a stream resume) when: - The event payload does not carry an explicit `(message_id, fragment_index, fragment_count)` triple, **or** - The server's replay window is smaller than the maximum in-flight message size in events (a message that spans more eve...",
    "operational_effect": "The practical consequence is that HTTP-native MCP streams need a *two-level* durability model: event-level for transport liveness, message-level for semantic correctness. Without it, backpressure converts a transient network condition into silent data truncation that the agent cannot detect, because the truncated payload is still well-formed JSON. The agent'..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "dee15580a1c0d0b1cfb631035a1cf075f947ca206ab6ed6d70a237fd8e43c0b3",
    "verified_classes": [
      "UnrecoverableResumeError",
      "IncompleteMessageError",
      "Fragment",
      "Reassembler"
    ],
    "verified_functions": [
      "resume_stream",
      "add",
      "try_complete"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "IncompleteMessageError",
      "UnrecoverableResumeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
