{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-stream-after-a-session-rebind-and-silently-replays-a-truncated-json-rpc-frame",
  "title": "What happens when an instance resumes an MCP stream after a session-rebind and silently replays a truncated JSON-RPC frame",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP servers/clients using the HTTP-native streaming transport (SSE-over-POST, per-stream `Last-Event-ID` resumption, and `Mcp-Session-Id` rebinding). Does not apply to stdio transport, nor to stateless request/response MCP over plain JSON POST where no event stream is held open.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-session-rebind-and-silently-replays-a-truncated-json-rpc-frame.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-session-rebind-and-silently-replays-a-truncated-json-rpc-frame.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-session-rebind-and-silently-replays-a-truncated-json-rpc-frame.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2103,
    "python_slice_tokens": 419,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the stream dropped.\" Streams drop constantly and the transport is designed for it. The failure is the **resumption contract being satisfied at the transport layer while violated at the framing layer**: the client presents a valid `Last-Event-ID`, the server honors it and replays from the next event, the HTTP 200 + `text/event-stream`...",
    "what_was_observed": "A tool-calling agent issued `tools/call` for a long-running operation. The server streamed progress notifications as separate SSE events, then began emitting the final `result` as one large event whose `data:` line carried a ~180 KB JSON-RPC response (a serialized document graph). The event was written in three TCP segments. After segment two, the connection reset (idle proxy timeout at 60 s, mid-write). The client's...",
    "condition_of_validity": "The guardrail below is required *if and only if* all of the following hold: - The transport is HTTP-native streaming with `Last-Event-ID` resumption (not a request-scoped stream that dies with the response). - Events can exceed one TCP segment / one server write, so a single JSON-RPC message may span multiple `data:` lines or be split mid-payload. - The serv...",
    "decision_boundary": "The boundary is: **does the resumption cursor advance on event-header sighting or on message-completion?** A client that advances on header sighting optimizes for at-most-once delivery of events and accepts message truncation. A client that advances on message completion optimizes for at-least-once delivery of *messages* and accepts duplicate events, which J...",
    "operational_effect": "Without the guardrail, the failure is silent and *plausible*: a truncated tool result that deserializes cleanly, passes shallow validators, and poisons downstream reasoning for many turns. The agent has no signal that anything is wrong — the transport reported success, the JSON parsed, the schema was \"close enough.\" Recovery requires an out-of-band consisten..."
  },
  "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": "6b2c735cb25ec8b5f6280abb0a9177dbcd5aaaf73e163499e959357bd7a41081",
    "verified_classes": [
      "StreamResumeTruncationError",
      "EventFrame",
      "ResumeCursor",
      "McpStreamClient"
    ],
    "verified_functions": [
      "__init__",
      "begin_event",
      "append_data",
      "terminate_event",
      "resume_request",
      "accept_replay"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "StreamResumeTruncationError"
    ],
    "sample_fail_closed_invariants": [
      "data chunk with no open event",
      "terminator with no open event"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
