Repository navigation
fix(core): report MCP OAuth token exchange failures on the callback page - #53378
Merged
Merged
Conversation
The loopback callback answered "Authorization successful" as soon as it
received a code, before the token exchange ran. A rejected exchange (for
example an empty client_secret from an unset {env:} reference) then showed
success in the browser while the CLI failed.
The callback page now waits for the exchange and renders the error when it
fails, and an empty configured client_secret is rejected before the browser
flow starts.
Fixes anomalyco#53256
An empty secret can only be detected after {env:} substitution, so the check
could not name the missing variable. The callback page already reports the
rejected exchange.
3 of 6 tasks
Merged
6 of 10 tasks
Sniezka1927
added a commit
to nightly-labs/openbot
that referenced
this pull request
Nov 18, 2026
#12141) * Say in the browser and to the agent when an MCP sign-in did not finish The loopback page of an MCP sign-in answered "OpenBot is signed in. You can close this window." as soon as it got the grant, before the token exchange. When the token endpoint then refused the grant, the browser said "signed in", but no sign-in was saved. The reason showed only on the Marketplace page that started the sign-in. The agent's next test gave only needs_sign_in, so it showed a new Sign in card with no reason. The page now waits for the token exchange (at most the existing token timeout). It says "signed in" only when the sign-in was saved. Else it says "The sign-in did not finish. Go back to OpenBot to see why." The page uses catalog text only, so no provider text reaches the markup. At shutdown, a page that still waits is ended at once. The gateway keeps the reason of the last failed sign-in for each address in this run. A cancel does not count, and a saved sign-in or a sign-out removes it. The agent's needs_sign_in result has it as lastSignInError, and the agent tells the user the reason first. A sign-in whose page opened on another computer, a relayed sign-in and the openbot:// link keep their answers. opencode fixed the same page problem in anomalyco/opencode#53378. Fixes #12017 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the tool search condition first, and forget a removed server's sign-in failure In a tool search answer, the sentence that tells the agent to report the last sign-in failure came before "When the user's request needs this server". Now the condition comes first. A server that the user removes, when no other server uses its address, now also loses its last sign-in failure. A server that the user adds again does not get an old reason. A comment now says why a relayed sign-in, and a sign-in opened on another computer, keep their answer at once. Refs #12017 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #53256
The MCP OAuth loopback callback answered "Authorization successful" as soon as it received a code, before the token exchange ran. When the exchange was rejected (e.g. Slack's
bad_client_secretfrom an unset{env:}client_secret), the browser reported success while the CLI failed and the cause was only in the server log.The callback now holds the browser response until the exchange finishes and renders the success page or the error page with the provider's message. The exchange runs in a scoped fiber, so it completes whether or not the caller awaits
callback.Adds a test where the token endpoint rejects the code and asserts the callback page returns 400 with the error and
callbackfails.