{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-streamable-session-resumption-as-invalid-and-how-does-a-silent-event-id-gap-corrupt-agent-state-co",
  "title": "Under what conditions must an instance treat an MCP streamable-session resumption as invalid, and how does a silent event-ID gap corrupt agent state continuity?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `Last-Event-ID` resumption against a server that may have rotated, restarted, or GC'd its event buffer. Does not apply to stdio transports or to stateless request/response MCP servers with no server-push channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-session-resumption-as-invalid-and-how-does-a-silent-event-id-gap-corrupt-agent-state-co.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-session-resumption-as-invalid-and-how-does-a-silent-event-id-gap-corrupt-agent-state-co.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-session-resumption-as-invalid-and-how-does-a-silent-event-id-gap-corrupt-agent-state-co.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1780,
    "python_slice_tokens": 310,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport carries a resumption contract that looks, at the wire level, like SSE replay: the client reconnects with `Last-Event-ID: N`, and the server replays events `N+1, N+2, …`. The dangerous failure is not a *refused* resumption—that is loud and recoverable. The dangerous failure is a resumption that *succeeds* against a server who...",
    "what_was_observed": "An agent instance held a streamable MCP session against a tool server exposing a long-running `run_build` operation. The server pushed progress events with monotonically increasing `id` fields (`id: 41`, `id: 42`, …) and a terminal `event: result` carrying the build artifact reference. Mid-build, the client's network path flapped; the SSE connection dropped after `id: 57`. The client reconnected per spec with `Last-E...",
    "condition_of_validity": "A resumption is valid only if the client can prove all three: 1. **Residency:** the server still holds the event identified by `Last-Event-ID`, or explicitly signals that it does not (e.g., a `409`/`410`, or a resume response whose first event ID is exactly `Last-Event-ID + 1`). 2. **Contiguity:** every subsequent event ID is exactly one greater than the pre...",
    "decision_boundary": "The boundary is the point where the client must choose between *resuming* and *resynchronizing*. Concretely: - If `Last-Event-ID` is echoed as resident and the first replayed ID is `last+1` and session epoch matches → **resume**; continue incremental state. - If the first replayed ID is `> last+1`, or the server returns a fresh stream with no replay, or the ...",
    "operational_effect": "When the guardrail is enforced, the agent's behavior on a gap is to **stop trusting its incremental state and re-anchor**. This costs one round-trip (a state query or a re-list of pending operations) but prevents the class of failure where the agent acts on a superseded artifact, a stale tool result, or a cancelled operation it never learned was cancelled. I..."
  },
  "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": "9e921c3a3fed4027c940bbdf3dac9bb7d96e14813ecc7e67478b41800b868570",
    "verified_classes": [
      "ResumptionGapError",
      "StreamState"
    ],
    "verified_functions": [
      "resume_stream",
      "handle_superseded"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
