René's URL Explorer Experiment


Title: fix: supervise non-coroutine observer Awaitables safely by anishpentyala · Pull Request #194 · agentclientprotocol/python-sdk · GitHub

Open Graph Title: fix: supervise non-coroutine observer Awaitables safely by anishpentyala · Pull Request #194 · agentclientprotocol/python-sdk

X Title: fix: supervise non-coroutine observer Awaitables safely by anishpentyala · Pull Request #194 · agentclientprotocol/python-sdk

Description: Summary Accept the Awaitable results already allowed by stream observers without breaking JSON-RPC delivery. Connection accepts observer callbacks returning Awaitable[None], but TaskSupervisor.create() passes their results straight to asyncio.create_task(). Future, Task and custom Awaitable results raise TypeError on the supported Python versions. An outgoing notification has already been sent when that error escapes; an incoming observation can stop delivery before the handler runs. Keep native coroutines scheduled directly. Wrap other Awaitables in supervised Tasks so the Task return and error-handler types stay unchanged, caller Task names stay unchanged, and each registration has its own callback. Future/Task inputs adopt shutdown cancellation, including before the adapter starts. Reject foreign-loop Futures and non-awaitables before registration. Build on #191: shutdown also excludes adapters explicitly awaiting its caller, transitively within this supervisor. Otherwise cancelling an adapter cancels the caller back and recreates the cancellation cycle. Other owned tasks still cancel and drain normally. Completion clears the adoption map. Related issues No matching report or competing fix found in bounded current issue/PR checks. This was found through source inspection and local reproduction, not a claimed production incident. #191 is already merged and remains a prerequisite, not part of this contribution's result. Testing Base: 6e9f70666c52fe39a950fdd7353c47a07b956af6. Published head: f078a3dc17c97ccf78a263221c085a7567a0a6b2 (four preserved commits). Its net tree exactly matches the independently qualified candidate. A fresh full run at that public head also passed 584 tests with 1 skip on Python 3.13.17. Clean base, Python 3.13.17: 540 passed, 1 skipped. Original 34 new controls against base: 24 failed, 10 passed. Failures include 16 assertions and 8 direct coroutine-type errors. Naive Awaitable port without adapter-aware shutdown: all 10 bounded reentrant controls fail in independent reproduction; all 10 pass with this change. Cases cover started/unstarted adapters, duplicate registrations, nested adapters and a Task observer closing its own connection through the memory transport. Candidate full suite: Python 3.10.12, 583 passed and 2 skipped; Python 3.13.17 and 3.14.9, 584 passed and 1 skipped each. Skips are optional Gemini and, on 3.10, the existing eager-factory test requiring 3.12+. make check: passed with locked tooling, including lint, formatting, types, lockfile and dependency checks. Fresh installed wheel outside the checkout on Python 3.14.9: 44 targeted controls passed, with import origin and package bytes checked against the wheel. Independent automated qualification reproduced the exact source/wheel identity, full suites, negatives, installed tests and static checks. Extra mass-adoption, map-cleanup, chain and diamond probes passed. Docs & boundaries The public supervisor docstring documents cancellation adoption and per-registration Tasks. No schema, dependency, transport or public-signature change. Passing a shared Future or Task transfers cancellation ownership: shutting down one supervisor can cancel that shared input. An already-failed Future cancelled before its adapter starts has its exception consumed to prevent an unretrieved warning, rather than routed to normal error handlers. A custom Awaitable can hide dependencies that cannot be cancelled before it starts. Shutdown follows only explicit Future/Task adoption edges recorded by this supervisor, not arbitrary hidden or cross-supervisor dependency graphs. User-created mutual-await cycles can still recurse if externally cancelled. This is not a general asyncio cycle detector. Observer-specific eager/custom task factories and Python 3.15 are not qualified here. The integration tests use synthetic memory transports, not a production workload. Checklist Conventional Commit title. Regression tests and existing-behavior controls. Supervisor docstring updated for ownership behavior. No schema regeneration.

Open Graph Description: Summary Accept the Awaitable results already allowed by stream observers without breaking JSON-RPC delivery. Connection accepts observer callbacks returning Awaitable[None], but TaskSupervisor.crea...

