LibreChat/packages/api
lia-by-librechat[bot] 1ff694b398
🥊 test: Prove MCP Refresh Coordination Across Replica Processes (#16131)
* 🥊 test: Prove MCP Refresh Coordination Across Replica Processes

Fork real replica processes with production Mongo, Redis, encryption and OAuth adapters, and assert one redemption per rotation, peer adoption, and recovery after the authorizing replica is killed. A negative control with coordination disabled observes two redemptions, so a green coordinated run cannot pass on timing alone.

Adds a refreshGate hook to the shared OAuth test provider so concurrent refreshes can be held open. No production code changes.

* test: Establish Replica Overlap Instead of Assuming It

The coordinated assertion counted provider redemptions after a fixed delay, so a peer that arrived once the winner had already persisted would read a fresh credential, never contend, and still leave one redemption: the test would have passed while proving nothing. Both replicas now report entering the refresh path on a credential they observed expired, and getTokens own onRefreshSuccess/onTokensAdopted hooks report which side each took, so the pair (one redeemed, one adopted) is asserted rather than inferred from timing.

A worker that never signalled ready was also left running with live Mongo and Redis connections, which would outlive the suite and disturb the rest of the integration lane; boot failures now reap the child and report the workers own initialization error.

---------

Co-authored-by: Lia <lia@librechat.ai>
2026-09-20 10:29:53 -04:00
..
openapi 📖 fix: Verify Agents OpenAPI contracts and disable external reporting (#16028) 2026-09-16 15:17:56 -04:00
src 🥊 test: Prove MCP Refresh Coordination Across Replica Processes (#16131) 2026-09-20 10:29:53 -04:00
types
.gitignore
babel.config.cjs
jest.config.mjs 🧵 ci: Keep a Floor of Two Jest Workers in CI (#15819) 2026-09-14 00:32:20 -04:00
jest.setup.cjs
package.json 🌳 feat: Isolate Attached Workspaces by Conversation (#16107) 2026-09-19 23:19:26 -04:00
tsconfig-paths-bootstrap.mjs
tsconfig.build.json
tsconfig.json
tsconfig.openapi.json 🔌 feat: OpenAPI spec and docs for the public Agents API (#15928) 2026-09-16 13:50:05 -04:00
tsconfig.spec.json
tsdown.config.mjs