fix(connector): stop lying about state, and say why sign-in failed#266
Merged
Conversation
Three things the Connector tab got wrong, all reported from live use: 1. GitHub's "Sign in" did nothing. Its MCP server publishes no OAuth metadata at all, so fastmcp's Dynamic Client Registration 404s and the flow dies BEFORE a browser opens. The error was swallowed. signin_server now maps every failure to an operator-readable message naming the cause and the fix (GitHub needs a PAT under "headers", not OAuth). 2. Hugging Face showed "Connected" though nobody ever signed in. It's an OPEN endpoint (auth: none) — there is no session, which is also why it offered no way out. Saying "Connected" reads as "someone signed in here". It now reads "Ready — open endpoint, no sign-in needed". 3. Failures surfaced as toasts that vanish before they can be read. Sign-in errors now stay ON the card until the next attempt. Also renames Disconnect -> Sign out, matching what the button actually ends. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <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.
Three defects, all reported from live use, all confirmed against the real endpoints.
1. GitHub's "Sign in" did nothing
Not a UI bug. GitHub's MCP server publishes no OAuth metadata at all, so fastmcp's Dynamic Client Registration 404s and the flow dies before a browser can open:
Probed to confirm:
/.well-known/oauth-authorization-serverhttps://mcp.notion.com/register✅https://huggingface.co/oauth/registerThe error was swallowed.
signin_servernow never raises and maps each failure to an actionable message — GitHub's says it needs a personal access token underheaders, not OAuth.2. Hugging Face said "Connected" though nobody signed in
It's an open endpoint (
auth: none). There is no session — which is also why the card offered no way out. "Connected" reads as "someone signed in here", which is false. Now: "Ready — open endpoint, no sign-in needed", with no Sign out, because there is nothing to end.3. Failures vanished before they could be read
Sign-in errors were toasts. They now stay on the card until the next attempt.
Also renames Disconnect → Sign out — it matches what the button actually ends.
State machine
Tests
Error mapping verified across all four failure modes (DCR 404 → PAT instructions; registration 500 → rejected-registration; timeout → check URL/online; unknown → raw detail).
py_compileclean on both changed Python files.