Modernization safe wins: stdio-safe bootstrap + dev tooling#96
Modernization safe wins: stdio-safe bootstrap + dev tooling#96
Conversation
PR Review: Modernization Safe Wins - STDIO-safe Bootstrap + Dev ToolingSummaryThis PR makes excellent improvements to the codebase by addressing critical infrastructure concerns around STDIO safety, eliminating import-time side effects, and improving dev tooling. The changes are well-scoped, follow TDD principles, and align with the project's modernization goals. ✅ Strengths1. Excellent Problem Identification & Solution
2. Strong Test CoverageThe new regression tests are comprehensive and well-designed:
3. Documentation UpdatesExcellent documentation in the
4. Code Quality Improvements
🔍 Issues & Concerns1. Breaking Change: Default Transport Changed
|
Code Review: Modernization Safe Wins - STDIO-Safe Bootstrap + Dev ToolingOverall Assessment✅ Excellent refactoring that addresses critical STDIO transport issues and improves code quality significantly. This PR makes the codebase more maintainable and production-ready. Strengths1. STDIO Transport Safety 🎯
2. Import-Time Side Effect Removal 🔧
3. SSE Patch Improvements ✨
4. Development Experience 🚀
5. Code Quality 📊
Issues & SuggestionsCritical Issues ❌None identified - The PR is production-ready. Minor Issues
|
Post-review fixes: full dependency upgrade + test suite repairWhat changedDependency upgrade — All libraries upgraded via
Test suite fixed (was 636 errors + 34 failures → 681 passed, 0 failed, 0 errors):
Production bug fix:
Documentation:
Verification
|
- Upgrade all dependencies (fastmcp 2.14→3.1, fastapi, pandas, langchain, etc.) - Fix 636 Docker/testcontainers errors: graceful skip when Docker unavailable - Fix 34 test failures across FastMCP 3.x API changes, pandas deprecations, provider architecture changes, and stale mock targets - Fix production bug: DataFrame.applymap→map (removed in pandas 3.x) - Delete orphaned test_mailgun_email.py (imports non-existent module) - Update CLAUDE.md to align with new transport defaults - All 681 tests pass, 0 errors, ruff lint+format clean
64ecf4a to
35717fc
Compare
|
Update: Rebased onto main and resolved all conflicts. Branch is now clean and mergeable.
|
|
test comment |
|
Code Review: 1 bug, 2 warnings. See full review below. |
|
Bugs - test_in_memory_server.py:52-65: _serialize_health double-encodes. health_resource() returns a json.dumps string already. _serialize_health passes it through _convert which returns strings as-is, then re-wraps with json.dumps again. json.loads(result[0].text) yields a str not dict, so health_data[status] in test_server_health raises TypeError. Fix: return health_resource() directly from health_resource_str(). |
|
Warnings - (1) test files: _disable_output_schemas accesses server.providers[0] and lp._components, private FastMCP internals. IndexError if providers is empty or FastMCP changes structure. Guard with: if not server.providers: return. (2) rate_limiting_enhanced.py:229-242: _await_if_needed wraps pipeline method calls that return the pipeline object, not coroutines. pipeline.execute() still runs all commands correctly so no runtime error, but pattern is misleading. Remove _await_if_needed from pipeline calls. |
|
Notes - (1) tool_estimation.py:134: switching to model_fields_set check correctly fixes edge case where tool_estimates={} was passed explicitly but overwritten. Good fix. (2) data/performance.py:96,150: execute_command(PING) over ping() sidesteps a strict redis-py type-checker false positive; functionally equivalent. (3) scripts/dev.sh: source .env is now before TRANSPORT defaults so .env-supplied MAVERICK_TRANSPORT feeds into the streamable-http default. Correct ordering. |
Summary:
Checks:
Notes: