René's URL Explorer Experiment


Title: fix(connection): support $/cancel_request request cancellation by monody0007 · Pull Request #158 · agentclientprotocol/python-sdk · GitHub

Open Graph Title: fix(connection): support $/cancel_request request cancellation by monody0007 · Pull Request #158 · agentclientprotocol/python-sdk

X Title: fix(connection): support $/cancel_request request cancellation by monody0007 · Pull Request #158 · agentclientprotocol/python-sdk

Description: Summary Adds ACP's optional $/cancel_request support to Connection. Currently the notification is logged as unhandled, and a handler that raises CancelledError can leave its peer waiting without a response. Incoming cancellation targets only the handler. A separate supervised task sends its result or a -32800 cancellation error, including when cancellation arrives before the handler starts or during response delivery. Unknown/completed IDs are ignored. Closing the connection cancels both tasks, fixing the blocked-send shutdown case for cancellation-cooperative handlers and transports. A cancellation only matches when requestId is present and is a valid RequestId (null, integer or string, per the vendored schema). Cancellations with missing params, no requestId, or a boolean/float/other requestId are ignored. Without this check they would hit a null-id request, or 1/0 through Python's True == 1 key aliasing. Requests whose own id is not a valid RequestId are not tracked for cancellation. Cancelling a pending outgoing request also sends a best-effort $/cancel_request without delaying local cancellation. This is a new wire behavior; peers may ignore the optional notification. Public handler signatures and session/cancel semantics stay unchanged. Testing Raw NDJSON, gated response delivery, SDK-to-SDK cancellation and experimental v2 coverage. Malformed-cancellation regressions (no params, null/list params, missing requestId, true/false vs pending 1/0, 1.0, list, "1" vs 1, pending true/1.0 ids vs 1), plus matching-id controls for null, 0, 1, "1". New cases fail or hang on unpatched main; unchanged-behavior controls pass. The malformed-cancellation cases fail on the previous PR head (9 of 11); the 2 wrong-type cases already ignored there pass, as do the 4 controls. Python 3.12, latest head: uv run --frozen python -m pytest -q --doctest-modules → 389 passed, 1 opt-in test skipped, 1 failed. The failure is tests/real_user/test_stdio_limits.py::test_run_agent_stdio_buffer_limit, a 2 s subprocess timeout that fails the same way on unpatched main on the same (heavily loaded) host. Earlier heads: Python 3.12 and 3.14 375 passed / 1 skipped, Python 3.11 374 passed / 2 skipped. ruff check, ruff format --check and ty check passed on the latest head. Python 3.10/3.13 and dedicated HTTP/WebSocket cancellation integration were not run. Docs & checklist Conventional title and regression tests Quickstart and experimental v2 docs updated No schema regeneration needed No UI change. No existing issue found for request-level cancellation. Implementation and independent review used AI assistance. Test results above are from local executions.

Open Graph Description: Summary Adds ACP's optional $/cancel_request support to Connection. Currently the notification is logged as unhandled, and a handler that raises CancelledError can leave its peer waiting withou...

X Description: Summary Adds ACP's optional $/cancel_request support to Connection. Currently the notification is logged as unhandled, and a handler that raises CancelledError can leave its peer waiting wi...

