Skip to content

feat(agent): add retry warning suppression config - #24387

Closed
BlackishGreen33 wants to merge 2 commits into
NousResearch:mainfrom
BlackishGreen33:bg/feat-agent-suppress-retry-warnings
Closed

feat(agent): add retry warning suppression config#24387
BlackishGreen33 wants to merge 2 commits into
NousResearch:mainfrom
BlackishGreen33:bg/feat-agent-suppress-retry-warnings

Conversation

@BlackishGreen33

Copy link
Copy Markdown
Contributor

Fixes #24083

Summary

  • Add agent.suppress_retry_warnings, defaulting to false so existing behavior is unchanged.
  • When enabled, suppress transient API retry status noise during retry attempts.
  • Keep log warnings, fallback behavior, compression handling, and final failure messages unchanged.

Testing

  • python -m py_compile run_agent.py hermes_cli/config.py
  • python -m pytest tests/run_agent/test_api_max_retries_config.py -q
  • python -m pytest tests/cli/test_fast_command.py -q
  • python -m pytest tests/ -q was attempted; it failed on the current local environment with missing optional packages (acp, fastapi, numpy) and existing gateway/platform environment failures. The focused tests above passed.

Copilot AI review requested due to automatic review settings May 12, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new agent.suppress_retry_warnings configuration option to reduce user-visible retry noise during transient API failures while keeping logging and final failure behavior intact.

Changes:

  • Introduces agent.suppress_retry_warnings (default false) in the default config.
  • Parses and stores the suppression flag on AIAgent and uses it to gate retry-related output.
  • Adds tests covering default behavior, config overrides, and _emit_retry_status suppression.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
run_agent.py Adds suppression flag parsing + _emit_retry_status, and gates retry warning/status emissions.
hermes_cli/config.py Adds default config key and bumps _config_version.
tests/run_agent/test_api_max_retries_config.py Extends existing config-surface tests to cover suppress_retry_warnings and retry status emission.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread run_agent.py Outdated
Comment on lines +2045 to +2051
_raw_suppress_retry_warnings = _agent_section.get(
"suppress_retry_warnings", False
)
self._suppress_retry_warnings = (
str(_raw_suppress_retry_warnings).strip().lower()
in {"1", "true", "yes", "on"}
)
Comment thread run_agent.py
Comment on lines +2853 to +2854
"""Emit retry status unless the user opted out of retry noise."""
if getattr(self, "_suppress_retry_warnings", False):
Comment thread hermes_cli/config.py
Comment on lines +469 to +470
# Suppress non-critical terminal noise for transient API retry attempts.
# Logs and final failures are still emitted.
Comment thread hermes_cli/config.py
"backup_keep": 5,
},

# Config schema version - bump this when adding new required fields
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard labels May 12, 2026
…s-retry-warnings

# Conflicts:
#	run_agent.py
@teknium1

Copy link
Copy Markdown
Contributor

Automated hermes-sweeper review: this has been implemented on current main by the retry/fallback status buffering work. Main does not add the exact agent.suppress_retry_warnings key, but it addresses the PR’s stated user-facing problem more broadly: transient retry chatter is no longer printed during successful recovery, logs are still preserved, and terminal failures still show the buffered trace.

Evidence:

  • run_agent.py:828 documents the buffered retry/fallback status contract: retry chains are captured, flushed only on terminal failure, silently dropped on success, and backend logs remain unaffected.
  • agent/conversation_loop.py:2383 buffers the ⚠️ API call failed, provider/model, endpoint, and error lines that this PR targeted.
  • agent/conversation_loop.py:3230 buffers the ⏳ Retrying in ... status line, while agent/conversation_loop.py:3231 still logs the retry via logger.warning(...).
  • agent/conversation_loop.py:4103 clears buffered retry status once successful assistant content is reached, so recovered transient failures stay silent.
  • agent/conversation_loop.py:1234 flushes the buffered trace before the final terminal failure message, preserving critical failure visibility.
  • The implementation landed in 67011cc0d76b7047320b2760e948b4e4488c24ca (feat(agent): buffer retry/fallback status, surface only on terminal failure (#33816)) and is included in v2026.5.28.

Thanks for the focused PR and for linking it to #24083; that issue’s concrete retry-noise report lines up with the behavior now present on main.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add config option to suppress API retry warnings in terminal

4 participants