Gate log notifications on the per-request log-level opt-in at 2026-07-28 (#3198)

This commit is contained in:
Max 2026-07-28 02:20:33 +01:00 • committed by GitHub
commit 89c5e700f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 406 additions and 31 deletions

View file

@ -50,7 +50,7 @@ async def test_context_logging_helpers_send_log_notifications(connect: Connect)
async def collect(params: LoggingMessageNotificationParams) -> None:
received.append(params)
async with connect(mcp, logging_callback=collect) as client:
async with connect(mcp, logging_callback=collect, log_level="debug") as client:
result = await client.call_tool("narrate", {})
advertised_logging = client.server_capabilities.logging
@ -142,7 +142,7 @@ async def test_report_progress_without_a_progress_token_sends_nothing(connect: C
async def collect(message: IncomingMessage) -> None:
received.append(message)
async with connect(mcp, message_handler=collect) as client:
async with connect(mcp, message_handler=collect, log_level="debug") as client:
result = await client.call_tool("mill", {})
assert unstamped(result) == snapshot(

View file

@ -431,7 +431,7 @@ async def test_adding_and_removing_tools_does_not_notify_connected_clients(conne
async def collect(message: IncomingMessage) -> None:
received.append(message)
async with connect(mcp, message_handler=collect) as client:
async with connect(mcp, message_handler=collect, log_level="debug") as client:
before = await client.list_tools()
await client.call_tool("grow", {})
after = await client.list_tools()