fix(agent): suppress intermediate retry status messages in chat thread - #18064
Closed
shagghiesuperstar wants to merge 3 commits into
Closed
fix(agent): suppress intermediate retry status messages in chat thread#18064shagghiesuperstar wants to merge 3 commits into
shagghiesuperstar wants to merge 3 commits into
Conversation
…ry exists When list_authenticated_providers() processes section 1, the native `openai` provider (8 models from _PROVIDER_MODELS) now checks if a custom provider already claims the same base_url (https://api.openai.com/v1). If so, the built-in entry is skipped, preventing duplicate OpenAI buttons in the /model picker. Fixes: user-defined OpenAI (18 models) and built-in openai (8 models) both pointing at api.openai.com/v1 were appearing as separate buttons.
When a streaming request to the LLM provider fails mid-stream (e.g. ReadTimeout, ConnectionError, RemoteProtocolError), Hermes retries with a fresh connection. Each retry emits a status message that accumulates permanently in the chat thread via _emit_status(). For self-hosted providers with frequent transient errors (backend restarts, rate limits, OOM recovery), these warnings accumulate and don't reflect the final outcome. Fix: Replace _emit_status() with logger.info() for intermediate retry messages. Only the final outcome (success or failure) is emitted to the user. Intermediate attempts go to logger.info and stay in logs. See: NousResearch#5151
3 tasks
Contributor
|
This looks implemented on current Evidence:
Fixed in |
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.
Problem
When a streaming request to the LLM provider fails mid-stream (e.g.
ReadTimeout,ConnectionError,RemoteProtocolError), Hermes retries with a fresh connection. Each retry emits a status message that accumulates permanently in the chat thread:On self-hosted providers with frequent transient errors (backend restarts, rate limits, OOM recovery), these warnings accumulate and don't reflect the final outcome.
Root Cause
Source:
run_agent.py— the retry loop calls_emit_status()for intermediate retry messages._emit_status()sends directly to the platform adapter, which posts a new message (not an update to an existing message).Fix
Replace
_emit_status()withlogger.info()for intermediate retry messages. Only the final outcome (success via "Reconnected — resuming…" or failure via "Connection to provider failed after N attempts") is emitted to the user. Intermediate attempts go tologger.infoand stay in logs.Changes
run_agent.py: Replace_emit_status()withlogger.info()for both the standard retry path (line ~6591) and the mid-tool-call retry path (line ~6525).References
Impact
agent.log