Repository navigation
Description
Problem
After #1379 wired the OAuth flow, the Network tab shows the post-redirect auth HTTP (discovery re-run + POST /token from completeOAuthFlow) but not the pre-redirect half — the protected-resource + authorization-server discovery and the Dynamic Client Registration POST /register that run during authenticate() on the page that then redirects to the auth server. That page's FetchRequestLogState is destroyed on navigation, so those auth entries never reach the connected page.
Root cause (confirmed empirically)
FetchRequestLogState + RemoteInspectorClientStorage are designed to persist the fetch log across the redirect (save on the client's saveSession event keyed by the OAuth authId, restore on the /oauth/callback rebuild). But the ordering defeats it:
BaseOAuthClientProvider.redirectToAuthorization(core/auth/providers.ts:234) setswindow.location.hrefinside the SDK'sauth().OAuthManager.authenticateonly callsonBeforeOAuthRedirect→saveSessionafterauth()returns (core/mcp/oauthManager.ts:138).
By the time the save fires, the document is already unloading, so the save never reaches the backend (verified: no inspector-session-* file is written, even though a keepalive POST dispatched before navigation persists fine, and /api/storage works manually).
Fix plan
Persist the session synchronously, before navigation:
BrowserNavigation— run a synchronousbeforeNavigate(url)hook beforewindow.location.href.createWebEnvironment— accept anonBeforeOAuthRedirecthook and pass it toBrowserNavigation.App.tsx— wire the hook to flush the activeFetchRequestLogStateentries toRemoteInspectorClientStorage(keepalive POST, keyed by the authId parsed from the auth URL).FetchRequestLogState.hydrateFetchRequests— merge restored entries instead of replacing, to avoid a restore-vs-live-append race on the callback page.RemoteInspectorClientStorage.saveSession— usekeepalive: trueso the save outlives the unloading document.
Acceptance criteria
- After a first-time OAuth connect, the Network tab on the connected page shows the full handshake: pre-redirect discovery + DCR
/register, plus post-redirect discovery +/token, all asauth, alongsidetransport. - No regression to non-OAuth servers or to the OAuth connection itself (Wire up OAuth flow in App.tsx: authenticate, oauthAuthorizationRequired listener, /oauth/callback handler #1379).
Activity
docs(auth): address #1385 review — clarify double-save + keepalive ca…
fix(auth): persist OAuth pre-redirect Network log across the redirect (…
feat(network): show auth response bodies with masked secrets + reveal…