fix(conversation_loop): _ra()._pool_may_recover_from_rate_limit (NameError) (#28159)#28345
Merged
Conversation
…mespace The conversation_loop.py references _pool_may_recover_from_rate_limit which was defined in run_agent.py. After the conversation-loop extraction refactor, the helper was no longer in the same module scope. Wrap the call as _ra()._pool_may_recover_from_rate_limit() to route through the run_agent monkeypatch namespace where the helper is available. Adds regression test in test_gemini_fast_fallback.py. Fixes: MAILROOM Email Triage NameError, OPS Execution Monitor NameError.
This was referenced May 19, 2026
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-reference |
1 |
First entries
agent/conversation_loop.py:2335: [unresolved-reference] unresolved-reference: Name `_pool_may_recover_from_rate_limit` used when not defined
Unchanged: 4626 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
This was referenced May 19, 2026
Closed
Closed
This was referenced May 20, 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.
Salvage of #28159 by @AceWattGit. Supersedes #28189, #28254, #28268 (all already-closed 1-line duplicates).
What:
agent/conversation_loop.pyline ~2335 called_pool_may_recover_from_rate_limit(...)bare, but the symbol was never imported in the file (it lives inrun_agentand the rest of the module accesses it via the_ra()lazy loader). Any rate-limit fallback path hitNameError: name '_pool_may_recover_from_rate_limit' is not defined.How: Route the call through
_ra()._pool_may_recover_from_rate_limit(...)like every other run_agent symbol in this module, plus an inspect-based regression test that asserts the call site uses the namespace form (and that tests/monkeypatches onrun_agentpropagate correctly into the extracted loop).Original PR: #28159