build: complete upgrade to fastapi 0.141, mcp sdk v2, fastmcp 4 and httpx2

This commit is contained in:
lda
2026-09-06 12:17:15 +07:00 Verified
parent 5b901557bd
commit 6d5b6741fb
42 changed files with 946 additions and 737 deletions
+2 -2
View File
@@ -159,7 +159,7 @@ def test_proxy_admin_reload_sends_list_changed_notifications(tmp_path: Path) ->
asyncio.run(run_proxy())
methods = [notification.root.method for notification in notifications]
methods = [notification.method for notification in notifications]
assert "notifications/tools/list_changed" in methods
assert "notifications/resources/list_changed" in methods
assert "notifications/prompts/list_changed" in methods
@@ -205,5 +205,5 @@ def test_proxy_config_mutation_does_not_notify_before_reload(tmp_path: Path) ->
asyncio.run(run_proxy())
methods = [notification.root.method for notification in notifications]
methods = [notification.method for notification in notifications]
assert "notifications/tools/list_changed" not in methods
+5 -5
View File
@@ -6,10 +6,10 @@ from pathlib import Path
from typing import Any
import anyio
import httpx
import httpx2
import mcp.types as mcp_types
import pytest
from mcp.shared.exceptions import McpError
from mcp.shared.exceptions import MCPError
from wf_mcp.models import BrokerConfig, ConnectionConfig
from wf_mcp.proxy import create_proxy_client
@@ -142,17 +142,17 @@ def test_proxy_listing_degrades_when_one_source_has_connection_error(
("exc", "expected_log_name"),
[
(
McpError(
MCPError.from_error_data(
mcp_types.ErrorData(
code=mcp_types.INTERNAL_ERROR,
message="connection closed",
)
),
"McpError",
"MCPError",
),
(anyio.ClosedResourceError(), "ClosedResourceError"),
(anyio.EndOfStream(), "EndOfStream"),
(httpx.ConnectError("connection refused"), "ConnectError"),
(httpx2.ConnectError("connection refused"), "ConnectError"),
],
)
def test_proxy_listing_degrades_when_session_transport_closes(