Opus finding
BUILDER_CODE / POLYGON_PRIVATE_KEY / POLYMARKET_WALLET_ADDRESS accessed via os.environ[...] inside lru_cached factory
lowapi-contracthigh
- agent/tools/markets.py:71-102
Missing env vars surface as KeyError with no actionable message. Because get_clob_client is lru_cached, the failure is not retried and the cache stays empty (the exception simply re-raises on each call, but the message gives no hint which env var the operator forgot). Minor DX issue but trivial to fix.
Recommendation
Use os.environ.get(...) and raise a descriptive RuntimeError listing the missing variable name, or wrap startup in a config validator.