Skip to content

fix(agent): resolve NameError in conversation_loop rate-limit path#27686

Closed
KUYE-OLG wants to merge 1 commit into
NousResearch:mainfrom
KUYE-OLG:fix/nameerror-pool-may-recover-rate-limit
Closed

fix(agent): resolve NameError in conversation_loop rate-limit path#27686
KUYE-OLG wants to merge 1 commit into
NousResearch:mainfrom
KUYE-OLG:fix/nameerror-pool-may-recover-rate-limit

Conversation

@KUYE-OLG

Copy link
Copy Markdown

_pool_may_recover_from_rate_limit is defined in run_agent.py but called as a bare name in agent/conversation_loop.py, causing a NameError when the eager rate-limit fallback path triggers.

Route through _ra() lazyloader so the function resolves correctly, matching the pattern used by handle_function_call, _set_interrupt, and other run_agent symbols referenced from this module.

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

_pool_may_recover_from_rate_limit is defined in run_agent.py but called
as a bare name in agent/conversation_loop.py, causing a NameError when
the eager rate-limit fallback path triggers.

Route through _ra() lazyloader so the function resolves correctly,
matching the pattern used by handle_function_call, _set_interrupt,
and other run_agent symbols referenced from this module.
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent loop, run_agent.py, prompt builder labels May 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #27359 (earliest open fix PR). Same one-line fix: route _pool_may_recover_from_rate_limit through _ra() lazy-loader. Also duplicates #27374, #27433, #27532. Root bug: #27370.

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing as fixed-on-main

Thanks for the patch — appreciated! Closing as redundant: the same one-line _ra()._pool_may_recover_from_rate_limit(...) wrap landed via PR #28345 (salvage of @AceWattGit's PR #28159), merged 2026-05-19, before this PR could be reviewed. Same code change, just a different cherry-pick.

Several contributors converged on the same fix here (#27370, #27465, #27468, #27583, #27686, #27732, #27734, #27735, #27750, #27891, #27903, #28304) — your diagnosis was correct in every case. Sorry for the duplicate-work cleanup; the volume of independent reports made it hard to coordinate.

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

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants