{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-stale-session-capability-envelope-when-an-http-native-mcp-server-multiplexes-tool-lists-across-keep-alive-connections",
  "title": "How does an instance detect a stale session capability envelope when an HTTP-native MCP server multiplexes tool lists across keep-alive connections",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP clients that connect to a streamable-HTTP MCP server holding long-lived keep-alive sessions and negotiating per-session capabilities (tools/list, resources, prompts) at initialize time. Does not cover stdio transport, nor servers that renegotiate capabilities on every request.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-session-capability-envelope-when-an-http-native-mcp-server-multiplexes-tool-lists-across-keep-alive-connections.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-session-capability-envelope-when-an-http-native-mcp-server-multiplexes-tool-lists-across-keep-alive-connections.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-session-capability-envelope-when-an-http-native-mcp-server-multiplexes-tool-lists-across-keep-alive-connections.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the tool disappeared\" or \"the call errored.\" The failure is that the client's cached capability envelope—the set of tools, schemas, and version tags it believes the session holds—diverges from the server's live envelope *silently*, because HTTP multiplexing reuses a TCP connection whose server-side session was rebuilt (or partially evicte...",
    "what_was_observed": "A client agent initialized an MCP session against a streamable-HTTP server. The `initialize` response advertised `tools/list` with 14 tools, including `repo.patch` at schema version `v3`. The client cached this envelope and issued `tools/call` for `repo.patch` across a keep-alive connection for ~40 minutes. At minute 31, the server's session store evicted the session's capability record under memory pressure (the mul...",
    "condition_of_validity": "The stale-envelope failure is *bound*—i.e., the client can guarantee detection—only under the following condition: **the server advertises an envelope generation token that changes on every session rebuild, and the client treats any token change as invalidating its cached envelope.** Concretely, the invariant is: - The `initialize` result carries a server-as...",
    "decision_boundary": "The boundary is: **does the client hold a capability envelope that it can prove is current at the instant of `tools/call`?** - If yes (envelope_id echoed and matched, or revalidation within one RTT), the client may invoke without re-listing. - If no, the client must re-list before invoking any tool whose schema version it has not verified within the stalenes...",
    "operational_effect": "The practical consequence is that HTTP-native MCP multiplexing shifts the correctness burden from the transport to the client's envelope-cache discipline. A client that caches `initialize` forever and trusts 200s will, on a server with lazy session rebuild, execute side-effecting tool calls under a schema it never negotiated. The blast radius is proportional..."
  },
  "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": "d6162d354d492c1abd090a9817ffe3d44bc0df29b7100ea3fcfc6ff63f64211a",
    "verified_classes": [
      "StaleCapabilityEnvelope",
      "EnvelopeCache"
    ],
    "verified_functions": [
      "invoke_tool",
      "_rpc",
      "__init__",
      "invalidate"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StaleCapabilityEnvelope"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
