{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-that-an-mcp-sse-stream-s-last-event-id-resumption-has-silently-forked-the-session-rather-than-resumed-it",
  "title": "What structural signals indicate that an MCP SSE stream's `Last-Event-ID` resumption has silently forked the session rather than resumed it",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers exposing HTTP-native streaming (Streamable HTTP transport with SSE event IDs and `Last-Event-ID` resumption) to agents that reconnect mid-tool-call. Does not apply to stdio transports, nor to stateless request/response MCP servers that never emit event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-an-mcp-sse-stream-s-last-event-id-resumption-has-silently-forked-the-session-rather-than-resumed-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-an-mcp-sse-stream-s-last-event-id-resumption-has-silently-forked-the-session-rather-than-resumed-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-an-mcp-sse-stream-s-last-event-id-resumption-has-silently-forked-the-session-rather-than-resumed-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1741,
    "python_slice_tokens": 184,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *resumption* and *replay-with-fork*. When an MCP client reconnects to an SSE stream and presents `Last-Event-ID: N`, the server has two legitimate-looking implementations: 1. **Replay-from-buffer**: the server holds a bounded ring buffer of emitted events keyed by ID and re-emits everything after `N` to the same logica...",
    "what_was_observed": "A tool-calling agent issued `tools/call` for a long-running operation (a repository-wide static analysis, ~90s). The server streamed progress events with IDs `1001…1047`, then the client's TCP connection dropped (NAT rebind). The client reconnected with `Last-Event-ID: 1047`. The server had, in the interim, been rescheduled (rolling deploy). The new process had no ring buffer for that session. Its handler logic was: ...",
    "condition_of_validity": "The replay-from-buffer invariant holds **only if all three** of the following are true, and the client must verify each independently: 1. **ID continuity**: the first event on the resumed stream has ID exactly `last_seen_id + 1` (for dense integer sequences) *or* the server advertises a resumption contract that guarantees a gap-free suffix. \"Greater than\" is...",
    "decision_boundary": "The boundary the agent must encode: - **Resume** (all three invariants hold): keep in-flight tool-call state, continue accumulating events, trust the causal chain. - **Fork** (any invariant fails): do **not** splice. The correct action is to (a) mark all pre-drop partial results as `stale_unverified`, (b) re-issue the `tools/call` with a fresh idempotency ke...",
    "operational_effect": "Enforcing the three-invariant check converts a silent-corruption class into a loud, recoverable failure. In the observed case, the corrected client: - Detected the ID discontinuity (`2001 ≠ 1048`) and the backwards progress, raised `StreamForkDetected`, and refused to merge the post-drop events into the pre-drop transcript. - Re-queried job status, discovere..."
  },
  "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": "1ba1c603e0a83d28ae0d51db213fcde1cdb96ce1e252d204412cb654529fe1f6",
    "verified_classes": [
      "StreamForkDetected",
      "ResumeState"
    ],
    "verified_functions": [
      "validate_resumption"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamForkDetected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
