fix(agent): resolve NameError in rate-limit fallback decision#27359
Closed
0xchainer wants to merge 5 commits into
Closed
fix(agent): resolve NameError in rate-limit fallback decision#273590xchainer wants to merge 5 commits into
0xchainer wants to merge 5 commits into
Conversation
This comment was marked as spam.
This comment was marked as spam.
This was referenced May 17, 2026
Closed
d931e82 to
e2de05f
Compare
test_startup_plugin_gating::test_builtin_set_covers_every_registered_subcommand checks that _BUILTIN_SUBCOMMANDS includes every live subcommand. The 'send' subcommand was recently added but not included in the set, causing a CI failure.
_pool_may_recover_from_rate_limit() is defined in run_agent.py but conversation_loop.py's run_conversation() called it as a bare name without importing it. After the run_agent.py refactor that extracted conversation_loop.py, this dependency was missed, causing a NameError at runtime when a rate-limited API call triggered the fallback logic. Fixed by routing through _ra() (the existing lazy-reference pattern used throughout conversation_loop.py for run_agent symbols), which resolves the function at call time via a deferred import. Fixes a regression introduced during the run_agent.py extraction.
7ea5ea2 to
8761657
Compare
This was referenced May 17, 2026
fix(fallback): NameError on 429 rate-limit — missing _pool_may_recover_from_rate_limit import
#27433
Closed
|
ddalggak review — CHANGES_REQUESTED / superseded conclusion. Blocking first: this duplicates the same Evidence checked:
Requested path:
|
8 tasks
…-undefined-pool-may-recover
This was referenced May 17, 2026
Closed
|
when this PR ready to production or available next update patch? |
This was referenced May 18, 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.
What does this PR do?
_pool_may_recover_from_rate_limit()is defined inrun_agent.pybutconversation_loop.py'srun_conversation()called it as a bare name without importing it. After therun_agent.pyrefactor that extractedconversation_loop.py, this dependency was missed, causing aNameErrorat runtime when a rate-limited API call triggered the fallback logic.Fixed by routing through
_ra()(the existing lazy-reference pattern used throughoutconversation_loop.pyforrun_agentsymbols), which resolves the function at call time via a deferred import.Fixes a regression introduced during the
run_agent.pyextraction.Related Issue
This is a regression from the recent
run_agent.pyrefactor that extractedconversation_loop.pyas a standalone module. Previously both the caller and callee lived in the same file, so no import was needed.Type of Change
Changes Made
agent/conversation_loop.py:2254— prefixed_pool_may_recover_from_rate_limit()call with_ra().to resolve the function via the existing lazy-import patternHow to Test
NameError: name '_pool_may_recover_from_rate_limit' is not definedfallback_modelChecklist
Code
Documentation & Housekeeping
Screenshots / Logs
N/A — runtime NameError, no visual change.