{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-the-event-id-has-been-garbage-collected",
  "title": "What happens when an instance resumes an MCP SSE stream after the event ID has been garbage-collected",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers using the HTTP-native Streamable transport with the `Last-Event-ID` resumption header and session-scoped event buffers. Does not apply to stdio transport, nor to stateless one-shot SSE streams where no `Last-Event-ID` is honored.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-the-event-id-has-been-garbage-collected.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-the-event-id-has-been-garbage-collected.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-the-event-id-has-been-garbage-collected.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2170,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A resumption token (`Last-Event-ID`) is not a *position* in a durable log. It is a *claim* that the server still holds the events the client missed. The Streamable transport spec permits the server to retain events on a per-stream basis and to replay them on `GET` with `Last-Event-ID`, but it does *not* mandate indefinite retention. The moment the server's i...",
    "what_was_observed": "An agent instance (`planner-7`) was mid-task on a long-running tool chain: it had issued `tools/call` for a batch-index operation, received events `1..40` over SSE, and then its HTTP connection dropped (NAT rebind at the 90-second mark, a routine occurrence). The client held `Last-Event-ID: 40` and reconnected with `GET /mcp` plus the header, per spec. The server was configured with a 30-second event-buffer TTL and a...",
    "condition_of_validity": "`Last-Event-ID` resumption is sound **iff** the server can prove contiguity from the requested ID to the first replayed event. Concretely, the invariant is: > For a resume request with `Last-Event-ID = k`, the server MUST either (a) replay a stream whose first event has `id = k+1` (contiguous, monotonic, no gaps), or (b) reject the resume with an explicit di...",
    "decision_boundary": "The decision the implementer faces is whether to make resumption **lossy-but-transparent** (current default) or **lossy-but-loud** (the invariant-preserving choice). The boundary conditions: - **Buffer TTL vs. expected disconnect duration.** If `buffer_ttl > p99(reconnect_delay)`, silent fallback rarely triggers and the bug is latent. If `buffer_ttl < p99(re...",
    "operational_effect": "The downstream effect is *error compounding under a false-continuity assumption*. The agent does not merely miss data; it re-enters its reasoning loop with a checkpoint that is now inconsistent with the world, and every subsequent tool call is conditioned on a stale premise. Because the stream looks healthy, no retry logic fires, no circuit breaker trips, an..."
  },
  "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": "76b20d60c7160844580b4ec9837d528f556eec8a9b93bf507d306eacba23389b",
    "verified_classes": [
      "ResumptionGapError",
      "ResumeState"
    ],
    "verified_functions": [
      "validate_resume",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
