fix(auth): add credential_pool fallback when env var is absent - #15944
Closed
jjjojoj wants to merge 5 commits into
Closed
fix(auth): add credential_pool fallback when env var is absent#15944jjjojoj wants to merge 5 commits into
jjjojoj wants to merge 5 commits into
Conversation
…esearch#12175) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ousResearch#12176) 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)
Collaborator
Collaborator
Contributor
Author
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes HTTP 401 errors in fallback chain when API keys are stored in
~/.hermes/.envorauth.jsonbut not inos.environ.Why
_resolve_api_key_provider_secret()only checkedos.environfor API keys. When env vars were absent (e.g. key added after session start, or ACP entry point not loading project.env), it returned""and broke thefallback_providerschain with HTTP 401.How
auth.py: Add credential pool as fallback source after env var checks, using
read_credential_pool()to find validaccess_tokenentries. Preserves env var priority — pool is only consulted when env vars are empty.acp_adapter/entry.py: Now passes
project_envtoload_hermes_dotenv(), consistent with all other entry points (main.py,run_agent.py,cli.py).Test
Added
tests/hermes_cli/test_credential_pool_fallback.py(5 cases) andtests/acp_adapter/test_entry_env_loading.py(1 case).Fixes #15914
Fixes #15932 (duplicate)