Skip to content

[Bug]: CLI spams duplicate task name updates then loops 502 Provider errors after gateway restart with --replace on WSL (Windows) #1414

@StefanIsMe

Description

@StefanIsMe

Bug Description

There seems to be possibly multiple things going on. As far as I can tell, this is what was happening on my setup:

Hermes was actively working on a task when I manually stopped the gateway — I did this intentionally to switch models.

I switched to hunter-alpha on OpenRouter.

I restarted the gateway using hermes gateway run --replace.

The gateway appeared to automatically resume the previous task rather than starting fresh.

In the CLI, while the task progress was updating/reflecting, the display spammed between two different task name labels repeatedly (flickering between two states rather than updating smoothly).

Shortly after, the CLI began throwing the following error in a loop and would not recover:

text
📝 Provider message: {'message': 'Provider returned error', 'code': 502}
⏱️ Response time: 126.20s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️ Invalid API response (attempt 1/3): response.choices is None
🏢 Provider: Unknown
📝 Provider message: {'message': 'Provider returned error', 'code': 502}
⏱️ Response time: 126.00s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️ Invalid API response (attempt 2/3): response.choices is None
🏢 Provider: Unknown
📝 Provider message: {'message': 'Provider returned error', 'code': 502}
⏱️ Response time: 257.37s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...
┊ 📚 skill duckduckgo-search 1.2s
✹ ಠ_ಠ ruminating... (42.9s)
⚠️ Invalid API response (attempt 2/3): response.choices is None
🏢 Provider: Unknown
📝 Provider message: {'message': 'Provider returned error', 'code': 502}
⏱️ Response time: 257.03s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...

Steps to Reproduce

have hermes running on a task
stop gateway during the ongoing tasks hermes was working on
run hermes update
run hermes gateway run --replace
hermes will auto continue working on its tasks

Expected Behavior

no cli text spam and no errors from openrouter

Actual Behavior

Recording.2026-03-15.154640.mp4

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp), CLI (interactive chat)

Messaging Platform (if gateway-related)

Telegram

Operating System

Windows wsl

Python Version

Python 3.10.12

Hermes Version

Hermes Agent v0.2.0 (2026.3.12) Project: /home/stefanu/.hermes/hermes-agent Python: 3.11.14 OpenAI SDK: 2.26.0 Up to date

Relevant Logs / Traceback

stefanu@DESKTOP-2TQROQQ:~$ hermes gateway run --replace
┌─────────────────────────────────────────────────────────┐
│           ⚕ Hermes Gateway Starting...                 │
├─────────────────────────────────────────────────────────┤
│  Messaging platforms + cron scheduler                    │
│  Press Ctrl+C to stop                                   │
└─────────────────────────────────────────────────────────┘

  ⚡ 3/3 tools completed in 6.9s total
  ┊ 📖 read      ...s\competitor-discovery-prompt.md  2.2s [error]
  ┊ 📖 read      ...competitors\linkedin-accounts.md  2.2s [error]
  ┊ 📖 read      ...search\competitors\x-accounts.md  2.4s [error]
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 125.93s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
  ✦ ヽ(><☆)☆ computing... (90.0s)  ┊ 💬 First run — no existing database files. I'll build the competitor lists from scratch. Let me research both platforms.
  ┊ 🐍 exec      from hermes_tools import web_sea...  3.8s [error]
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 126.14s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 126.14s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
  ┊ 🐍 exec      import hermes_tools  4.0s
  ✧ (⌐■_■) cogitating... (18.6s)⚠️  Invalid API response (attempt 2/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 257.10s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...
  ⁺ (⌐■_■) cogitating... (54.8s)  ┊ 🧠 memory    ~memory: "D:\Hermes\withapu..."  0.0s [error]
  ┊ 🧠 memory    ~memory: "D:\Hermes\withapu..."  0.0s [error]
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 126.20s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 126.00s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️  Invalid API response (attempt 2/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 257.37s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...
  ┊ 📚 skill     duckduckgo-search  1.2s
  ✹ ಠ_ಠ ruminating... (42.9s)⚠️  Invalid API response (attempt 2/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 257.03s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...
⚠️  Invalid API response (attempt 1/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 125.92s (fast response often indicates rate limiting)
⏳ Retrying in 5s (extended backoff for possible rate limit)...
⚠️  Invalid API response (attempt 3/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 394.09s (fast response often indicates rate limiting)
❌ Max retries (3) exceeded for invalid responses. Giving up.
⚠️  Invalid API response (attempt 2/3): response.choices is None
   🏢 Provider: Unknown
   📝 Provider message: {'message': 'Provider returned error', 'code': 502}
   ⏱️  Response time: 256.95s (fast response often indicates rate limiting)
⏳ Retrying in 10s (extended backoff for possible rate limit)...
  ┊ 💬 Now let me run the competitor research across both platforms.
  ⠦ (◕ᴗ◕✿) 🐍 from ddgs import DDGS impor... (14.0s)^Cs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions