Forwards allowlisted provider API keys from the root ~/.hermes/.env.
(env)
| 314 | |
| 315 | |
| 316 | def provider_env_passthrough(env): |
| 317 | """Forwards allowlisted provider API keys from the root ~/.hermes/.env.""" |
| 318 | root_env = Path.home() / ".hermes/.env" |
| 319 | if not root_env.exists(): |
| 320 | return |
| 321 | for line in root_env.read_text(encoding="utf-8", errors="replace").splitlines(): |
| 322 | line = line.strip() |
| 323 | if not line or line.startswith("#") or "=" not in line: |
| 324 | continue |
| 325 | key, _, value = line.partition("=") |
| 326 | key = key.strip() |
| 327 | if key in PROVIDER_ENV_KEYS and key not in env and value.strip(): |
| 328 | env[key] = value.strip().strip('"').strip("'") |
| 329 | |
| 330 | |
| 331 | def ensure_hermes_profile(selection, model, provider, tracedecay_bin, fixture, eval_env): |
no test coverage detected