fix(cli): honor api_key from config.yaml for anthropic provider - #9105
Open
Tranquil-Flow wants to merge 1 commit into
Open
fix(cli): honor api_key from config.yaml for anthropic provider#9105Tranquil-Flow wants to merge 1 commit into
Tranquil-Flow wants to merge 1 commit into
Conversation
Collaborator
3 tasks
Tranquil-Flow
force-pushed
the
fix/anthropic-config-api-key
branch
2 times, most recently
from
May 25, 2026 14:00
b83c579 to
7d74a9e
Compare
Tranquil-Flow
force-pushed
the
fix/anthropic-config-api-key
branch
2 times, most recently
from
May 26, 2026 00:03
7c796a9 to
d70b7c6
Compare
Contributor
|
Thanks for isolating the normal native-Anthropic resolution path and retaining provider scoping. The premise remains valid on current main: the non-Azure branch still calls Problems
Suggested changes
GitHub currently reports this branch as conflicting, and the resolver has moved; salvage will require manual conflict resolution rather than a clean cherry-pick. This is an automated hermes-sweeper review. |
Re-port of NousResearch#9105 onto current upstream/main (af250d8). The non-Azure branch in resolve_runtime_provider() did not check model_cfg.get('api_key'), so users who configured an inline api_key under model: in config.yaml had it silently ignored for native Anthropic. Now: - The Azure branch already read config api_key; add source tracking. - The non-Azure (OAuth/env) branch now reads model.api_key first when cfg_provider == 'anthropic', falling back to resolve_anthropic_token() as before. - 'source' distinguishes 'config' vs 'env' for observability. Cross-provider leak is prevented: a config api_key from a different provider (e.g. openrouter) is never read by the anthropic branch.
Tranquil-Flow
force-pushed
the
fix/anthropic-config-api-key
branch
from
July 13, 2026 16:32
d70b7c6 to
cb6cbbf
Compare
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 does this PR do?
Runtime provider resolution did not honor
model.api_keyfromconfig.yamlfor the Anthropic provider in the intended scoped path. This PR allows configured Anthropic API keys to be used for Anthropic only, avoiding cross-provider key leakage.Related Issue
Related to Anthropic runtime provider config resolution.
Type of Change
Changes Made
model.api_keyinhermes_cli/runtime_provider.pywhen the configured provider is Anthropic.How to Test
.venv/bin/python -m pytest -o 'addopts=' tests/hermes_cli/test_runtime_provider_resolution.py -qChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — focused pytest passed; full suite was not run in this salvage passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Focused verification: