MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / provider_env_passthrough

Function provider_env_passthrough

eval/run_real_model.py:316–328  ·  view source on GitHub ↗

Forwards allowlisted provider API keys from the root ~/.hermes/.env.

(env)

Source from the content-addressed store, hash-verified

314
315
316def 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
331def ensure_hermes_profile(selection, model, provider, tracedecay_bin, fixture, eval_env):

Callers 1

drive_hermesFunction · 0.85

Calls 2

homeMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected