Repository navigation
fix(controller): await non-coroutine local worker results - #667
Closed
Elon-Jiang (Elon-Jiang) wants to merge 1 commit into
Closed
Elon-Jiang (Elon-Jiang) wants to merge 1 commit into
Elon-Jiang (Elon-Jiang) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change supporting non-coroutine awaitables in local workers.
No open issues 🎉
What changed in this PR
Fixes #666 by allowing local controller workers to complete non-coroutine awaitables on Python 3.12 while preserving synchronous and ordinary coroutine behavior.
Changes:
- Wraps awaitable results in a coroutine before passing them to
asyncio.run. - Adds regression coverage for synchronous, coroutine, and custom awaitable results.
- Documents that workers await results before reporting successful completion.
| File | Description |
|---|---|
tests/controller/test_local_worker_results.py |
Tests completion using real importable agents for all three result types. |
docs/30-controller-configuration.md |
Clarifies local worker completion semantics. |
agentlightning/controller/local_reconciler.py |
Adds a coroutine wrapper to support non-coroutine awaitables. |
Review effort: Balanced
Contributor
|
It is too defensive. In practice, we do not encounter such error. |
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.
A local agent returning a valid non-coroutine awaitable currently exits as failed on Python 3.12:
inspect.isawaitableaccepts the result, butasyncio.runrejects it before it runs. Await the result inside a coroutine wrapper, preserving existing synchronous and ordinary coroutine behavior. Add three real importable agent regressions and document the completion semantics.Fixes #666.
Validation on Python 3.12.13 with frozen development and
verl-cpudependencies:uv run --locked --no-sync pytest -v --durations=20 tests: 159 passed, 3 warnings, no skipped tests.uv run --locked --no-sync pyright: 0 errors.uv build --no-sourcessdist/wheel: passed.No browser, model inference, GPU training or cluster was used. AI assistance: Codex helped investigate, implement and validate this fix.