Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions python/packages/core/agent_framework/_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,14 @@ async def message_handler(
if isinstance(message, types.ServerNotification):
match message.root.method:
case "notifications/tools/list_changed":
await self.load_tools()
# Only log here. Calling load_tools() — even as a background task —
# causes a deadlock: load_tools() → _ensure_connected() → send_ping(),
# but the session cannot process the ping while an in-flight call_tool
# request is waiting for its response. Tools will be up-to-date on the
# next explicit load_tools() or connect(reset=True) call.
logger.debug("Tools list changed notification received; reload on next connect.")
case "notifications/prompts/list_changed":
await self.load_prompts()
logger.debug("Prompts list changed notification received; reload on next connect.")
case _:
logger.debug("Unhandled notification: %s", message.root.method)

Expand Down