X Description: Summary Accept the Awaitable results already allowed by stream observers without breaking JSON-RPC delivery. Connection accepts observer callbacks returning Awaitable[None], but TaskSupervisor.crea...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

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:c8530469-39f7-7710-9ff7-3bfa0b702e14
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB084:A12D8:13BB3D:1B40A2:6B04650F
html-safe-nonce4479e5d990acd52d5e9b648fa9092a227e2ac353a2a83ba026c14062c52fa05f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDg0OkExMkQ4OjEzQkIzRDoxQjQwQTI6NkIwNDY1MEYiLCJ2aXNpdG9yX2lkIjoiMTE0MTk3MjUzMDk1ODE5ODAzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6e439834ac8ccd3c50fca39cb1cb5503832ff2ba14fc14456c911ef35172672a
hovercard-subject-tagpull_request:5243127532
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/194/files
twitter:imagehttps://avatars.githubusercontent.com/u/96276529?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/96276529?s=400&v=4
og:image:altSummary Accept the Awaitable results already allowed by stream observers without breaking JSON-RPC delivery. Connection accepts observer callbacks returning Awaitable[None], but TaskSupervisor.crea...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
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
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/agentclientprotocol/python-sdk/pull/194/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fagentclientprotocol%2Fpython-sdk%2Fpull%2F194%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%2F194%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/194/files
Reloadhttps://github.com/agentclientprotocol/python-sdk/pull/194/files
Reloadhttps://github.com/agentclientprotocol/python-sdk/pull/194/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
anishpentyalahttps://github.com/anishpentyala
agentclientprotocol:mainhttps://github.com/agentclientprotocol/python-sdk/tree/main
anishpentyala:fix/observer-awaitable-adaptershttps://github.com/anishpentyala/python-sdk/tree/fix/observer-awaitable-adapters
Conversation 0 https://github.com/agentclientprotocol/python-sdk/pull/194
Commits 4 https://github.com/agentclientprotocol/python-sdk/pull/194/commits
Checks 8 https://github.com/agentclientprotocol/python-sdk/pull/194/checks
Files changed https://github.com/agentclientprotocol/python-sdk/pull/194/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/194/files
fix: supervise non-coroutine observer Awaitables safely https://github.com/agentclientprotocol/python-sdk/pull/194/files#top
Show all changes 4 commits https://github.com/agentclientprotocol/python-sdk/pull/194/files
7d5927f fix: supervise observer Awaitables with Task-compatible adapters anishpentyala Nov 10, 2026 https://github.com/agentclientprotocol/python-sdk/pull/194/commits/7d5927fbe2e2ded62ad926243923c89fe27ff937
d8e0b8e test: cover observer Awaitable delivery and cancellation anishpentyala Nov 10, 2026 https://github.com/agentclientprotocol/python-sdk/pull/194/commits/d8e0b8e547a0342494e9ad16d621ae9b26ab0b4c
167f5f4 test: verify Task adoption ownership and map cleanup anishpentyala Nov 10, 2026 https://github.com/agentclientprotocol/python-sdk/pull/194/commits/167f5f4c69163f7c9b8a1f5bf29bab2fafe91bd3
f078a3d test: bound reentrant adopted-Task shutdown regressions anishpentyala Nov 10, 2026 https://github.com/agentclientprotocol/python-sdk/pull/194/commits/f078a3dc17c97ccf78a263221c085a7567a0a6b2
Clear filters https://github.com/agentclientprotocol/python-sdk/pull/194/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/194/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/194/files
supervisor.py https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
test_observer_awaitables.py https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-39ba52568cfc2cc20349098298accbca46a97c3537ebd043b65158beb2f8453e
test_supervisor_loop_edges.py https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-2b158e1af1aaa39bab505d8b4673006d348b559778755d437b4a202232ee115f
test_supervisor_reentrant_adapters.py https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-1f975fb683a93a7be1a532f0dd24ed83aeb9e017e8c48dbce0379f9fcbb3354f
src/acp/task/supervisor.pyhttps://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
View file https://github.com/agentclientprotocol/python-sdk/blob/f078a3dc17c97ccf78a263221c085a7567a0a6b2/src/acp/task/supervisor.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/194/{{ revealButtonHref }}
https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
https://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-050bae2cd66c7dba59c42b7f500bff35a259423f3df7d9e8c9889c434c51742b
tests/test_observer_awaitables.pyhttps://github.com/agentclientprotocol/python-sdk/pull/194/files#diff-39ba52568cfc2cc20349098298accbca46a97c3537ebd043b65158beb2f8453e
View file https://github.com/agentclientprotocol/python-sdk/blob/f078a3dc17c97ccf78a263221c085a7567a0a6b2/tests/test_observer_awaitables.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/agentclientprotocol/python-sdk/pull/194/{{ revealButtonHref }}
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/194/files
Please reload this pagehttps://github.com/agentclientprotocol/python-sdk/pull/194/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.