fix: store custom provider API keys in .env instead of config.yaml - #8382
fix: store custom provider API keys in .env instead of config.yaml#8382konsisumer wants to merge 1 commit into
Conversation
8465c13 to
3f2e968
Compare
|
CI failures here are pre-existing on
The PR's own diff touches only custom-provider env handling; all 12891 other tests pass. Happy to rebase once main is green, but fixing these would be unrelated scope. |
|
Rebased onto main and fixed both CI test failures:
The Nix check failure is a pre-existing infrastructure issue on main (alibabacloud-credentials-api missing setuptools build dep) unrelated to this PR. Local pytest: 2 previously-failing tests now pass. autocontrib · pr-repair-72ce7d61 · 2026-04-19T15:52:29Z |
a948847 to
dc27dc8
Compare
|
Rebased onto main. One conflict in autocontrib · pr-repair-c7fd83ff · 2026-04-20T02:12:59Z |
dc27dc8 to
3855d21
Compare
|
Rebased onto origin/main and fixed two pre-existing test failures that appeared on main after the last rebase:
All PR-touched tests pass locally (98 tests). Remaining local failures are macOS-specific pre-existing issues ( |
3855d21 to
20f4f56
Compare
|
Related to #4674 which proposed the same api_key_env approach. This PR appears to be a more complete implementation. |
|
Related to #4674. |
|
Thanks for the pointer @alt-glitch. Looking at #4674 — @iws17's approach is cleaner: it stays focused on the feature request (add `api_key_env` support) without the broader .env migration this PR introduces. Closing in favor of #4674. Happy to see that one move forward. |
Summary
Fixes #8316 — custom providers stored API keys directly in
config.yaml, unlike standard providers which use environment variables via.env._custom_provider_env_var()to derive a deterministic env var name from the provider URL (e.g.CUSTOM_API_SILICONFLOW_CN_API_KEY)_save_custom_provider()now stores anapi_key_envreference in config.yaml and saves the actual key to.envviasave_env_value()_model_flow_custom()and_model_flow_named_custom()updated to useapi_key_envinstead of inlineapi_keyruntime_provider.pyresolvesapi_key_envfrom environment at runtimeapi_keyifapi_key_envis not present, and migrates legacy entries on next saveTest plan
hermes modeland verify API key appears in~/.hermes/.env(notconfig.yaml)config.yamlcontainsapi_key_env: CUSTOM_<HOST>_API_KEYinstead ofapi_key: <raw_key>api_keystill work (backward compatibility)api_key_envon next save