René's URL Explorer Experiment


Title: fix(shared): stop concurrent int/string request ids from colliding in _in_flight by 1828703450qqcom-ux · Pull Request #3815 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: fix(shared): stop concurrent int/string request ids from colliding in _in_flight by 1828703450qqcom-ux · Pull Request #3815 · modelcontextprotocol/python-sdk

X Title: fix(shared): stop concurrent int/string request ids from colliding in _in_flight by 1828703450qqcom-ux · Pull Request #3815 · modelcontextprotocol/python-sdk

Description: fix(shared): stop concurrent int/string request ids from colliding in _in_flight Fixes #3807 Summary JSONRPCDispatcher._in_flight keyed inbound requests by coerce_request_id(req.id), which folds "7" and 7 into one dict slot. Two concurrent requests whose ids differ only in JSON-RPC type blind-overwrote each other, and a notifications/cancelled naming one cancelled whichever was stored — the other ran to completion and could no longer be cancelled. Store in-flight requests under the verbatim id so distinct wire representations stay distinct. Cancellation looks up the exact id first and falls back to coerced/stringified forms so a peer that echoes a different type between request and cancel still cancels the request (the existing test_cancelled_correlates_across_string_and_int_request_id_forms passes unchanged in both parametrizations). Reproduction Unmodified SDK, stdio, two concurrent requests with ids "9007199254740991" (string) and 9007199254740991 (int), plus a notifications/cancelled for the string id (see the reproduction script linked in #3807): on main: the cancel hits the int-id request (they share the coerced slot); the string-id request answers, the int-id request never does. after the fix: the cancel hits only the string-id request; the int-id request answers normally. Fix src/mcp/shared/jsonrpc_dispatcher.py — three hunks: Store (_dispatch_request): self._in_flight[req.id] = ... — verbatim id, no coercion. Cancel (_dispatch_notification): exact-id lookup first; if missed, try the coerced id and its stringified form so cross-type echo still correlates. Delete (_handle_request): pop by verbatim id, matching the store. The pending (outbound correlation) table is untouched: its coercion is correct and needed for response matching. Validation New regression test test_peer_cancel_does_not_cross_request_id_types: case on main (af4c6f4) after concurrent "9007199254740991" and 9007199254740991, cancel the string one int-id request cancelled (wrong); string-id answered string-id cancelled; int-id answers cross-type echo: cancel with int for a string-id request passes passes (coerced fallback) cross-type echo: cancel with string for an int-id request passes passes (stringified fallback) The regression test fails on unmodified main (the int-id request gets no response) and passes after. Full tests/shared/test_jsonrpc_dispatcher.py: 80 passed, 0 failed — zero regressions, including both parametrizations of the cross-type correlation test. Scope 2 files: src/mcp/shared/jsonrpc_dispatcher.py and tests/shared/test_jsonrpc_dispatcher.py. No change to the outbound pending table, _allocate_id, the direct dispatcher's collision detection, or any handler/cancellation semantics beyond the id-keying described above.

Open Graph Description: fix(shared): stop concurrent int/string request ids from colliding in _in_flight Fixes #3807 Summary JSONRPCDispatcher._in_flight keyed inbound requests by coerce_request_id(req.id), which folds &...

X Description: fix(shared): stop concurrent int/string request ids from colliding in _in_flight Fixes #3807 Summary JSONRPCDispatcher._in_flight keyed inbound requests by coerce_request_id(req.id), which folds &...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3815

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:2ab40882-040f-f2f8-4da3-b21a61e0c223
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDE18:3A347:27F9EF:36986C:6B00C242
html-safe-nonce4d59f76d1c8243905ae828d51e0a2461fc6bf911cf5d2420c95d9d172ee0f120
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTE4OjNBMzQ3OjI3RjlFRjozNjk4NkM6NkIwMEMyNDIiLCJ2aXNpdG9yX2lkIjoiNzkwNzExNjg3OTE0NjE3Mjk5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6c36add75d2c7caa39d2847b4b7db682cdfe1e9298630ce480b1c576a517d4f8
hovercard-subject-tagpull_request:5157563906
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/3815/files
twitter:imagehttps://avatars.githubusercontent.com/u/265310764?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/265310764?s=400&v=4
og:image:altfix(shared): stop concurrent int/string request ids from colliding in _in_flight Fixes #3807 Summary JSONRPCDispatcher._in_flight keyed inbound requests by coerce_request_id(req.id), which folds &...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None93edd3bebc4afb7ce711ee74cb5d2a95927850b082a4d43e212222389cb1c415
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1fee81a280ea86312b69448e261b418189bfd5b5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3815%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F3815%2Ffiles
Sign uphttps://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
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues308 (308)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
1828703450qqcom-uxhttps://github.com/1828703450qqcom-ux
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
1828703450qqcom-ux:fix/in-flight-id-type-collisionhttps://github.com/1828703450qqcom-ux/python-sdk/tree/fix/in-flight-id-type-collision
Conversation 1 https://github.com/modelcontextprotocol/python-sdk/pull/3815
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/3815/commits
Checks 30 https://github.com/modelcontextprotocol/python-sdk/pull/3815/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/3815/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
fix(shared): stop concurrent int/string request ids from colliding in _in_flight https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/3815/files
8a2f8ec fix(shared): stop concurrent int/string request ids from colliding in… 1828703450qqcom-ux Nov 4, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/3815/commits/8a2f8ecbf951699431f51275974967feb478805e
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/3815/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
jsonrpc_dispatcher.py https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
test_jsonrpc_dispatcher.py https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-ce6a750fbce4c4bfa60b1845cdd92c08be0c2ed1fdcecdcb2a2efa24170efabd
src/mcp/shared/jsonrpc_dispatcher.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
View file https://github.com/1828703450qqcom-ux/python-sdk/blob/8a2f8ecbf951699431f51275974967feb478805e/src/mcp/shared/jsonrpc_dispatcher.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3815/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-3d8fb73fa8b126691302c15bb63bbc44a3a0e9338a17f14b3b4ea1d97bb10c2c
tests/shared/test_jsonrpc_dispatcher.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-ce6a750fbce4c4bfa60b1845cdd92c08be0c2ed1fdcecdcb2a2efa24170efabd
View file https://github.com/1828703450qqcom-ux/python-sdk/blob/8a2f8ecbf951699431f51275974967feb478805e/tests/shared/test_jsonrpc_dispatcher.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/3815/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-ce6a750fbce4c4bfa60b1845cdd92c08be0c2ed1fdcecdcb2a2efa24170efabd
https://github.com/modelcontextprotocol/python-sdk/pull/3815/files#diff-ce6a750fbce4c4bfa60b1845cdd92c08be0c2ed1fdcecdcb2a2efa24170efabd
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/3815/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.