-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Make fastapi.cli a runnable package #2532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe CLI entry-point behavior has been refactored by removing the runtime execution guard from Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (1)src/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test Failure AnalysisSummary: 9 tests failed due to unexpected Root Cause: The test failures are caused by MCP Python SDK version 1.23.0 (released December 2, 2025) introducing a new The Failed Tests:
Suggested Solution: The FastMCP codebase needs to be updated to handle MCP SDK 1.23.0's task field. Here are the options: Option 1: Update Tests to Handle Task Field (Recommended)Update test assertions to accommodate the new # In test_logging.py tests, update expected payloads to include task:null
# Example from test_create_message_with_payloads (line ~1448):
expected_payload = '{"method":"tools/call","params":{"task":null,"_meta":null,"name":"test_method","arguments":{"param":"value"}}}'Option 2: Pin MCP SDK Version (Temporary)Add version constraint until FastMCP is updated: "mcp>=1.19.0,<1.23.0,!=1.21.1"Option 3: Use Model Exclusions in PydanticIf FastMCP doesn't need task tracking, configure Pydantic models to exclude the task field during serialization. Detailed AnalysisTest Failure PatternAll logging middleware tests fail because they compare exact JSON payloads, and the new Before (MCP SDK < 1.23.0): {"method":"tools/call","params":{"_meta":null,"name":"test_method","arguments":{"param":"value"}}}After (MCP SDK >= 1.23.0): {"method":"tools/call","params":{"task":null,"_meta":null,"name":"test_method","arguments":{"param":"value"}}}This adds 12 characters (
Why This PR is InnocentThis PR only:
These changes have ZERO impact on:
The timing is coincidental - the PR was created after MCP SDK 1.23.0 was released but before FastMCP tests were updated. Related FilesFiles needing updates:
MCP SDK References: Recommendation: This PR's changes are correct and should be merged once FastMCP is updated to handle MCP SDK 1.23.0. The test failures are a separate issue requiring updates to the test suite across the codebase. Sources: |
Description
python -m fastmcp.clididn't work before, despite there being anif __main__block.This PR fixes the structure, adding a
__main__.pyfile to make the package runnableReview Checklist