Skip to content

fix(cli): suppress OAuth provider warnings in doctor when provider not in use - #37438

Draft
tommck wants to merge 1 commit into
NousResearch:mainfrom
tommck:fix/doctor-oauth-warnings-for-unused-providers
Draft

fix(cli): suppress OAuth provider warnings in doctor when provider not in use#37438
tommck wants to merge 1 commit into
NousResearch:mainfrom
tommck:fix/doctor-oauth-warnings-for-unused-providers

Conversation

@tommck

@tommck tommck commented Jun 2, 2026

Copy link
Copy Markdown

What changed and why

hermes doctor was unconditionally showing ⚠ not logged in warnings for every OAuth provider it knows about (Nous Portal, OpenAI Codex, Google Gemini, MiniMax, xAI), regardless of which provider the user actually had configured.

For users running a local/custom OpenAI-compatible endpoint (model.provider: custom) or any API-key provider, these warnings are pure noise — there is nothing to act on.

Root cause: The Auth Providers section had no knowledge of model.provider, so it always warned for every OAuth provider that wasn't logged in.

Fix: Read model.provider from config.yaml before the Auth Providers section runs, and pass it to a new _oauth_check() helper. Providers whose relevant_ids set does not include the configured provider are demoted from warnings to info lines. All providers still appear in the output (for discoverability); only the severity changes.

Behaviour summary:

Configured provider Result
custom / any API-key provider All OAuth rows → info lines
nous Nous Portal → warn; others → info
xai xAI OAuth → warn; others → info
No model.provider set All OAuth rows → warn (safe default)

How to test

# Reproduce the original issue:
hermes config set model.provider custom
hermes config set model.base_url http://127.0.0.1:8080/v1
hermes doctor
# Before: all OAuth rows show ⚠ warnings
# After:  all OAuth rows show → info lines

# Verify warnings still appear for the active OAuth provider:
hermes config set model.provider nous
hermes doctor
# Nous Portal auth shows ⚠; others show → info

Unit tests:

pytest tests/hermes_cli/test_doctor.py::TestDoctorOAuthSkippedForUnusedProviders -v

Platforms tested

Linux (Ubuntu 24.04). The change touches only output formatting logic with no platform-specific syscalls.

Notes

  • Existing tests (TestDoctorXaiOAuthStatus, TestDoctorCodexCliHintPlacement) all pass unchanged — they use configs with no model.provider, which correctly falls through to the "show all as warnings" path.
  • The _oauth_check() helper is a local function inside run_doctor(); no new public API is added.

…t in use

When model.provider is set to a provider that doesn't use a given OAuth
flow (e.g. custom pointing at a local endpoint, or any API-key provider),
hermes doctor showed ⚠ warnings for every OAuth provider it knows about.
These warnings looked like actionable issues but were irrelevant noise.

Root cause: the Auth Providers section had no knowledge of which provider
the user had configured, so it unconditionally warned for every OAuth
provider that wasn't logged in.

Fix: read model.provider from config.yaml before the Auth Providers section
and pass it through to a new _oauth_check() helper. Providers whose
relevant_ids set does not include the configured provider are demoted from
⚠ warnings to → info lines. All providers still appear in the output for
discoverability; only the severity changes.

Behaviour summary:
- provider: custom / any API-key provider → all OAuth rows demoted to info
- provider: nous → Nous Portal warns; others demoted to info
- no model.provider set → all OAuth rows remain as warnings (safe default)
@tommck
tommck marked this pull request as draft June 2, 2026 14:40
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools labels Jun 2, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying a real diagnostic-noise issue: current hermes doctor still warns unconditionally for the displayed OAuth rows (hermes_cli/doctor.py:1109-1152).

Problems

  • The proposed mapping treats xai/grok and minimax as OAuth providers. Current metadata defines those as API-key providers; OAuth is xai-oauth (hermes_cli/providers.py:72-77) and minimax-oauth (hermes_cli/providers.py:124-128). This would suppress warnings for the actual OAuth configurations while retaining them for API-key users.
  • The diff still imports and tests Google Gemini CLI OAuth, but that provider and doctor row were removed by 7130d60861a9243301514bff611a9381830d59d8.
  • Current auth metadata also has qwen-oauth (hermes_cli/auth.py:206-210), absent from the proposed map.

Suggested changes

  • Salvage against current hermes_cli/doctor.py, derive relevance from current canonical provider IDs/aliases, and add regressions for API-key vs OAuth variants (xai/xai-oauth, minimax/minimax-oauth).

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/install-update Installer, updater, packaging, wheels, doctor labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools area/install-update Installer, updater, packaging, wheels, doctor comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants