← Back to Pull requests

[Samples] 10-StreamliningAIWorkflows: Python SDK 2.x for lab2-lab4 #1252

Open
unknown opened this pull request with 126 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 11, 2026 17:10 UTC
Author

Part 20 of 22 of the split of #1225, #1226 and #1227, which were too large to review. Each new PR changes only the files in its own folder, so none of them conflict, and together they make exactly the same changes as those three PRs.

What changed

  • lab3 (weather_mcp) and lab4 (github_mcp_server): mcp.server.fastmcp → MCPServer (host/port moved from the constructor to run(...)), mcp[cli]>=2.3.0,<3 in pyproject.toml, uv.lock regenerated (mcp 2.3.0). SSE is still supported in 2.x, so both labs keep SSE.

  • lab2 agent.py: snake_case result fields of the 2.x client (input_schema); the install command is pinned (mcp[cli]>=2.3.0,<3, openai>=3.44.0,<4).

  • READMEs updated to match.
  • Testing

  • uv lock --check reports both lockfiles in sync.

  • lab3 and lab4 servers work over SSE.
  • Note: AGENTS.md's Python validation command (pytest -q in lab3 weather_mcp) finds no tests (exit 5); that's unchanged here.

    🤖 Generated with Claude Code

    Diff: 126 lines (+94 / -32) across 1 files Reviewer: skytin1004 Review duration: 27342m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 126 lines diff across 1 files
    0.37
    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.290
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1252"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    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: 37.0% (MEDIUM) · Higher = larger blast radius
    37.0%
    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: 19.7% · Safe to merge
    19.7%