GPT-5 finding
Import-time crash if SIGNAL_HALFLIFE_INTERACTIONS is non-numeric (env input not validated)
- agent/signals.py:30-32
The module converts an environment variable to float at import time without validation. If the variable is set to a non-numeric string (e.g., "ten"), importing agent.signals raises ValueError and can crash any code path that imports it (including unrelated functionality).
Recommendation
Parse and validate SIGNAL_HALFLIFE_INTERACTIONS robustly at runtime rather than at import time. For example: - Use a helper that attempts float conversion with try/except, defaulting to 10.0 and logging a warning on failure. - Or defer conversion until preprocess_signals() is called so import of the module is side-effect-free.