Skip to content

fix(doctor): check gh auth status when GITHUB_TOKEN is absent - #16121

Closed
jjjojoj wants to merge 7 commits into
NousResearch:mainfrom
jjjojoj:fix/doctor-gh-auth-check
Closed

fix(doctor): check gh auth status when GITHUB_TOKEN is absent#16121
jjjojoj wants to merge 7 commits into
NousResearch:mainfrom
jjjojoj:fix/doctor-gh-auth-check

Conversation

@jjjojoj

@jjjojoj jjjojoj commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

What

Two small doctor fixes bundled into one PR:

1. gh auth fallback when GITHUB_TOKEN absent (#16115)
hermes doctor no longer falsely warns "No GITHUB_TOKEN (60 req/hr)" when the user has authenticated via gh auth login but has no GITHUB_TOKEN env var. Added _gh_authenticated() helper that runs gh auth status --json authenticated. Falls back to this when env vars are absent.

2. Skip MiniMax (China) /v1/models health check (#16120)
MiniMax (China) API does not support the /v1/models endpoint — returns HTTP 404 even though /v1/chat/completions works fine. Set supports_health_check=False so doctor shows "(key configured)" instead of false-positive 404 warning.

Test

  • TestGitHubTokenCheck: 3 cases covering no-token/no-gh to warn, token-env to ok, no-token/gh-authenticated to ok via gh fallback
  • MiniMax fix: verified by reading provider health check logic

Fixes #16115
Fixes #16120

jjjojoj and others added 7 commits April 18, 2026 22:51
…esearch#12175)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2294)

build_skills_system_prompt() loaded disabled set AFTER the cache check,
so config changes to skills.disabled silently had no effect until restart.
Move get_disabled_skill_names() before cache check and add sorted disabled
tuple to cache key so any change invalidates the cache.
NousResearch#12064)

Background task media delivery unpacked the (path, is_voice) tuple but
discarded the is_voice flag, sending all audio via send_document. Now
routes voice files through send_voice() when the adapter supports it.
When API keys are stored in ~/.hermes/.env or auth.json but never
loaded into os.environ (e.g. post-session-start addition, or ACP
entry point missing project_env), _resolve_api_key_provider_secret()
returned empty string and broke fallback_providers chains.

Fix: add credential_pool (auth.json) as a fallback source after env var
checks, using read_credential_pool() to find valid access_token entries.
Mirrors the pool.select() path in runtime_provider.py while preserving
env var priority.

Secondary fix: acp_adapter/entry.py now passes project_env to
load_hermes_dotenv(), consistent with all other entry points
(main.py, run_agent.py, cli.py).

Tests added:
- test_credential_pool_fallback.py: 5 cases covering env→pool priority,
  provider-specific fallback, empty token filtering
- test_entry_env_loading.py: verifies project_env is passed to dotenv loader

Fixes NousResearch#15914
Fixes NousResearch#15932 (duplicate)
When GITHUB_TOKEN and GH_TOKEN are both unset, doctor showed a
warning even when the user had authenticated via 'gh auth login'
(token stored in ~/.config/gh/hosts.yml). Now runs 'gh auth status
--json authenticated' as a fallback — if gh is authenticated, displays
'GitHub authenticated via gh CLI (full API access)' instead of
misleading rate-limit warning.

Added TestGitHubTokenCheck with 3 cases covering:
- no token + no gh → shows warning
- token env present → shows ok
- no token + gh authenticated → shows ok via gh fallback

Fixes NousResearch#16115
@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 comp/acp Agent Communication Protocol adapter comp/gateway Gateway runner, session dispatch, delivery comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/auth Authentication, OAuth, credential pools labels Apr 26, 2026
@jjjojoj

jjjojoj commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Retrying with clean branch — had 7 upstream commits mixed in. New PR at #16127

@jjjojoj jjjojoj closed this Apr 26, 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 comp/acp Agent Communication Protocol adapter comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MiniMax (China) API check returns HTTP 404 in hermes doctor doctor warns missing GITHUB_TOKEN when gh CLI is authenticated

2 participants