hermes - ✅(Solved) Fix [Bug]: Ink TUI: bare-slug model + provider in config yields HTTP 404 at api.anthropic.com [2 pull requests, 1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#11884Fetched 2026-04-18 05:58:29
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×2commented ×1labeled ×1

Error Message

✗ ❌ Non-retryable client error (HTTP 404). Aborting. ✗ 💡 This type of error won't be fixed by retrying.

Additional Logs / Traceback (optional)

Root Cause

The classic CLI works with the identical config because cli.py calls resolve_runtime_provider() before constructing AIAgent.

Fix Action

Fix / Workaround

in the tui you will see:

    Activity (4)
    ✗ ❌ Non-retryable client error (HTTP 404). Aborting.
    ! 🔌 Provider:   Model: anthropic/claude-opus-4-6
    ! 🌐 Endpoint: https://api.anthropic.com
    ✗ 💡 This type of error won't be fixed by retrying.

Notice Provider: is empty

PR fix notes

PR #11887: fix(tui): resolve runtime provider in _make_agent

Description (problem / solution / changelog)

Fixes #11884

Problem

_make_agent() in tui_gateway/server.py was not calling resolve_runtime_provider(), so bare-slug models (e.g. claude-opus-4-6 with model.provider: anthropic in config) left provider, base_url, and api_key empty in AIAgent — causing HTTP 404 at api.anthropic.com.

The classic CLI path (cli.py) already resolves these correctly; the TUI gateway was missing the same step.

Fix

Call resolve_runtime_provider(requested=None) and forward all 7 resolved fields (provider, base_url, api_key, api_mode, acp_command, acp_args, credential_pool) to AIAgent, mirroring cli.py.

Test

Adds tests/tui_gateway/test_make_agent_provider.py — regression test that verifies resolve_runtime_provider is called and its output is forwarded to AIAgent.

Changed files

  • tests/tui_gateway/test_make_agent_provider.py (added, +48/-0)
  • tui_gateway/server.py (modified, +9/-0)

PR #11952: fix(tui): call resolve_runtime_provider() before constructing AIAgent

Description (problem / solution / changelog)

Fixes #11884

Problem

The TUI gateway's _make_agent() constructs AIAgent without calling resolve_runtime_provider(), so bare-slug model configs (e.g. claude-opus-4-6 + provider: anthropic) get empty base_url/api_key, resulting in 404 errors.

The classic CLI works because cli.py calls resolve_runtime_provider() before constructing AIAgent.

Fix

Added resolve_runtime_provider() call in _make_agent() before AIAgent construction, passing the resolved credentials (api_key, base_url, provider, api_mode, acp_command, acp_args, credential_pool) to AIAgent(), matching what cli.py does.

Tests

Added 2 tests verifying that _make_agent() calls resolve_runtime_provider() and passes resolved values to AIAgent.

Changed files

  • tests/test_tui_gateway_server.py (modified, +91/-0)
  • tui_gateway/server.py (modified, +12/-0)

Code Example

model:
      default: claude-opus-4-6
      provider: anthropic

---

Activity (4)
    ✗ ❌ Non-retryable client error (HTTP 404). Aborting.
    ! 🔌 Provider:   Model: anthropic/claude-opus-4-6
    ! 🌐 Endpoint: https://api.anthropic.com
    ✗ 💡 This type of error won't be fixed by retrying.

---

Report       https://paste.rs/2MNXZ
agent.log    https://paste.rs/ikYPd
gateway.log  https://paste.rs/EaibO

---
RAW_BUFFERClick to expand / collapse

Bug Description

The new TUI gateway's _make_agent() constructs AIAgent without resolving runtime provider credentials. With a bare-slug model in config (e.g. claude-opus-4-6 + provider: anthropic), the agent receives empty provider, base_url, api_key, and api_mode. Provider auto-detection in run_agent.py requires api.anthropic.com in base_url to select the Anthropic adapter — with empty base_url it falls through to a default client path that 404s.

The classic CLI works with the identical config because cli.py calls resolve_runtime_provider() before constructing AIAgent.

Steps to Reproduce

  1. Set ~/.hermes/config.yaml:
    model:
      default: claude-opus-4-6
      provider: anthropic
  2. Ensure ANTHROPIC_API_KEY is set in `~/.hermes/.env
  3. unset HERMES_MODEL HERMES_INFERENCE_PROVIDER
  4. hermes --tui
  5. Send any message

Expected Behavior

Agent resolves provider from config, routes to Anthropic Messages API, responds normally — same as hermes (classic CLI) with the same config.

Actual Behavior

in the tui you will see:

    Activity (4)
    ✗ ❌ Non-retryable client error (HTTP 404). Aborting.
    ! 🔌 Provider:   Model: anthropic/claude-opus-4-6
    ! 🌐 Endpoint: https://api.anthropic.com
    ✗ 💡 This type of error won't be fixed by retrying.

Notice Provider: is empty

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/2MNXZ
agent.log    https://paste.rs/ikYPd
gateway.log  https://paste.rs/EaibO

Operating System

Manjaro Linux 6.18.12

Python Version

No response

Hermes Version

3.11.14

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

tui_gateway/server.py::_make_agent() (line ~907) builds AIAgent with only model=_resolve_model(). It never calls hermes_cli.runtime_provider.resolve_runtime_provider(), so provider, base_url, api_key, and api_mode are all empty/default.

`AIAgent.__init__` in `run_agent.py` (line ~751) auto-detects the anthropic adapter only when `api.anthropic.com` is found in `base_url` or `provider == "anthropic"`. Both are empty, so detection fails.

`cli.py` (line ~2743) handles this correctly — calls `resolve_runtime_provider()` first and passes the resolved values into `AIAgent`.

Proposed Fix (optional)

Mirror cli.py: add resolve_runtime_provider() call in _make_agent() and forward provider/base_url/api_key/api_mode to AIAgent. PR incoming.

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 most likely fix is to modify the _make_agent() function in tui_gateway/server.py to call resolve_runtime_provider() and pass the resolved values to AIAgent.

Guidance

  • Review the tui_gateway/server.py file, specifically the _make_agent() function, to ensure it calls resolve_runtime_provider() before constructing AIAgent.
  • Verify that the resolve_runtime_provider() function is correctly resolving the provider credentials and returning the expected values.
  • Update the _make_agent() function to pass the resolved provider, base_url, api_key, and api_mode values to the AIAgent constructor.
  • Test the changes to ensure the TUI gateway correctly resolves the provider credentials and routes to the Anthropic Messages API.

Example

# In tui_gateway/server.py
from hermes_cli.runtime_provider import resolve_runtime_provider

def _make_agent():
    # ...
    provider, base_url, api_key, api_mode = resolve_runtime_provider()
    agent = AIAgent(model=_resolve_model(), provider=provider, base_url=base_url, api_key=api_key, api_mode=api_mode)
    # ...

Notes

The proposed fix is to mirror the functionality in cli.py, which correctly calls resolve_runtime_provider() before constructing AIAgent. This change should resolve the issue with the TUI gateway failing to detect the Anthropic adapter.

Recommendation

Apply the workaround by modifying the _make_agent() function in tui_gateway/server.py to call resolve_runtime_provider() and pass the resolved values to AIAgent, as this is the most straightforward solution to the identified issue.

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

hermes - ✅(Solved) Fix [Bug]: Ink TUI: bare-slug model + provider in config yields HTTP 404 at api.anthropic.com [2 pull requests, 1 comments, 2 participants]