Skip to content

bug: NameError '_pool_may_recover_from_rate_limit' in conversation_loop.py on rate limit (v0.14.0) #27465

@junwookimdiw

Description

@junwookimdiw

Description

After upgrading to v0.14.0, Hermes crashes with a NameError when a 429 rate limit error is encountered from a provider.

Error

Error: name '_pool_may_recover_from_rate_limit' is not defined

Root Cause

agent/conversation_loop.py imports run_agent as a module at line 81:

import run_agent

But at line 2254, _pool_may_recover_from_rate_limit is called without the module prefix:

pool_may_recover = _pool_may_recover_from_rate_limit(
    agent._credential_pool,
    provider=agent.provider,
    base_url=getattr(agent, "base_url", None),
)

This causes a NameError because the function is defined in run_agent.py, not in scope of conversation_loop.py.

Fix

pool_may_recover = run_agent._pool_may_recover_from_rate_limit(
    agent._credential_pool,
    provider=agent.provider,
    base_url=getattr(agent, "base_url", None),
)

Steps to Reproduce

  1. Configure a provider that hits a 429 rate limit (e.g. ollama-cloud weekly quota exhaustion)
  2. Trigger a conversation — Hermes fails with NameError instead of falling back to the next provider

Environment

  • Hermes v0.14.0 (2026.5.16)
  • Python 3.11.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt buildertype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions