Skip to content

[Bug]: APIConnectionError with custom endpoint ~80% failure rate while direct Python SDK works 100% #11969

Description

@shimuhua

Bug Description

Hermes Agent version: v0.10.0

install : curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

=========== Issue ==================

1. When executing: hermes chat -q "hello" --toolsets browser, it occasionally succeeds, but the success rate is extremely low.

⚠️ API call failed (attempt 1/3): APIConnectionError
🔌 Provider: custom Model: minimax-m25
🌐 Endpoint: http://maas.gd.chinamobile.com:36007/ai/uifm/open/v1
📝 Error: Connection error.
⏱️ Elapsed: 2.49s Context: 2 msgs, ~311 tokens
⏳ Retrying in 2.7s (attempt 1/3)...
⚠️ API call failed (attempt 2/3): APIConnectionError
🔌 Provider: custom Model: minimax-m25
🌐 Endpoint: my base_url
📝 Error: Connection error.
⏱️ Elapsed: 7.11s Context: 2 msgs, ~311 tokens
⏳ Retrying in 4.4s (attempt 2/3)...
⚠️ API call failed (attempt 3/3): APIConnectionError
🔌 Provider: custom Model: minimax-m25
🌐 Endpoint: my base_url
📝 Error: Connection error.
⏱️ Elapsed: 13.41s Context: 2 msgs, ~311 tokens
🔁 Transient APIConnectionError on custom — rebuilt client, waiting 6s before one last primary attempt.
⚠️ API call failed (attempt 1/3): APIConnectionError
🔌 Provider: custom Model: minimax-m25
🌐 Endpoint: my base_url
📝 Error: Connection error.
⏱️ Elapsed: 21.25s Context: 2 msgs, ~311 tokens
⏳ Retrying in 2.5s (attempt 1/3)...
⚠️ API call failed (attempt 2/3): APIConnectionError
🔌 Provider: custom Model: minimax-m25
🌐 Endpoint: my base_url
📝 Error: Connection error.
⏱️ Elapsed: 25.63s Context: 2 msgs, ~311 tokens
⏳ Retrying in 4.0s (attempt 2/3)...
─ ⚕ Hermes ─────────────────────────────────────────────────────────────────────────────────────────────────────────

 Hello! I'm here to help you navigate the web and get things done. I can browse websites, fill forms, click
 buttons, scroll pages, and more.

 What can I help you with today?

2. When executing my LLM request via a Python script, the success rate is 100%.

from openai import OpenAI

client = OpenAI(
base_url='my base_url',
api_key='my key', # ModelScope Token
)

response = client.chat.completions.create(
model='minimax-m25', # ModelScope Model-Id
messages=[
{
'role': 'system',
'content': 'You are a helpful assistant.'
},
{
'role': 'user',
'content': 'hello'
}
],
stream=True
)

for chunk in response:
if chunk.choices:
print(chunk.choices[0].delta.content, end='', flush=True)

=========== LLM configuration content in config.yaml file ==================

model:
default: minimax-m25
provider: custom
base_url: custom llm url
api_key: custom llm key content
stream: false
providers: {}
fallback_providers: []
credential_pool_strategies: {}
toolsets:

  • hermes-cli

custom_providers:

  • name: provider.costom.llm
    base_url: custom llm url
    api_key: custom llm key content
    model: minimax-m25
    stream: false
    models:
    minimax-m25:
    context_length: 204800

Globally disable streaming

streaming:
enabled: false

=========== LLM api_key configuration content in .env file ==================

OPENAI_API_KEY=custom llm key content

Steps to Reproduce

When repeatedly executing the test command hermes chat -q "hello" --toolsets browser, the success rate is extremely low.

Expected Behavior

Please see the description above.

Actual Behavior

Please see the description above.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Please see the description above.

Operating System

Ubuntu 24.04.4 LTS

Python Version

No response

Hermes Version

v0.10.0

Additional Logs / Traceback (optional)

Please see the description above.

Root Cause Analysis (optional)

Please see the description above.

Proposed Fix (optional)

Please see the description above.

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

    sweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions