Your backup failed and the error blamed the wrong provider

One in the morning, you are waiting on a long report. Hermes answers “out of credits”. You open the billing page, put twenty dollars on the backup provider, send it again — out of credits. Now you are wondering whether the top-up landed, whether the account is blocked, whether the model was pulled. The actual cause never made it onto your screen: your primary login lapsed that afternoon, Hermes quietly switched to the backup, and the backup happens to be empty.
What you needed was not another error message. It was one plain sentence: your primary account needs you to sign in again, the backup is only a stand-in.
The fallback saved the turn and hid the reason
Hermes’ model routing has a safety net: when the primary provider’s login has expired or its credential is missing, it swaps to the first resolvable fallback entry for that turn and keeps the task running. For long jobs and scheduled runs this is genuinely important — an expired OAuth token should not throw away two hours of work.
The price is information. The switch happens early, and after it, the turn only knows “I am on the backup now”. If the backup then fails too — no credits, its own expired credential, a rate limit, an upstream error — the error card can only describe the backup’s problem.
So the real root cause, “the primary login lapsed”, became a fact nobody ever said out loud.
The fix: carry the failure forward instead of guessing again
This change (PR #155246 and the series of fixes that followed over the next days) adds a small, load-bearing structure: PrimaryAuthFailure, with exactly four fields — provider, error, relogin, backup. It is created at the moment routing switches, carrying why the primary was skipped and which command fixes it, and it travels with the turn to the end.
A few rules decide whether that notice is useful or noise:
- Only errors a re-login fixes produce it. Rate limits, retryable refusals and entitlement codes (credits or subscription) mean the login is fine — telling you to sign in again would send you the wrong way.
- A set of “looks like auth, is not” codes is excluded outright: service temporarily unavailable, a per-model rate limit, an external CLI that is not installed, no provider configured, an invalid provider name, a custom endpoint with no base URL. None of those are fixed by signing in.
- Every notice carries a runnable command. A known OAuth provider gets the exact OAuth command, an API-key provider gets
hermes auth add, an unknown slug gets a placeholder. Under a profile, the command carries the profile selector too, so you do not re-sign the root credential store by accident.
The check people miss: which route is this turn actually on
“The primary login failed” is only true if this turn is still running that primary route. If a per-turn override such as /model --once moved the turn to another provider, that refusal belongs to the other route and must not be attributed to the primary.
So the logic snapshots the route on both sides of the switch — provider, base URL and API key. If they differ, the failure is dropped. The pending failure also lives in a context variable rather than on the runner object, because the gateway resolves concurrent chats on separate threads and an attribute would leak between them.
What you actually see now
When the backup fails too, the message leads with the root cause and then describes the backup:
⚠️ anthropic needs you to sign in again: run
hermes auth login anthropic. Its login failed (401), so Hermes switched to the backup provider (openrouter), and the backup is out of credits (or over its usage limit). Re-authenticating anthropic fixes this; topping up the backup only keeps the fallback running.
The backup’s own sentence follows underneath, labelled as what the backup said. The error card got the matching treatment: when the reason is an auth failure and the turn carries a primary failure, the card points at the primary provider instead of the backup that was running at the time.
One detail: if the primary is serving again by then, the notice is skipped — it is no longer this turn’s story.
Where it deliberately stays quiet
Several exits exist because a notice would make things worse:
- The backup is rate-limiting: its card carries its own retry time, and a “go sign in to the primary” line would bury the actual next step.
- The primary only hit a per-model rate limit, or its external CLI is missing: not a login problem.
- You overrode the route yourself: not the primary’s fault.
Two companion fixes in the same batch are worth knowing. The primary’s error text is now redacted before it enters the structured descriptor, so a credential fragment cannot ride into a card. And a declared login command is quoted correctly for the Windows shell — one wrong quote and a user copying the command hits a failure that looks like the original bug.
What it means for you, and where it stands
No new settings. The series merged between November 13 and 15, 2026, and v0.23.1 shipped on November 10 — so it is on main only, not in a release yet.
Update (2026-11-17): these changes shipped in v0.23.2 (November 16) —
hermes updatebrings them in. The “not in v0.23.1” wording above is a snapshot from publication time.
Until it ships, the reliable order when a fallback fails is: check whether the primary login is still valid, then look at the backup. To get the fallback strategy itself right, the three-layer fallback setup is the full tutorial; if your problem is that routing did not come back after a quota reset, routing after quota recovery covers that stretch; and if you run a custom relay endpoint, provider name collisions explains another trap that costs people an evening.
The one-line version
The side effect of a good safety net is that it hides the root cause. Nothing about the fallback behaviour changed here — the reason for switching now travels with the turn to the end. So the next sentence you read went from “top up some more” to “sign in to your primary again, that is what is broken”.