Files
hermes-webui/api
gavinssr 9e5403994c fix(profiles): write API key to .env instead of config.yaml on profile creation
When a user creates a profile through the WebUI and supplies an API key,
the key was written to config.yaml under model.api_key. However, Hermes
Agent's provider layer reads keys from environment variables (.env), not
from config.yaml — making the key invisible to the actual LLM provider.

Additionally, hermes profile show reports .env: not configured when no
.env file exists, regardless of config.yaml contents, giving users the
false impression that their API key was not saved.

Changes:
- Add _PROVIDER_ENV_MAP to resolve provider IDs to .env variable names
  (kimi-coding → KIMI_API_KEY, deepseek → DEEPSEEK_API_KEY, etc.)
- Add _write_api_key_to_dotenv() that writes the key to the profile's
  .env file under the correct provider-specific variable
- Add _upsert_dotenv_line() helper for idempotent KEY=value writes
- Remove api_key writing from _write_endpoint_to_config()
- Wire _write_api_key_to_dotenv() into create_profile_api()

Fixes: profile created via WebUI shows .env: not configured despite
        correct API key being entered in the form.
2026-05-28 15:45:17 +08:00
..
2026-04-29 19:54:07 -07:00
2026-05-27 00:02:32 +00:00
2026-05-25 00:14:38 +00:00
2026-05-27 03:25:04 +00:00
2026-05-15 16:39:45 -07:00
2026-05-25 17:48:19 +00:00