Opengraph URL: https://github.com/agentclientprotocol/python-sdk/pull/158

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

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:4d2142e2-8029-0b63-bfd4-783adbbff931
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB884:436BB:39B3AF:4F4E06:6B046CE1
html-safe-noncea99a9b1f5be2a38d93162d5289f52f928a0c25c4eef529a3d0514b6428087313
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODg0OjQzNkJCOjM5QjNBRjo0RjRFMDY6NkIwNDZDRTEiLCJ2aXNpdG9yX2lkIjoiNDAyNTA2MjQ2Mzc0MzIxMzc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb59da66628ceefd49e15871c340922af3b347152caaf4cda82dd266a5e11ba8d
hovercard-subject-tagpull_request:4667313875
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/agentclientprotocol/python-sdk/pull/158/files
twitter:imagehttps://avatars.githubusercontent.com/u/52037177?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/52037177?s=400&v=4
og:image:altSummary Adds ACP's optional $/cancel_request support to Connection. Currently the notification is logged as unhandled, and a handler that raises CancelledError can leave its peer waiting withou...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/agentclientprotocol/python-sdk git https://github.com/agentclientprotocol/python-sdk.git
octolytics-dimension-user_id235308037
octolytics-dimension-user_loginagentclientprotocol
octolytics-dimension-repository_id1051445009
octolytics-dimension-repository_nwoagentclientprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1051445009
octolytics-dimension-repository_network_root_nwoagentclientprotocol/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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/agentclientprotocol/python-sdk/pull/158/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fagentclientprotocol%2Fpython-sdk%2Fpull%2F158%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%2Fagentclientprotocol%2Fpython-sdk%2Fpull%2F158%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=agentclientprotocol%2Fpython-sdk
Reloadhttps://github.com/agentclientprotocol/python-sdk/pull/158/files
Reloadhttps://github.com/agentclientprotocol/python-sdk/pull/158/files
Reloadhttps://github.com/agentclientprotocol/python-sdk/pull/158/files
agentclientprotocolhttps://github.com/agentclientprotocol
python-sdkhttps://github.com/agentclientprotocol/python-sdk
Codehttps://github.com/agentclientprotocol/python-sdk
Issues4 (4)https://github.com/agentclientprotocol/python-sdk/issues
Pull requests12 (12)https://github.com/agentclientprotocol/python-sdk/pulls
Discussionshttps://github.com/agentclientprotocol/python-sdk/discussions
Actionshttps://github.com/agentclientprotocol/python-sdk/actions
Projectshttps://github.com/agentclientprotocol/python-sdk/projects
Security and qualityhttps://github.com/agentclientprotocol/python-sdk/security
Insightshttps://github.com/agentclientprotocol/python-sdk/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fagentclientprotocol%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=%2Fagentclientprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
frostminghttps://github.com/frostming
agentclientprotocol:mainhttps://github.com/agentclientprotocol/python-sdk/tree/main
monody0007:oss-pilot/acp-cancel-requesthttps://github.com/monody0007/python-sdk/tree/oss-pilot/acp-cancel-request
Conversation 0 https://github.com/agentclientprotocol/python-sdk/pull/158
Commits 3 https://github.com/agentclientprotocol/python-sdk/pull/158/commits
Checks 8 https://github.com/agentclientprotocol/python-sdk/pull/158/checks
Files changed https://github.com/agentclientprotocol/python-sdk/pull/158/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/158/files
fix(connection): support $/cancel_request request cancellation https://github.com/agentclientprotocol/python-sdk/pull/158/files#top
Show all changes 3 commits https://github.com/agentclientprotocol/python-sdk/pull/158/files
e74cbc6 fix(connection): honor $/cancel_request and reply -32800 to cancelled… monody0007 Sep 28, 2026 https://github.com/agentclientprotocol/python-sdk/pull/158/commits/e74cbc6904bcbec1ebf309ebe39770791c3161c6
e1abcac fix(connection): keep request responses out of the handler's cancella… monody0007 Sep 28, 2026 https://github.com/agentclientprotocol/python-sdk/pull/158/commits/e1abcac1345400d78463ae0b1ddf1002f3d7d1d3
e03a321 fix(connection): only cancel requests named by a valid requestId monody0007 Sep 29, 2026 https://github.com/agentclientprotocol/python-sdk/pull/158/commits/e03a3216106fde9f9386d1bde8fc57ac4d407a59
Clear filters https://github.com/agentclientprotocol/python-sdk/pull/158/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/158/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/158/files
experimental-v2.md https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-7059b6c9898273593cbe660cab9bb2a220171372c6c64f98a1d69f2629a0cfed
quickstart.md https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-988a5392cf907f7c5728b8ac90445facc7f835f3c00375764ec99769dcde2d5a
connection.py https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
exceptions.py https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-3598953bacc0c86a9e170259ad7197b954782b0e1a4cb5b10de926b3db6f420e
test_request_cancellation.py https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-cafdf2fbd73fcdeb917dccc2dbd1adfb4a565dec20357fa327711728fa126413
test_v2_runtime.py https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-77bc25a7572839665c9b93f84ade3e11aac05007dd53855aa12d9d691dc9cd47
docs/experimental-v2.mdhttps://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-7059b6c9898273593cbe660cab9bb2a220171372c6c64f98a1d69f2629a0cfed
View file https://github.com/monody0007/python-sdk/blob/e03a3216106fde9f9386d1bde8fc57ac4d407a59/docs/experimental-v2.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/158/{{ revealButtonHref }}
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-7059b6c9898273593cbe660cab9bb2a220171372c6c64f98a1d69f2629a0cfed
docs/quickstart.mdhttps://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-988a5392cf907f7c5728b8ac90445facc7f835f3c00375764ec99769dcde2d5a
View file https://github.com/monody0007/python-sdk/blob/e03a3216106fde9f9386d1bde8fc57ac4d407a59/docs/quickstart.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/158/{{ revealButtonHref }}
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-988a5392cf907f7c5728b8ac90445facc7f835f3c00375764ec99769dcde2d5a
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-988a5392cf907f7c5728b8ac90445facc7f835f3c00375764ec99769dcde2d5a
src/acp/connection.pyhttps://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
View file https://github.com/monody0007/python-sdk/blob/e03a3216106fde9f9386d1bde8fc57ac4d407a59/src/acp/connection.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/158/{{ revealButtonHref }}
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-6d278f025f554ad9befdec6b7bd0cf37e1a60b46d792bd5faad76b7afeab9321
src/acp/exceptions.pyhttps://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-3598953bacc0c86a9e170259ad7197b954782b0e1a4cb5b10de926b3db6f420e
View file https://github.com/monody0007/python-sdk/blob/e03a3216106fde9f9386d1bde8fc57ac4d407a59/src/acp/exceptions.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/158/{{ revealButtonHref }}
https://github.com/agentclientprotocol/python-sdk/pull/158/files#diff-3598953bacc0c86a9e170259ad7197b954782b0e1a4cb5b10de926b3db6f420e
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/158/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/158/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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.