-
Notifications
You must be signed in to change notification settings - Fork 957
Close unclosed resources in the whole project #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thank you
src/mcp/shared/session.py
Outdated
return result_type.model_validate(response_or_error.result) | ||
finally: | ||
await response_stream.aclose() | ||
await response_stream_reader.aclose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we'd also like to delete the entry in self._response_streams
also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional - I can get this later if needed
Looks like there are a bunch of check failures. I'm not sure if these are even related though |
I think it's from a change that I made yesterday, but unrelated to this PR. I think it was merged before the pipeline run? 🤔 |
This leaves one pytest error which might be legit |
@@ -67,6 +67,9 @@ packages = ["src/mcp"] | |||
include = ["src/mcp", "tests"] | |||
venvPath = "." | |||
venv = ".venv" | |||
strict = [ | |||
"src/mcp/server/fastmcp/tools/base.py", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More should be added here.
send_request
I'll be using this branch on PydanticAI. I can't add tests otherwise.