hermes - 💡(How to fix) Fix feat: support per-session env var overrides in plugins for multi-tenant deployments

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

def generate(self, ..., session_env: Optional[Dict[str, str]] = None) -> dict:
    api_key = (session_env or {}).get('LUMA_API_KEY') or os.environ.get('LUMA_API_KEY')
RAW_BUFFERClick to expand / collapse

Problem

Plugins read API keys via os.environ.get('SOME_API_KEY') at import or call time. In multi-tenant deployments, each session may need a different API key (per-brand BYO keys). Currently this requires running separate Hermes containers with different env vars — not viable when serving many tenants from one container.

Proposed Change

Allow the plugin's generate() (and is_available()) to receive a session_env: Optional[Dict[str, str]] parameter containing per-session overrides injected by the host:

def generate(self, ..., session_env: Optional[Dict[str, str]] = None) -> dict:
    api_key = (session_env or {}).get('LUMA_API_KEY') or os.environ.get('LUMA_API_KEY')

Motivation

Mother supports per-brand BYO API keys stored in brandConfig.lumaApiKey. Without per-session env injection, all brands sharing a Hermes instance must share the same system-level key.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix feat: support per-session env var overrides in plugins for multi-tenant deployments