Repository navigation
fix(web-ui): offer Login on quarantined servers that need OAuth sign-in - #1366
Merged
Merged
Conversation
A remote OAuth server imported with quarantine on (e.g. GitHub MCP at
api.githubcopilot.com) reported health {level: healthy, action: approve}
while it could not connect until the user signed in. The Servers card
showed a "Sign-in required" chip and a red "needs you to sign in" alert
but no Login button, because Login rendered only for action == login.
- ServerCard: render Login whenever oauthSignInState() is set (as
ServerDetail's SignInPanel already does), alongside Approve; suppress
the redundant red error; skip disabled servers, whose diagnostic is
stale and whose next step is Enable.
- health calculator: a quarantined server awaiting OAuth sign-in now
reports degraded (first sign-in) or unhealthy (re-auth) with summary
"Quarantined — Sign-in required"; admin_state and the Approve action
are unchanged. Non-login OAuth matches in the "error" state stay in
the transport-fault branch so wrapped transport failures keep naming
the real cause.
Deploying mcpproxy-docs with
|
| Latest commit: |
349a946
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://937fe18d.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://claude-brave-mayer-ac613d.mcpproxy-docs.pages.dev |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36218816793 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
quarantinedAwaitingSignIn's final fallback required OAuthRequired=true
to treat a broken-stored-token re-auth error as unhealthy. Autodetected
OAuth sets OAuthRequired=false by design, so a quarantined server whose
stored token broke (the connection_oauth.go server-5xx path, message
containing "re-login available" / "server error with stored token")
fell through to the default healthy/"Quarantined for review", hiding a
broken token behind a green health level.
Add an unconditional isOAuthReauthError check mirroring the existing
isOAuthLoginRequiredError check: the reauth marker text is as specific
and trustworthy as the login markers already exempted from the
OAuthRequired gate.
zcode review (plan mode, static trace of every quarantined-path test
case): fix correctly targets the root cause, no regressions in the
transport-fault ("error" state) branch or the existing reauth/sign-in
tests, and the marker text has effectively zero real-world misfire
surface. Verdict: approve, ship as-is.
Addresses zcode finding on internal/health/calculator.go:596-604
(quarantinedAwaitingSignIn) from the branch review.
Enabled, non-quarantined servers with autodetected OAuth (OAuthRequired
is deliberately false — see the comment above quarantinedAwaitingSignIn)
had health.action stuck on 'restart' when their stored token broke, even
though diagnostics.classifyOAuth (which carries no OAuthRequired hint at
all) still assigned MCPX_OAUTH_REAUTH_REQUIRED / MCPX_OAUTH_LOGIN_REQUIRED
from the same raw error text. The two signals then disagreed: ServerCard.vue
derives showLogin from the OAuth diagnostic code independent of
health.action, so the card rendered a Restart button (from health.action)
and a Login button (from the diagnostic) side by side, with the
explanatory error alert suppressed because showLogin also short-circuits
shouldShowError.
The calculator's "error"/"disconnected" branches only promoted
Restart -> Login when input.OAuthRequired was true. Add
oauthActionApplies(), which keeps that behaviour for configured OAuth and
additionally trusts the two specific, unambiguous login/reauth markers
("login available", "re-login available", "server error with stored
token", etc.) without the OAuthRequired gate — mirroring the existing
quarantinedAwaitingSignIn rationale and the already-merged fix for the
quarantined path in this same commit history. isOAuthRelatedError's
connection-fault exclusion runs first in both branches, so a
connection-refused error wrapped in mcp-go's "authentication strategies
failed" text still reports Restart, not Login (regression-tested).
zcode finding: frontend/src/components/ServerCard.vue:471-476 (showLogin)
vs internal/health/calculator.go:236,256 (OAuthRequired gate) vs
internal/diagnostics/classifier.go:66-90 (classifyOAuth, no OAuthRequired
hint) — confirmed genuine by tracing the code paths and reproduced with a
failing test before the fix (calculator_autodetected_oauth_reauth_test.go).
Root-caused at the backend (single source of truth for the action), not
patched in the frontend, matching the sibling fix in this branch's history.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
zcode finding on frontend/src/components/ServerCard.vue:471-475: showLogin's
first branch (`if (healthAction.value === 'login') return true`) ran before
the disabled-server exclusion on the next line, contradicting its own
comment ("A disabled server is excluded"). disableServer()
(frontend/src/stores/servers.ts:208-217) optimistically sets
`server.enabled = false` immediately but does not clear
`server.health`/`server.diagnostic` — those only update once the
SSE-triggered refresh lands. During that window a server whose stale
health.action was still 'login' the instant before it was disabled (the
sibling fix's own headline scenario: an enabled autodetected-OAuth server
with a broken token) rendered the primary Login button instead of Enable.
Self-corrects once the SSE refresh arrives, but was a genuine, easily
triggered ordering bug.
Fix: delete the redundant first branch. oauthSignInState() already returns
'login' whenever health.action === 'login' (frontend/src/utils/health.ts),
so `signInState.value !== null` covers the same case — the disabled-server
checks now run unconditionally first.
Verified test-first: added a case reproducing the exact race (enabled:
false, health.admin_state still 'enabled', health.action still 'login')
that failed before the fix and passes after; confirmed by reverting the
ServerCard.vue change alone and re-running the spec. Full frontend suite
(1348 tests / 136 files) and `npm run build` pass; `go build ./...`
unaffected (no Go files touched).
Dumbris
added a commit
that referenced
this pull request
Sep 26, 2026
Base PRs #1376 (109-c health vocabulary) and #1366 (login on quarantined OAuth servers) are squash-merged into main; this branch's base is retargeted from 109-c-health-vocabulary to main and main is merged in. Conflict resolution preserves both sides' intent: - internal/health/calculator.go: kept main's quarantinedAwaitingSignIn/ oauthActionApplies generalization (#1366) over this branch's narrower OAuthRequired-only check, so a quarantined server needing OAuth sign-in reports actions=[login, approve] with login as health.action. - ServerCard.vue / macOS ServersView.swift, MCPProxyApp.swift, DashboardView.swift: kept this branch's Spec 109-e single-primary-action redesign, which already reads health.actions[0] and independently gates the quarantined Review path in the ⋯ menu / tray submenu — the #1366 login behaviour surfaces correctly as the ONE primary action for that state without reintroducing separate Approve/Login buttons. - frontend/src/utils/health.ts, AdminServers.vue, UserServers.vue: kept main's healthStatusTextOrEmpty() consolidation and the fixed quarantined/disabled fallback ordering (FR-011 round finding). - Rewrote server-card-quarantined-oauth-login.spec.ts and server-card-approve-review-navigation.spec.ts (both added by main, testing the pre-109-e per-action button design) against the merged single-primary-action design; fixtures now match calculator.go's actual actions=[login, approve] output. - Added a race guard to ServerCard's primaryAction: disableServer()'s optimistic update flips `enabled` immediately but `health` only refreshes on the next SSE payload, so a stale 'login' action is forced to 'enable' when `enabled` is false — restores a guarantee the pre-merge showLogin computed had that the unified primaryAction had dropped. - Regenerated oas/swagger.yaml, oas/docs.go, and frontend/src/types/ contracts.ts (no net diff — contracts unchanged by this merge). Verification: go build ./... (bare + -tags server); go test -race on internal/health, cmd/mcpproxy; go test -race -tags server (CI -skip regex) on internal/serveredition, config, oauth, server, httpapi, storage; golangci-lint v2 (bare + --build-tags server, pre-existing canaries only); frontend npm run build (vue-tsc + vite) and npx vitest run (168 files, 1487 tests); macOS swift test (1259 tests, 1 pre-existing unrelated failure, confirmed on a clean checkout without this branch's changes).
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.
Problem
A remote OAuth server imported with quarantine enabled (e.g. GitHub MCP at
https://api.githubcopilot.com/mcp/) sits inpending authand cannot connect until the user signs in.GET /api/v1/serversnevertheless returned:{"level": "healthy", "admin_state": "quarantined", "action": "approve"}On the Servers page the card showed a "Sign-in required" chip and a red "This server needs you to sign in…" alert, but no Login button —
ServerCard.vuerendered Login only whenhealth.action === 'login'. The server detail page already offered "Log in" in the same state (itsSignInPanelkeys onoauthSignInState()).Changes
Web UI —
frontend/src/components/ServerCard.vueoauthSignInState(server)is non-null, alongside Approve (not instead of it).action === 'login'behaviour (FR-018).data-testhooks added:server-card-login,server-card-approve.Health —
internal/health/calculator.gopending authstate, a login-required error, or an OAuth error on a configured-OAuth server) and reportsdegradedfor a first sign-in /unhealthyfor re-auth, with summaryQuarantined — Sign-in required.admin_stateandaction: approveare unchanged, so the review flow and the tray's quarantine badge exemption are unaffected.OAuthRequired: it isfalsefor autodetected OAuth (GitHub), so it keys on the specific login-required markers instead.errorstate, a non-login OAuth match stays in the existing transport-fault branch — mcp-go wraps transport failures in "authentication strategies failed", and that branch names the real cause.Reviewer notes
connected_serverscountlevel == "healthy"; quarantined servers awaiting sign-in now drop out of N (same as the existing quarantined transport-fault case).Models.swiftisOAuthLoginRequired) andmcpproxy doctorstill key only onaction == "login", so they offer no sign-in for this state.Testing
frontend/tests/unit/server-card-quarantined-oauth-login.spec.ts(fails 4/4 without the card change); full frontend unit suite 1347/1347,vue-tscclean.internal/health/calculator_quarantine_fault_test.go(fail before the calculator change);internal/health,runtime,httpapi, tray packages, and the CI-race -tags serversubset ofinternal/server+httpapipass. golangci-lint v2 (bare +--build-tags server): 0 issues.pending auth/degraded/Quarantined — Sign-in required/approve; the card shows Approve + Login + "Sign-in required" chip with no red alert, and clicking Login issuesPOST /api/v1/servers/github/login../scripts/run-web-smoke.sh: 28 passed, 2 skipped.