GPT-5 finding
Hidden coupling: get_open_markets() depends on agent.signals import side effects
- agent/tools/markets.py:191
- agent/signals.py:30-32
markets.get_open_markets() imports is_geopolitics_market from agent.signals at call time. Importing agent.signals executes module-level code that reads and converts an environment variable to float and could raise. Thus, a market-fetching path unexpectedly depends on and can be broken by an unrelated scoring configuration. This tight coupling increases the blast radius of configuration errors and makes markets harder to reuse independently.
Recommendation
Decouple the geopolitics classifier from the scoring module: - Move is_geopolitics_market and its regex into a lightweight module (e.g., agent.geo) with no import-time env parsing. - Or move the env parsing in agent.signals behind a function so importing it is side-effect-free. This confines configuration errors to signal processing and keeps market listing robust.