← Back to Pull requests

fix(core): preserve pathless MCP OAuth resources #60125

Open
unknown opened this pull request with 273 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 29, 2026 06:16 UTC
Author

Issue for this PR

Closes #58956

Type of change

  • Bug fix

  • New feature

  • Refactor / code improvement

  • Documentation
  • What does this PR do?

    Preserve a pathless OAuth resource such as https://example.com through custom provider validation. The existing SDK patch now keeps the metadata string when the selected URL represents that same resource. A provider's deliberate query or path change still takes precedence.

    How did you verify your code works?

    With Bun 1.4.4 and the locked MCP SDK 2.3.1, the regression in mcp-oauth.test.ts exercises the real McpOAuth.connectProvider. It fails with the old SDK condition, which adds a trailing / to the token-request resource, and passes with the patch. All 23 tests in the file pass.

    The full core suite finished with 6,991 passed, 33 skipped, and 12 failed. Focused reruns reproduced the same 12 failures on the original PR head (25d60caf) and with the updated tests.

    Core bun typecheck passed using Bun’s checker. Root bun run check did not complete because Astro typechecking was killed with SIGKILL. The separate core bun run typecheck:tsc also did not complete (SIGKILL).

    Visual

    <svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
      <style>.flow{animation:flow 2s linear infinite}@keyframes flow{to{stroke-dashoffset:-12}}@media(prefers-reduced-motion:reduce){.flow{animation:none}}</style>
      <g fill="none" stroke="currentColor" opacity=".5"><rect x="8" y="17" width="89" height="38" rx="4"/><rect x="143" y="17" width="89" height="38" rx="4"/></g>
      <g fill="currentColor" font-family="monospace" font-size="10" text-anchor="middle"><text x="52" y="32" opacity=".6">resource</text><text x="52" y="45">https://host</text><text x="188" y="32" opacity=".6">token</text><text x="188" y="45">https://host</text></g>
      <path class="flow" d="M103 36h32m-5-5 5 5-5 5" fill="none" stroke="currentColor" stroke-dasharray="4 2"/>
    </svg>
    

    Screenshots / recordings

    No interface change.

    Checklist

  • I have tested my changes locally

  • I have not included unrelated changes in this PR
  • Diff: 273 lines (+204 / -69) across 3 files Reviewer: wozhenbang2004 Review duration: 42092m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.63) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 273 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.336
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #60125"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.7% (MEDIUM) · Higher = larger blast radius
    62.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 33.4% · Safe to merge
    33.4%