NameError for _pool_may_recover_from_rate_limit in conversation_loop

NousResearch/hermes-agent · cluster 27370 · agent

Data as of

Nothing open on GitHub. Fix merged in #28345. Check it covers your case.

The short answer

0open issues
0open PRs
18items grouped
Known?
Yes. 18 related items grouped here, 9 issues already closed.
Fix event
A fix was merged to main in PR #28345. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this unresolved. That is separate from the fix event.
Still open
Nothing open on GitHub.

Nearly all members concern a NameError caused by a missing _ra() prefix or import for _pool_may_recover_from_rate_limit in conversation_loop.py, which breaks rate-limit fallback behavior. One member proposes replacing the _ra() lazy-import pattern with explicit dependency injection.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

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

    merged to main

    files: agent/conversation_loop.py, tests/agent/test_gemini_fast_fallback.py

    Show the diff
    • agent/conversation_loop.py
      @@ -2332,7 +2332,7 @@ def _stop_spinner():
                           # still recover.  See _pool_may_recover_from_rate_limit
                           # for the single-credential-pool and CloudCode-quota
                           # exceptions.  Fixes #11314 and #13636.
      -                    pool_may_recover = _pool_may_recover_from_rate_limit(
      +                    pool_may_recover = _ra()._pool_may_recover_from_rate_limit(
                               agent._credential_pool,
                               provider=agent.provider,
                               base_url=getattr(agent, "base_url", None),
    • tests/agent/test_gemini_fast_fallback.py
      @@ -5,8 +5,10 @@
       Gemini OAuth) the 429 is an account-wide throttle, so waiting for pool
       rotation is pointless — prefer fallback immediately.
       """
      +import inspect
       from unittest.mock import MagicMock
       
      +from agent import conversation_loop
       from run_agent import _pool_may_recover_from_rate_limit
       
       
      @@ -60,3 +62,17 @@ def test_exhausted_pool_skips_rotation():
       
       def test_no_pool_skips_rotation():
           assert _pool_may_recover_from_rate_limit(None) is False
      +
      +
      +def test_conversation_loop_resolves_pool_helper_through_run_agent_module():
      +    """Extracted conversation loop must honor tests/patches on run_agent.
      +
      +    conversation_loop intentionally lazy-loads run_agent via _ra().  If this
      +    call site uses a bare imported helper, monkeypatching run_agent in tests (and
      +    production wrappers that patch run_agent) will not propagate into the
      +    extracted loop; older code also hit NameError in this branch.
      +    """
      +    source = inspect.getsource(conversation_loop.run_conversation)
      +
      +    assert "_ra()._pool_may_recover_from_rate_limit(" in source
      +    assert "pool_may_recover = _pool_may_recover_from_rate_limit(" not in source

8 PRs closed without merging

From the close comments: done elsewhere 6 · closed without comment 1 · duplicate 1

  • #27359 fix(agent): resolve NameError in rate-limit fallback decision · done elsewhere → #27374, #27370
  • #27374 fix(agent): wrap _pool_may_recover_from_rate_limit with _ra() lazy import · done elsewhere → #28345, #28159, #27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304
  • #27468 fix(conversation_loop): NameError on rate limit — route _pool_may_recover_from_rate_limit through _ra() (#27465) · done elsewhere → #28345, #28159, #27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304
  • #27583 fix: prefix _pool_may_recover_from_rate_limit with module name · done elsewhere → #28345, #28159, #27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304
  • #27608 fix(conversation_loop): NameError on rate-limit — _pool_may_recover_from_rate_limit not in scope · duplicate → #27370
Show 3 more
  • #27732 fix(agent): import _pool_may_recover_from_rate_limit in conversation_loop (#27719) · done elsewhere → #28345, #28159, #27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304
  • #27750 fix(agent): add missing _ra() prefix to pool recovery call · done elsewhere → #28345, #28159, #27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304
  • #29210 fix(agent): add _ra() prefix to _pool_may_recover_from_rate_limit call · closed without comment
Closed issues · 9
  • Closed#27370[Bug] NameError: '_pool_may_recover_from_rate_limit' is not defined in conversation_loop.py
  • Closed#27402NameError: '_pool_may_recover_from_rate_limit' is not defined in conversation_loop.py
  • Closed#27465bug: NameError '_pool_may_recover_from_rate_limit' in conversation_loop.py on rate limit (v0.14.0)
  • Closed#27719[Bug]: Fallback fails with NameError when primary provider (DeepSeek) runs out of tokens
  • Closed#28389NameError: _pool_may_recover_from_rate_limit not imported into extracted agent/conversation_loop.py
  • Closed#28773`NameError: _pool_may_recover_from_rate_limit` in `agent/conversation_loop.py:2335` — fallback chain never activates on HTTP 429
  • Closed#29202NameError: _pool_may_recover_from_rate_limit is not defined — missing _ra() prefix in conversation_loop.py
  • Closed#29621[Bug]: After main model 429, switch to fallback model and report an error.
  • Closed#30350NameError: _pool_may_recover_from_rate_limit not defined in conversation_loop.py
How this cluster was grouped
  • Link evidence (partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
  • Members outside that structural core may belong to a different underlying problem.
  • Pairwise link density 0.16: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
agent
Merged PRs
#28345
Closed issues
9
Attempts
8 PRs closed without merging
Fix link checked
19 May 2026

For your agent

The same facts, typed.