-
Notifications
You must be signed in to change notification settings - Fork 78
fix(agentwire): fix infinite loop when no agents enabled #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheButlah
wants to merge
1
commit into
main
Choose a base branch
from
thebutlah/agentwire-fix-infinite-loop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
85b19f3
to
21e6d16
Compare
TheButlah
commented
Jun 26, 2025
let mut no_agents = NoAgents::new(); | ||
let mut run_fut = no_agents.run(&mut plan); | ||
// poll should always immediately return, instead of looping forever. | ||
assert!(run_fut.poll_unpin(&mut cx).is_pending()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prior to this PR, the code would have blocked infinitely here.
b16aa30
to
32f4ab5
Compare
d277b59
to
1536046
Compare
e9e0c89
to
4577f08
Compare
4577f08
to
cb8984c
Compare
tonalove23
approved these changes
Jul 22, 2025
cb8984c
to
5067742
Compare
@valff I would like to merge this pr soon, or at least get it reviewed. |
ee2cbc8
to
f350f93
Compare
f350f93
to
76d60ca
Compare
76d60ca
to
65f9ab0
Compare
@valff could it be the reason for freezes of orb-core on diamond that we saw recently? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ai:none/search
For PRs that make no use of AI (or only use it as a search engine)
blocked:reviewer
PR is waiting for the reviewer
difficulty:nontrivial
This PR is not trivial, and requires more detailed review
tested:yes
This PR was tested
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.
Prior to this PR, code like the following would exhibit incorrect blocking-in-async behavior, if no agents were enabled.
This would happen because if no agents are enabled, the macro-generated
poll()
function for the future returned byBroker::run()
would infinitely loop without ever returning. Now instead, it detects if no agents are enabled and returns Poll::pending, which ensurespoll()
is always non-blocking.I've fixed the offending code and added a test case for it.
NOTE: This PR is only a partial fix. There is still an unhandled edge case, where a user defined poll_extra can cause the same infinite-blocking behavior:
However, this is not a regression - this also happens prior to this PR. Fixing this would be desirable, but even the partial fix in this PR is useful - therefore I would like to land this PR first and deal with that additional edge case later.