Repository navigation
Studio: stop asking for MCP OAuth consent again after the token expires - #18203
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # studio/backend/core/inference/mcp_client.py
…CP server (unslothai#18171) Related to unslothai#18164 (the reported bug is fixed in unslothai#18203). When several connections to Notion's MCP server refreshed an expired token at the same time, Studio could keep a refresh token Notion had already replaced. The next refresh failed with a 400 and Studio asked for consent again on every connection. Now one connection refreshes and the rest reuse the new token. Tested against the real Notion MCP server in Studio: | Before | After | |---|---| |  |  |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #18164. Studio refreshed MCP OAuth tokens at
<server>/tokeninstead of the server's real token endpoint, because every connection starts a new OAuth client that hasn't looked up the server's metadata. Servers like better-auth (/api/auth/oauth2/token) answered 404, so every reconnect after the access token expired sent the user through sign-in and consent again. Studio now saves the token endpoint with the tokens and uses it on refresh.Tested with a real better-auth server: