@@ -507,13 +507,17 @@ export function createMcpProviderFactory(deps: McpProviderDeps = {}): ConnectorP
507507 // the server's answer was given to that credential.
508508 //
509509 // A grant-bearing instance's borrowed token (`ctx.credentialHandle`)
510- // reaches the server too, and is deliberately not counted here: the
511- // credential path a refusal below takes holds and marks the instance's
512- // `credentialRef` row, which for such an instance is its client secret —
513- // a value the listing never depended on — while the token that was sent
514- // belongs to an organization's connection, which that path neither marks
515- // nor re-attempts on a reconnect. Until the materializer has a route for
516- // it, such an instance keeps the plain fault.
510+ // reaches the server too, and is deliberately not counted here. A 403 the
511+ // server answers that token with at discovery (thrown above as
512+ // `ConnectorCredentialRejectedError`; a 401 is refreshed once, then a 503)
513+ // is routed by the materializer to the
514+ // connection the token was borrowed from: for an `authorization_code`
515+ // instance, the discovery organization's connection is marked
516+ // `reconnect_required` and a reconnect there lists again, while the
517+ // instance's `credentialRef` (its client secret) is left alone (#26702).
518+ // The `include` / `toolsSnapshot` refusals below are not routed that way:
519+ // with the borrowed token not counted here, such an instance keeps the
520+ // plain fault for them (the accepted deviation of #28357).
517521 const credentialSent = transport . kind === 'http' && sendsInstanceAuth ( ctx . auth ) ;
518522 if ( includeList ) {
519523 // An entry naming a tool the server does not list is refused after the
0 commit comments