mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 📇 fix: Stop an MCP Credential Refresh From Fencing Its Own Catalog Recovery Passive catalog recovery captures the tool-cache generation before discovering a cold server and discards the catalog when the stored generation has moved by the time discovery returns. A silent OAuth refresh inside that same discovery publishes a rotation of its own and then clears this replica's recovery state, so the tracker drops the flight as superseded and the generation check rejects it: the server is listed with no tools, and a concurrent catalog request starts a second discovery instead of joining the first. The authorization fence now reaches discovery through recovery's own dependencies, which report each generation a discovery's refresh publishes. The tracker adopts that generation while the flight is still running, so the flight stays current and its outcome carries the generation it produced; a rotation or clear from any other writer afterwards still supersedes it, and a refresh that completes after its discovery settled no longer touches that settled state. * 🪢 fix: Keep a Recovery Flight Joinable Through Its Own Credential Publication A refresh's authorization fence writes the new shared generation, clears local recovery state, and only then reports what it wrote. A catalog request that read the new generation during that span found the flight still keyed to the old generation, or its slot vacated by the clear, and replaced it with a second discovery; the original flight was then discarded. Discovery now runs its publication through a tracker bracket. While a flight's own publication is in progress the tracker holds any clear for that server and lets requests for the same config join the flight; when it ends, the flight adopts the generation it wrote, or applies the held clear if the publication failed or the flight settled first. The flight is registered before its discovery starts, so a publication can never precede its own registration. * ⏳ fix: Bound and Count What a Recovery Flight Holds During Its Own Publication A recovery flight held every clear for its key and admitted any request for its server for as long as its own credential publication stayed open. A clear from another writer collapsed into the fence's own clear and was dropped on adoption, leaving a backoff or reauthorization decision in place after a teardown; a publication stalled in an unbounded storage write kept every later request joined to the stalled flight; and a joiner that had already read a foreign generation could keep tools under an older adopted generation when the final generation read failed. An open publication now holds clears and admits joins only while its flight is in flight and for at most one discovery budget, after which requests take over as before. The fence clears local recovery once when it completes, so any other held clear still applies after the flight adopts its generation, and every held clear applies when the publication fails or the flight settles first. An outcome under a generation the request never observed stands only when the final shared generation read confirms it. * 🧬 fix: Correlate Catalog Recovery Clears With the Generation Their Fence Wrote Local catalog-recovery clears carried only a user and server, so the tracker could not tell a flight's own credential publication from any other writer. It counted clears and bounded its hold with a time window instead, which left a request that joined before the window expired waiting on a stalled publication, and let a late fence clear delete the flight that took over after the window. The authorization fence now hands local recovery the generation it wrote, and a clear spares state already recorded under that generation; a clear without one still clears. A flight holds the clears it receives while its own publication is open, adopts the generation that publication wrote, and then applies each held clear against it, so its own clear is spared while a teardown or another publication's clear still applies. Retry-intent cleanup inside the fence is bounded by the same per-attempt timeout as the generation write, since a leftover intent only advances the generation again, so the publication itself can no longer hold its joiners open and no time window is needed. * 🔏 fix: Confirm an Adopted Catalog Generation for Requests That Read None A request whose pre-discovery generation reads both failed observed no generation, so the confirmation rule exempted it. When that request's own discovery refreshed credentials, adopted the generation its publication wrote, and another replica rotated past it before a final read that also failed, the catalog was served without ever being confirmed against shared state. A flight's own result now records that its generation came from its own publication, and that mark is never copied into retained state. An outcome under a generation the request did not read needs final confirmation whenever the request read a different generation or the generation was adopted; an outcome whose generation the tracker merely carried over for a request that read nothing keeps the existing fail-open behavior, so a cache outage still preserves retained backoff and reauthorization state. * 🧭 fix: Judge In-Flight Catalog Recovery by the Shared Generation, Not a Tagged Clear A publication's local clear carries the generation it wrote, and the tracker deleted any state recorded under a different one. Generations carry no order, so a refresh that outlived its own flight could clear with an older generation and delete a flight that had started under a newer rotation from another replica, discarding a catalog that was still current. A tagged clear now only signals that the shared generation advanced. A flight still in flight under a known generation, or publishing its own credential change, is left to the requests awaiting it, which already confirm their outcome against the shared generation exactly as they do for a rotation from another replica. Retained state and flights with no known generation are cleared unless recorded under the clear's generation, and a clear without a generation still clears unconditionally. The tracker no longer holds clears during a publication: the refresh's own clear spares its flight directly, and the flight adopts the generation it wrote when the publication completes. The shared-discovery tests compared catalog maps through expect.objectContaining, which does not compare Map contents; they now assert each request's catalog with toEqual. * 🧾 fix: Confirm a Catalog Flight That a Clear for Another Generation Spared A tagged clear spares a flight still in flight, because an unordered generation cannot say whether that flight predates the rotation. The spare was not recorded, so when the request's final shared-generation read timed out, a flight that had observed its own generation kept a catalog the clear may have superseded: an older recovery whose refresh published after a replacement flight started could leave that replacement serving tools no read ever confirmed. A spared flight now records the generation each such clear carried and settles against its final generation. A clear for its own generation, including its own refresh's, changes nothing; any other marks the flight's result unconfirmed, keeps it out of retained state, and requires every request awaiting it to confirm the generation against the shared read before using its tools. A spared flight that finishes with no known generation is discarded, as the clear would have done. A tagged clear no longer spares retained state recorded under its generation. |
||
|---|---|---|
| .. | ||
| credentials.js | ||
| credentials.spec.js | ||
| mcp.js | ||
| mcp.spec.js | ||
| search.js | ||
| search.spec.js | ||