Skip to content

fix: raise EnvironmentError when WALLET_PRIV_KEY is not set#136

Open
bigeez wants to merge 1 commit intoOpenGradient:mainfrom
bigeez:fix/wallet-privkey-missing-validation
Open

fix: raise EnvironmentError when WALLET_PRIV_KEY is not set#136
bigeez wants to merge 1 commit intoOpenGradient:mainfrom
bigeez:fix/wallet-privkey-missing-validation

Conversation

@bigeez
Copy link
Copy Markdown

@bigeez bigeez commented Apr 4, 2026

Bug

WALLET_PRIV_KEY in server/config.py is typed as str but
os.getenv() returns None if the variable is not set. This None
value is then passed to og.LLM(private_key=...) at module import
time, causing a cryptic crash with no clear explanation.

Fix

Added an explicit check after loading the env var that raises a clear
EnvironmentError with a helpful message if WALLET_PRIV_KEY is missing,
so developers know exactly what to fix instead of hunting down a confusing
traceback.

Impact

  • Prevents silent None being passed to the LLM client
  • Fails fast with a clear error message at startup
  • Makes missing config easy to diagnose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant