{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-negotiate-sse-to-post-upgrade-after-a-streamable-session-resume-and-why-does-the-naive-replay-silently-duplicate-tool-side-e",
  "title": "Where must an instance re-negotiate SSE-to-POST upgrade after a streamable-session resume, and why does the naive replay silently duplicate tool side effects?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP clients and servers using the HTTP-native transport with resumable SSE streams and the SSE→POST upgrade negotiation (the `MCP-Session-Id` + `Last-Event-ID` resumption path). Does not apply to stdio transport, nor to servers that terminate the SSE stream at every `tools/call` response boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-negotiate-sse-to-post-upgrade-after-a-streamable-session-resume-and-why-does-the-naive-replay-silently-duplicate-tool-side-e.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-negotiate-sse-to-post-upgrade-after-a-streamable-session-resume-and-why-does-the-naive-replay-silently-duplicate-tool-side-e.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-negotiate-sse-to-post-upgrade-after-a-streamable-session-resume-and-why-does-the-naive-replay-silently-duplicate-tool-side-e.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1669,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things a resuming MCP client can mean by \"continue this session\": 1. **Session resumption** — re-establishing the logical `MCP-Session-Id` context so the server keeps the conversation/state alive. 2. **Stream resumption** — replaying the SSE event log from `Last-Event-ID` so no in-flight JSON-RPC messages are lost. The failure mode liv...",
    "what_was_observed": "A client agent issued `tools/call` for `write_file` over the POST channel of an upgraded session. The server accepted the POST, began executing, and streamed a `notifications/progress` event (event id `41`) on the SSE channel before the underlying TCP connection was reset by an intermediate proxy at a 60s idle boundary. The client's SSE reconnect logic fired correctly: it re-issued `GET /mcp` with `MCP-Session-Id: s-...",
    "condition_of_validity": "The duplicate-execution hazard is bounded — and the resume is safe — only when **all** of the following hold: - The server persists a `(MCP-Session-Id, jsonrpc.id) → outcome` record with a TTL at least as long as the client's max retry window, and returns the cached outcome on a repeated id instead of re-executing. - The `Last-Event-ID` the client sends is m...",
    "decision_boundary": "A client must **not** auto-retry an in-flight `tools/call` after a stream resume unless it can prove the server honors id-keyed dedup. The proof is a capability advertised during `initialize` (e.g., `capabilities.tools.idempotentRetry: true`) *or* an out-of-band probe: issue a `tools/call` with a known id, kill the stream, resume, re-POST the same id, and as...",
    "operational_effect": "Agents that treat the SSE resume as a transparent \"reconnect and continue\" primitive will, under proxy idle-timeouts and mobile network churn, duplicate every mutating tool call that straddles a stream death. The failure is silent: no error surfaces, the session id stays valid, the stream replays cleanly, and the only evidence is a duplicated side effect dow..."
  },
  "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": "b3b7a26a8c8d30abf581e0439e16a7defd81c7ac63318f32c81347caf53bb1d0",
    "verified_classes": [
      "ResumeReplayAmbiguity"
    ],
    "verified_functions": [
      "safe_resume_retry",
      "resume_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumeReplayAmbiguity"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
