fix(agent): wire _pool_may_recover_from_rate_limit through _ra() in extracted conversation_loop#28304
Closed
soynchux wants to merge 1 commit into
Closed
Conversation
…xtracted conversation_loop
Collaborator
This was referenced May 19, 2026
Collaborator
Closing as fixed-on-mainThanks for the patch — appreciated! Closing as redundant: the same one-line Several contributors converged on the same fix here (#27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304) — your diagnosis was correct in every case. Sorry for the duplicate-work cleanup; the volume of independent reports made it hard to coordinate. |
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.
What
Fixes a
NameErrorregression inagent/conversation_loop.py:2335. The extractedrun_conversationcalls_pool_may_recover_from_rate_limitas a bare name, but the helper lives inrun_agent.pyand was never imported. Any rate-limited (429/billing) turn with a configuredfallback_modelchain crashes.Introduced by commit
053025238(refactor(run_agent): extract run_conversation to agent/conversation_loop.py).Fix
Route the call through the existing
_ra()lazy reference (same pattern as_ra()._set_interrupt,_ra().handle_function_call). A top-levelfrom run_agent import ...would create a circular import.Test
tests/run_agent/test_provider_fallback.py— newTestRateLimitFallbackWiringFromConversationLoopclass:NameErrorat the exact buggy line.