fix: emit status notification on credential pool rotation#10718
Open
nightq wants to merge 1 commit into
Open
Conversation
Fixes NousResearch#10476 Root cause: When credential pool exhaustion caused a provider switch, no notification was sent to the user. This was inconsistent with the fallback_model behavior which correctly notifies via _emit_status(). Fix: Add _emit_status() calls in _recover_with_credential_pool() when: - Billing exhaustion (402) causes rotation - Rate limit (429) causes rotation after retry - Auth failure (401) causes rotation after refresh fails Also fixed _emit_status() to use getattr() for status_callback to handle test agents that don't have this attribute set.
This was referenced Apr 25, 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.
Summary
Fixes inconsistent notification behavior when credential pool rotation causes a provider switch.
Root Cause
When
fallback_modeltriggers a provider switch, Hermes correctly notifies the user via_emit_status(). However, when credential pool exhaustion causes the same provider switch, no notification was sent. The user had no idea they were talking to a different AI.Fix
Add
_emit_status()calls in_recover_with_credential_pool()when credentials are rotated:Also fixed
_emit_status()to usegetattr()forstatus_callbackto handle edge cases where the attribute doesn't exist (e.g., in test agents).Test Plan
Closes #10476