Skip to content

feat(diagnostics): classify OAuth login-required (MCP-1820)#628

Merged
Dumbris merged 1 commit into
mainfrom
mcp-1820-oauth-login-classify
Jun 9, 2026
Merged

feat(diagnostics): classify OAuth login-required (MCP-1820)#628
Dumbris merged 1 commit into
mainfrom
mcp-1820-oauth-login-classify

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Foundation task MCP-1820 under epic MCP-1819. Makes OAuth "needs sign-in" classify correctly instead of falling through to MCPX_UNKNOWN_UNCLASSIFIED (which drives a misleading "file a bug" CTA), and stops the health calculator from painting an expected first-time login as unhealthy/red.

Changes

  • internal/diagnostics/codes.go — add MCPX_OAUTH_LOGIN_REQUIRED and MCPX_OAUTH_REAUTH_REQUIRED (OAUTH domain), documented as actionable user-states (NOT faults).
  • internal/diagnostics/registry.go — catalog entries with login-oriented fix steps (Sign in / Sign in again), never file-a-bug. Login = warn, re-auth = error.
  • internal/diagnostics/classifier.goclassifyOAuth string backstops: "oauth authentication required", "login available", "mcpproxy auth login" → login; "re-login available", "re-authentication required", "server error with stored token" → re-auth. Re-auth is matched first because "re-login available" contains "login available".
  • internal/upstream/core/connection_oauth.goErrOAuthPending.Code() typed fast-path: default/login-available message → OAuthLoginRequired; the stored-token-broke (server-5xx) message → OAuthReauthRequired.
  • internal/health/calculator.go — error/disconnected branches: first-time sign-in → degraded/amber + login + "Sign-in required"; re-auth and other genuine OAuth errors (revoked / invalid_grant) stay unhealthy/red. Connection-failure precedence in isOAuthRelatedError preserved (offline servers still suggest restart).
  • docs/errors/ — pages for both new codes + catalog index entries.

Tests (TDD)

  • internal/diagnostics/classifier_test.go — both codes, typed fast-path + string backstop (incl. the re-login/login substring-ordering case).
  • internal/upstream/core/oauth_error_test.goErrOAuthPending.Code() + end-to-end diagnostics.Classify.
  • internal/health/calculator_test.go — login → degraded+login+"Sign-in required"; re-auth → unhealthy+login (both error and disconnected states).

Verification

  • go build ./... — clean
  • go test -race ./internal/diagnostics/... ./internal/health/... ./internal/upstream/... ./internal/runtime/... — all green
  • ./scripts/run-linter.sh — 0 issues

Related #MCP-1820

…tate

OAuth "needs sign-in" previously fell through to MCPX_UNKNOWN_UNCLASSIFIED,
which drives a misleading "file a bug" CTA, and the health calculator marked
every OAuth-related error as unhealthy/red — even an expected first-time login.

- Add MCPX_OAUTH_LOGIN_REQUIRED (warn) and MCPX_OAUTH_REAUTH_REQUIRED (error)
  codes with login-oriented catalog entries (never file-a-bug).
- ErrOAuthPending.Code() attributes the typed fast-path: default/login-available
  message -> OAuthLoginRequired; the stored-token-broke (server-5xx) message ->
  OAuthReauthRequired.
- classifyOAuth string backstops catch the stringified forms; re-auth is matched
  before login because "re-login available" contains "login available".
- Health: first-time sign-in (ErrOAuthPending) -> degraded/amber + login +
  "Sign-in required"; re-auth and other genuine OAuth errors stay unhealthy/red.
  Connection-failure precedence in isOAuthRelatedError is preserved.
- Docs: add docs/errors pages for both codes and list them in the catalog index.

Related #MCP-1820
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 75dcefc
Status: ✅  Deploy successful!
Preview URL: https://1495c3ca.mcpproxy-docs.pages.dev
Branch Preview URL: https://mcp-1820-oauth-login-classif.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: mcp-1820-oauth-login-classify

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (24 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 27221871300 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris enabled auto-merge (squash) June 9, 2026 20:05

@mcpproxy-gatekeeper mcpproxy-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatekeeper approval — Codex review verdict: ACCEPT.

This approval is posted automatically by the MCPProxy Gatekeeper App on behalf of the Codex reviewer (verdict of record lives in the Paperclip review thread). Author≠approver satisfied; QA + CI gates enforced separately.

Auto-approved per Model B (MCP-1249).

@Dumbris Dumbris merged commit bbea7fd into main Jun 9, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants