Repository navigation
Description
Summary
Hermes diagnostics reported Anthropic connectivity as OK, but an actual Anthropic oneshot failed. The CLI error shown to the user was only:
hermes -z: no final response was produced; treating the run as failed.
A direct API probe revealed the real provider error was an Anthropic billing/credit error:
HTTP 400 invalid_request_error: Your credit balance is too low to access the Anthropic API.
Hermes should surface that provider error in the oneshot failure, and hermes doctor should distinguish between "key exists / endpoint reachable" and "a real model invocation can succeed".
Environment
- Hermes:
0.16.0 - Platform: macOS
- Python:
3.11.14 - Active working config after recovery:
ollama-cloud / qwen3-coder:480b
Reproduction
With ANTHROPIC_API_KEY configured:
hermes auth status anthropicreported:
anthropic: logged in
and:
hermes doctorreported:
✓ Anthropic API
✓ ollama-cloud
But an actual Anthropic invocation failed:
hermes -z 'Say exactly HERMES_ANTHROPIC_PROBE and nothing else.' \
--provider anthropic \
-m claude-sonnet-4-6 \
--ignore-rules \
--cliOutput:
hermes -z: no final response was produced; treating the run as failed.
Afterward, hermes auth list marked the Anthropic credential exhausted with:
invalid_request_error (400)
A direct Anthropic /v1/messages request using the same key/model returned:
status 400
invalid_request_error: Your credit balance is too low to access the Anthropic API.
Expected behavior
hermes -zshould surface the provider error that caused no final response, especially for structured provider errors such as Anthropicinvalid_request_error.hermes doctorshould not show✓ Anthropic APIin a way that implies a real invocation can succeed when the account has insufficient credits. It could report something like:- key present
- endpoint reachable
- invocation failed: insufficient credits / billing required
- If a failed provider request marks a credential exhausted, the user-facing error should explain why.
Actual behavior
- Doctor showed Anthropic as OK.
- Oneshot failed with only a generic "no final response" error.
- The actionable reason was only discoverable through logs / credential exhaustion metadata / direct API probing.
Related migration/default-provider issue
Before switching Hermes back to a working default, the config pointed at:
model:
default: gpt-5.3-codex
provider: openai-codexbut hermes status showed OpenAI Codex auth was not logged in / missing access_token. A live probe failed with:
hermes -z: agent failed: Codex auth is missing access_token. Run `hermes auth` to re-authenticate.
Hermes may need a stronger migration/status guard to avoid leaving an unauthenticated provider as the default after updates, or at least flag the active default as unusable prominently.
Workaround
Switching the default back to a provider that passed a live invocation fixed Hermes locally:
hermes config set model.provider ollama-cloud
hermes config set model.default qwen3-coder:480bThen:
hermes -z 'Say exactly HERMES_PROBE' --ignore-rules --clireturned:
HERMES_PROBE
Security note
No secret values are included in this report.
Activity
GottZ commentedon Jul 29, 2026
Summary
One PR addresses issue #45155. #52473 targets the swallowed oneshot provider error by capturing redirected output, but it does not address the separate
hermes doctorfalse-positive diagnostic.Related pull requests
partial— (+78/-27) — partial fix; closed as implemented on main: the diff captures and surfaces provider/agent output when oneshot returns no final response, directly addressing the hidden Anthropic billing/authentication error, but leaveshermes doctorunchanged. It remains relevant as the proposed implementation, while contributor review documents that current main now provides the same user-facing guarantee through structuredrun_conversation()results and that this diff's_run_agentreturn-value assumption is stale.Suggested consolidation
Merge none. Keep #52473 closed because its oneshot objective is implemented on main through the structured conversation-result path; keep issue #45155 open only for the unresolved
hermes doctordistinction between credential/endpoint availability and successful model invocation.Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I45155(["issue #45155 (open)"]) P52473["PR #52473 (closed)"] P52473 -.->|partial| I45155 class I45155 open class I45155 target class P52473 closed click I45155 "https://github.com/NousResearch/hermes-agent/issues/45155" click P52473 "https://github.com/NousResearch/hermes-agent/pull/52473"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 7 kB of PR diffs, 6 kB of issue/PR text, 1 kB of discussion (1 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
teamster22 commentedon Aug 28, 2026
Hit this on v0.20.6 (upstream
306db277, Debian 12, headless) with a subscription-OAuth credential rather than an API key, and traced thelogged infalse positive to a specific line. Adding it here since this issue's point 2 ("doctor/status should not imply a real invocation can succeed") is exactly the gap, and the cause turns out to be a deliberate fix for a different issue.The same three-way disagreement, on OAuth
Same shape as the original report —
statussays yes,listsays exhausted, real invocation says no credentials. In my case the credential was genuinely unrecoverable (access token expired, refresh token rejected), so this wasn't a transient cooldown.Why
statusreturnslogged inPROVIDER_REGISTRY["anthropic"].auth_typeisapi_key, soget_auth_status()(hermes_cli/auth.py:7293) dispatches toget_api_key_provider_status()(:7204), whoselogged_inis derived purely from whether a non-empty string came back:The string comes from
_resolve_api_key_provider_secret()(:723). Its credential-pool fallback askspeek()first — which correctly returnsNonehere, becausepeek()goes through_available_entries()and honorsSTATUS_EXHAUSTED. But the code then iteratespool.entries()and returns the first syntactically valid token regardless of status:entries()is an unfiltered snapshot — it returns EXHAUSTED and DEAD rows alongside healthy ones:An exhausted entry still holds a well-formed
sk-ant-…string, sohas_usable_secret()passes, the prefix check passes, andlogged_in: Trueis returned for a credential the pool itself refuses to select. Thepeek()result — the one that respected status — gets overridden by the loop beneath it.The part worth flagging: this is a fix for #40960 colliding with this issue
That
entries()loop is not an oversight. #40960 reported that when all pool entries are in cooldown,_resolve_api_key_provider_secret()returned("", ""), and the empty key produced a misleading 401 instead of the real 429/402. PR #40961 (open, unmerged as of writing) proposes exactly this remedy:Current v0.20.6 already behaves this way. So the two issues pull in opposite directions on the same lines:
status/doctorto stop claiming health, which requires the status path to know the credential is benched.Both are right, and neither references the other. The conflict is only real because one function serves both callers. Resolving it as stated in either issue alone will regress the other.
Suggested shape
Separate the two concerns rather than changing the resolver's return value:
_resolve_api_key_provider_secret()return the entry status alongside the key (or expose astatus-only helper), keeping [Bug] credential pool exhaustion causes misleading 401 instead of real 429/402 #40960's behavior intact for the request path.get_api_key_provider_status()'slogged_inon that status, so a benched credential reports something likelogged in (credential exhausted — not usable)instead of a barelogged in.That satisfies point 2 of this issue without reintroducing the misleading 401 from #40960.
On the live-probe ask
Strong +1 to distinguishing "key present / endpoint reachable" from "an invocation can succeed" — with one field note.
hermes -zwas the only signal that told me the truth here, but on a subscription-OAuth credential a naive probe has a known trap: a429on ansk-ant-oat-*token frequently means malformed request, not quota, because the OAuth path requires the Claude Code system prompt as the first system block. Hermes injects it on the real path (agent/anthropic_adapter.py), so an internal probe is fine, but a hand-rolledcurlcheck reads as a false rate-limit.https://api.anthropic.com/api/oauth/usagereturns realfive_hour/seven_dayutilization and is a cleaner health signal for OAuth credentials specifically.Field impact
The false
logged incost about 10 hours of undetected downtime. Becausefallback_providerswas configured, the gateway kept answering on the fallback model while an explicitly-pinned Desktop client failed, so the only visible symptom was on one surface — and the two cheapest checks (auth status, plus a working chat) both read healthy.hermes auth resetalso reports success in this state and changes nothing, since it clears the exhaustion flag rather than the dead refresh token.Recovery required
hermes auth removebeforehermes auth add— a newly added credential lands behind the dead one atpriority: 0and stays shadowed otherwise.