Skip to content

fix(conversation_loop): _ra()._pool_may_recover_from_rate_limit (NameError) (#28159)#28345

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a
May 19, 2026
Merged

fix(conversation_loop): _ra()._pool_may_recover_from_rate_limit (NameError) (#28159)#28345
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #28159 by @AceWattGit. Supersedes #28189, #28254, #28268 (all already-closed 1-line duplicates).

What: agent/conversation_loop.py line ~2335 called _pool_may_recover_from_rate_limit(...) bare, but the symbol was never imported in the file (it lives in run_agent and the rest of the module accesses it via the _ra() lazy loader). Any rate-limit fallback path hit NameError: 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 on run_agent propagate correctly into the extracted loop).

Original PR: #28159

…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.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-3ad7d98a vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8790 on HEAD, 8791 on base (✅ -1)

🆕 New issues: none

✅ Fixed issues (1):

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants