| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:22d34917-1a41-36ac-f470-bd13d95aac08 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A556:3D7871:181B90:213D55:6AFD0401 |
| html-safe-nonce | c0d47e6636ee165363abae29f15803f40aa45c32f9bffd75c2ba961aa2c5e087 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTU2OjNENzg3MToxODFCOTA6MjEzRDU1OjZBRkQwNDAxIiwidmlzaXRvcl9pZCI6IjgwNzE4MTM4NDI1NjE5OTE2ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 44adb28328e7cb093d674a4b43d16f39bc48055100786a1908d377d9b311442f |
| hovercard-subject-tag | pull_request:3326408465 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| twitter:image | https://avatars.githubusercontent.com/u/7453026?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7453026?s=400&v=4 |
| og:image:alt | Summary
Fix memory leak where run_stateless_server tasks accumulate indefinitely in the manager's global task group after client disconnects
Use request-scoped task groups instead of the globa... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8fd5a24ae29aa78df114eaaf1f9a839e8c3b7c0d27549e4f54678bb7cf3166d4 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd0990b833f227378ab84f1d9519db1a04660550 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2145%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2145%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| modelcontextprotocol | https://github.com/modelcontextprotocol |
| python-sdk | https://github.com/modelcontextprotocol/python-sdk |
| Code | https://github.com/modelcontextprotocol/python-sdk |
| Issues305 (305) | https://github.com/modelcontextprotocol/python-sdk/issues |
| Pull requests112 (112) | https://github.com/modelcontextprotocol/python-sdk/pulls |
| Actions | https://github.com/modelcontextprotocol/python-sdk/actions |
| Projects | https://github.com/modelcontextprotocol/python-sdk/projects |
| Security and quality12 (12) | https://github.com/modelcontextprotocol/python-sdk/security |
| Insights | https://github.com/modelcontextprotocol/python-sdk/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose |
| wiggzz | https://github.com/wiggzz |
| modelcontextprotocol:main | https://github.com/modelcontextprotocol/python-sdk/tree/main |
| wiggzz:fix/stateless-task-group-leak | https://github.com/wiggzz/python-sdk/tree/fix/stateless-task-group-leak |
|
Conversation
1
| https://github.com/modelcontextprotocol/python-sdk/pull/2145 |
|
Commits
17
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits |
|
Checks
25
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/checks |
|
Files changed
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
|
Fix stateless HTTP task accumulation causing memory leak
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#top |
|
Show all changes
17 commits
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
|
6bd4531
Fix stateless HTTP task accumulation causing memory leak (#756)
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/6bd4531c7b387279d1e6919d82c7bc0985693fa4 |
|
8bfcca2
Fix issue reference from #756 (closed) to #1764 (open)
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/8bfcca2fbc5cf35601e4d06163d87f01ffcbef20 |
|
bc59032
Fix CI: coverage, ruff format, and remove unused handle_list_tools
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/bc590325188df7f80450d87a4262be6c197a6cec |
|
4116e02
Remove over-conservative pragma: no cover annotations
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/4116e0294e2a74872819ab13d64e84b9a5b57849 |
|
1095767
Revert sleep(0) approach — coverage was racy
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/10957676eaef87722193c2fab468692265e67eb9 |
|
f6909a1
Move pragma: no cover to logger.debug (the unreachable line)
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/f6909a10b29ea50bb31c05792eef5f6e63defb94 |
|
2e0e00b
Move terminate() after task group exit for deterministic cancellation
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/2e0e00b1f926f7e21ece29dfa15be3760db46255 |
|
1af03f8
Use lax no cover for timing-dependent exception paths; fix ruff format
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/1af03f876b090d189512b40a13be53be34d51d34 |
|
bf8cf43
Fix ruff format and Python 3.11 coverage false negatives in test
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/bf8cf4326642207609b01d2c1f7fe0601cc15f79 |
|
24da35a
Remove unused Tool import flagged by ruff
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/24da35a945c84b52d7151a0d17c31d0e76c72e42 |
|
35f08c7
Fix pyright errors for private task group access in test
wiggzz Feb 25, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/35f08c78570d46a54e49480ca5cc3c00b5689778 |
|
a7907d0
Add assertion for session_manager not None (pyright)
wiggzz Feb 26, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/a7907d069343b98f9edbb51cc8f5fd21fd95a751 |
|
02547cb
Run handle_request in caller context, not as child task
wiggzz Feb 26, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/02547cbc146aef4989925a3cb8a6b26bd22e87ce |
|
3179143
Add graceful SSE drain on session manager shutdown
wiggzz Mar 9, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/3179143b9ef2bb243dcaf93b2e31e797f7c793e4 |
|
0d513a6
Fix CI: pyright type errors in test and strict-no-cover false positive
wiggzz Mar 9, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/0d513a699e297b4ab11118aa163293a96af5c558 |
|
bb1a218
Merge branch 'main' into fix/stateless-task-group-leak
wiggzz Mar 23, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/bb1a2184674ef7cfcfdd661bf24878af12c53d66 |
|
6237bc3
Merge branch 'main' into fix/stateless-task-group-leak
wiggzz Apr 1, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/commits/6237bc3fcee581c456f1281a88173c591c10ae81 |
|
Clear filters
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
|
streamable_http.py
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
streamable_http_manager.py
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
session.py
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc |
|
test_streamable_http_manager.py
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-ee0bac8ccf39135f1347002539cc4af38ee7e89b85595884e94fb4ab304a111d |
| src/mcp/server/streamable_http.py | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/6237bc3fcee581c456f1281a88173c591c10ae81/src/mcp/server/streamable_http.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-0119e4c1bbf2fde7ba89b9c9f5bc472ccc2332f84e96e47cf9e45cebef801da3 |
| src/mcp/server/streamable_http_manager.py | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/6237bc3fcee581c456f1281a88173c591c10ae81/src/mcp/server/streamable_http_manager.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-1071ee05567116cb77322c376307b9071c6212871068ccf41911fc337ed473af |
| src/mcp/shared/session.py | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/6237bc3fcee581c456f1281a88173c591c10ae81/src/mcp/shared/session.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/2145/files#diff-aaa1596dd4db91f5cd7f743c8afbe58596daf01a2ecec4a0024768f7409fb1dc |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/2145/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |