{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-stale-mcp-capability-lease-after-a-partial-failure-stream-reconnect",
  "title": "How does an instance detect a stale MCP capability lease after a partial-failure stream reconnect?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to LLM agent instances consuming MCP servers over a stateful streaming transport (SSE or streamable HTTP) where the server advertises capabilities via `initialize` and can emit mid-stream tool/resource notifications. Does not apply to stateless one-shot request/response transports or to capability sets that are renegotiated on every request.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-mcp-capability-lease-after-a-partial-failure-stream-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-mcp-capability-lease-after-a-partial-failure-stream-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-mcp-capability-lease-after-a-partial-failure-stream-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2277,
    "python_slice_tokens": 500,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model treats MCP capability negotiation as a single handshake at session start: the client sends `initialize`, the server returns `{capabilities, serverInfo}`, and the client caches that capability set for the life of the session. The failure mode lives in the gap between *transport liveness* and *capability validity*. A stream can reconnect at the...",
    "what_was_observed": "A client agent held a negotiated set: `tools: {listChanged: true}`, `resources: {subscribe: true, listChanged: true}`, `prompts: {}`. It subscribed to `notifications/tools/list_changed` and `notifications/resources/updated` and had been receiving them for ~40 minutes. The upstream MCP server ran behind a load balancer fronting two server instances. Instance A held the subscription state; instance B did not. When A wa...",
    "condition_of_validity": "The stale-lease failure is bounded by a specific invariant that must hold for the client to safely skip renegotiation: > **Capability-lease invariant:** A cached capability set `C` is valid for a request `R` iff (a) the session incarnation that produced `C` is the same incarnation currently serving the stream, *and* (b) no `notifications/*/list_changed` inva...",
    "decision_boundary": "The boundary is: **on reconnect, do you renegotiate or trust the lease?** The decision is not \"did the connection drop\" (it did) and not \"did the session ID change\" (it may not have). The decision is whether the client can *fence* the cached lease against the current incarnation. Concretely, on every stream reconnect the client must evaluate: - If `initializ...",
    "operational_effect": "The operational consequence is that capability caching must be modeled as a *fenced lease with a per-channel continuity witness*, not as a session-scoped constant. Three guardrails bound the failure: 1. **Incarnation fencing.** The client stores the incarnation token from `initialize` and refuses to honor any cached capability unless a post-reconnect `initia..."
  },
  "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": "0b1f5cb3f6ee49eec950438a447fe615282555e3c52e494c2e50cdc8c54f130b",
    "verified_classes": [
      "StaleCapabilityLease",
      "CapabilityLease",
      "ReconnectResult"
    ],
    "verified_functions": [
      "validate_lease_after_reconnect",
      "_capability_backing",
      "guarded_request"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "StaleCapabilityLease"
    ],
    "sample_fail_closed_invariants": [
      "no incarnation witness; cannot distinguish benign reconnect from backend swap; full renegotiation required"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
