Conversation
When using HTTP transports, server errors are raised in the background session runner task, not in the code path awaiting a response. This caused calls like client.call_tool() to hang indefinitely. Added _await_with_session_monitoring() to detect session task failures and propagate exceptions immediately instead of hanging. Closes #2595
WalkthroughA new internal utility method Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)src/fastmcp/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-12-25T15:53:07.656ZApplied to files:
🪛 Ruff (0.14.10)src/fastmcp/client/client.py692-692: Avoid specifying long messages outside the exception class (TRY003) 713-713: Avoid specifying long messages outside the exception class (TRY003) ⏰ 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). (4)
🔇 Additional comments (16)
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 |
When using HTTP transports, server errors (4xx/5xx) are raised in the background
_session_runnertask rather than in the code path awaiting a response. This caused methods likecall_tool()to hang indefinitely waiting for a response that would never arrive.The fix adds
_await_with_session_monitoring()which usesasyncio.wait()to monitor both the pending call and the session task. If the session task fails, its exception is propagated immediately instead of hanging:All session-calling methods now use this monitoring, including
call_tool,list_tools,read_resource,get_prompt, etc.Closes #2595