feat(agent): add retry warning suppression config - #24387
feat(agent): add retry warning suppression config#24387BlackishGreen33 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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(defaultfalse) in the default config. - Parses and stores the suppression flag on
AIAgentand uses it to gate retry-related output. - Adds tests covering default behavior, config overrides, and
_emit_retry_statussuppression.
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.
| _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"} | ||
| ) |
| """Emit retry status unless the user opted out of retry noise.""" | ||
| if getattr(self, "_suppress_retry_warnings", False): |
| # Suppress non-critical terminal noise for transient API retry attempts. | ||
| # Logs and final failures are still emitted. |
| "backup_keep": 5, | ||
| }, | ||
|
|
||
| # Config schema version - bump this when adding new required fields |
…s-retry-warnings # Conflicts: # run_agent.py
|
Automated hermes-sweeper review: this has been implemented on current main by the retry/fallback status buffering work. Main does not add the exact Evidence:
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. |
Fixes #24083
Summary
agent.suppress_retry_warnings, defaulting tofalseso existing behavior is unchanged.Testing
python -m py_compile run_agent.py hermes_cli/config.pypython -m pytest tests/run_agent/test_api_max_retries_config.py -qpython -m pytest tests/cli/test_fast_command.py -qpython -m pytest tests/ -qwas 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.