hermes - ✅(Solved) Fix [Bug]: Retry attempt counter incorrectly resets to 1/3 after attempt 2/3 [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #12967: fix(retry): prevent attempt counter reset after primary transport recovery

Description (problem / solution / changelog)

Problem

When _try_recover_primary_transport() succeeded, retry_count was reset to 0, causing the attempt counter to restart from (1/3) after already showing (1/3), (2/3):

⚠️ Retrying in 2.77s (attempt 1/3)...
⚠️ Retrying in 5.46s (attempt 2/3)...
⚠️ Retrying in 2.54s (attempt 1/3)...  ← resets!
⚠️ Retrying in 5.64s (attempt 2/3)...
⚠️ Max retries (3) exhausted — trying fallback...

Fix

Instead of resetting retry_count = 0, increment max_retries += 1. This grants the rebuilt client exactly one extra attempt while keeping the displayed counter monotonic:

⚠️ Retrying in 2.77s (attempt 1/3)...
⚠️ Retrying in 5.46s (attempt 2/3)...
⚠️ Retrying in 2.54s (attempt 3/3)...
⚠️ Retrying in 5.64s (attempt 4/4)...  ← recovery attempt
⚠️ Max retries (4) exhausted — trying fallback...

Fixes #12956

Changed files

  • run_agent.py (modified, +6/-1)

Code Example

Report     https://paste.rs/B8FTm
  agent.log  https://paste.rs/01yD0

---
RAW_BUFFERClick to expand / collapse

Bug Description

<img width="775" height="388" alt="Image" src="https://github.com/user-attachments/assets/cf6a20d2-83f5-4147-b299-7b0e2cc48aad" />

Steps to Reproduce

When LLM API keep return 503.

Expected Behavior

(attempt 1/3) (attempt 2/3) (attempt 3/3)

Actual Behavior

(attempt 1/3) (attempt 2/3) (attempt 1/3) (attempt 2/3)

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Debug Report

Report     https://paste.rs/B8FTm
  agent.log  https://paste.rs/01yD0

Operating System

WSL2/Ubuntu 24.04

Python Version

3.11.15

Hermes Version

v0.9.0 (2026.4.13)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue is likely related to the LLM API returning a 503 error, and a workaround may involve investigating the API's status or adjusting the retry mechanism.

Guidance

  • Investigate the LLM API's status to determine if it's experiencing downtime or maintenance, which could be causing the 503 errors.
  • Review the agent.log file (https://paste.rs/01yD0) to see if there are any error messages or patterns that could indicate the root cause of the issue.
  • Consider implementing a retry mechanism with exponential backoff to handle temporary API errors, if not already in place.
  • Check the Debug Report (https://paste.rs/B8FTm) for any relevant information that could aid in troubleshooting.

Example

No code snippet is provided as the issue lacks specific technical details.

Notes

The issue seems to be related to an external API (LLM API), and without more information about the API's status or the specific error messages, it's challenging to provide a definitive fix.

Recommendation

Apply workaround: Implement a retry mechanism with exponential backoff to handle temporary API errors, as this can help mitigate the issue until the root cause is determined.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING