fix(mcp): surface 401s as an actionable "needs sign-in" state (#3719)

Closes #3719. MCP HTTP 401s now report a distinct `Unauthorized` state (typed McpUnauthorizedError + atomic ConnectFailure snapshot) with a localized 'Sign in' notice instead of a raw-error dead-end; recovery polling + i18n across 14 locales.
This commit is contained in:
sanil-23
2026-06-17 13:11:28 +05:30
committed by GitHub
parent cdadf316aa
commit c818f026cb
26 changed files with 353 additions and 45 deletions
@@ -32,6 +32,7 @@ const STATUS_DOT: Record<ServerStatus, string> = {
connected: 'bg-sage-500',
connecting: 'bg-amber-400',
disconnected: 'bg-stone-300 dark:bg-neutral-600',
unauthorized: 'bg-amber-500',
error: 'bg-coral-500',
disabled: 'bg-stone-200 dark:bg-neutral-700',
};
@@ -119,8 +120,18 @@ const McpServersTab = () => {
// Poll status
useEffect(() => {
const hasConnected = statuses.some(s => s.status === 'connected');
if (!hasConnected) {
// Poll while anything is in a non-terminal state — not just `connected`.
// An `unauthorized`/`error`/`connecting` server can transition (the
// background reconnect supervisor, a completed OAuth sign-in, an expiring
// token) and the UI must reflect that without a manual refresh (#3719 RC5).
const hasActive = statuses.some(
s =>
s.status === 'connected' ||
s.status === 'connecting' ||
s.status === 'unauthorized' ||
s.status === 'error'
);
if (!hasActive) {
if (pollTimerRef.current) {
clearTimeout(pollTimerRef.current);
pollTimerRef.current = null;