Repository navigation
Conversation
Preserve Task return and error-handler contracts, caller Task names, cancellation adoption and reentrant shutdown safety through explicit same-supervisor adoption edges.
Add tests for observer awaitables to ensure proper JSON-RPC delivery and error handling.
Add tests for TaskSupervisor and Connection closure behavior.
frostming
requested changes
Nov 25, 2026
frostming
left a comment
Contributor
There was a problem hiding this comment.
This is too complex IMO. Wrapping non-coroutine awaitables with _await_result is enough to fix the TypeError; please drop the adoption map and _awaits_task, and keep a single test for a Future-returning observer.
Contributor
Author
|
Thanks, narrowed this to _await_result for non-coroutine Awaitables and one Future-returning observer test. Removed the adoption map, _awaits_task and the extra shutdown tests. The regression fails with the original TypeError on the base and passes with the change. Full tests and make check pass, and the description now reflects the narrower scope. |
frostming
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Accept non-coroutine Awaitable results from stream observers without raising TypeError during notification delivery.
TaskSupervisor.create accepts Awaitable values but passes them directly to asyncio.create_task, which requires a coroutine on the supported Python versions. Keep native coroutines scheduled directly and wrap other Awaitables with the small _await_result coroutine. The supervised result remains a Task.
This revision follows the review request to keep the fix narrow. It removes the adoption map, dependency traversal and additional shutdown behavior from the earlier version. It adds no cancellation-ownership, cancellation-before-start, foreign-loop validation or dependency-cycle guarantees. Existing shutdown behavior is unchanged.
Regression test
One Future-returning outgoing observer test checks that notification delivery succeeds and the peer receives the message. The same test fails on the original base with TypeError because the observer returns a pending Future. No production-incident claim is made.
Validation
The skips are the optional Gemini check and, on Python 3.10, the existing eager-task-factory test requiring Python 3.12+. Existing codegen/deprecation warnings remain. The first formatting check reformatted one line; the final check passed.
No schema regeneration, dependency change or public-signature change.