mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 22:14:27 +00:00
* 🔑 fix: Re-Exchange Rejected OBO Tokens on MCP Auth Failure An OBO MCP connection registered the non-OAuth fallback handler, so a 401/403 from the downstream server became `oauthFailed` without ever running another token exchange. Every reconnect attempt replayed the credential the server had just rejected. Unlike interactive OAuth, an OBO bearer is minted from the user's live upstream session, so a rejection is recoverable with no user-facing step — but only while that session is reachable. `handleOboEvents` re-runs the exchange for a connection whose creating request is still in flight, and retires the connection otherwise, since `upstreamTokenProvider` closes over a finished request past that point and the next borrower rebuilds against a live provider. Three parts: - `handleOboEvents` replaces the fallback for OBO connections: it re-exchanges once per attempt, updates the transport bearer, and emits `oauthHandled` so the connect retry proceeds. - The refreshed token also replaces the runtime `authorization` header. Runtime headers outrank the transport's in `buildFetchInit`, so without this the stale bearer a previous tool call installed would keep winning on the retry. - `resolveOboToken` gains `forceRefresh`, which bypasses the OBO token cache. A revoked or scope-invalidated token is still inside its cached lifetime, so a cached read would hand back the same rejected bearer. A connection that cannot refresh now stops reconnecting rather than replaying the rejected bearer through every backoff step and spending the circuit breaker's cycle budget. * 🔁 fix: Re-Exchange Rejected OBO Tokens on Tool Calls Too Addresses both codex findings on |
||
|---|---|---|
| .. | ||
| acl | ||
| actions | ||
| admin | ||
| agents | ||
| apiKeys | ||
| app | ||
| artifacts | ||
| assistants | ||
| auth | ||
| cache | ||
| cdn | ||
| cluster | ||
| code | ||
| conversations | ||
| crypto | ||
| db | ||
| endpoints | ||
| favorites | ||
| files | ||
| flow | ||
| html | ||
| images | ||
| insights | ||
| langfuse | ||
| mcp | ||
| memory | ||
| middleware | ||
| modelSpecs | ||
| oauth | ||
| plugins | ||
| projects | ||
| prompts | ||
| protection | ||
| rum | ||
| schedules | ||
| security | ||
| shared-links | ||
| skills | ||
| storage | ||
| stream | ||
| telemetry | ||
| tools | ||
| types | ||
| user | ||
| utils | ||
| web | ||
| credentials.spec.ts | ||
| credentials.ts | ||
| imports.spec.ts | ||
| imports.ts | ||
| index.ts | ||
| telemetry.ts | ||