AntFleet

Disagreement · 6e0f16bf-anthropic-7

Module import side effect: _install_sdk_log_filter() runs at import time

solo Opus
repo 703f69ec·PR #2·reviewed 5 days ago

Opus finding

Module import side effect: _install_sdk_log_filter() runs at import time

lowmaintainabilityhigh
  • agent/tools/markets.py:51-56
Calling _install_sdk_log_filter() at module top-level means merely importing agent.tools.markets installs the filter. The settlement.py docstring explicitly mentions the design choice to live outside agent.tools to avoid pulling in py_clob_client_v2. That tells us import-time side effects in this module matter. While the filter itself is cheap, the policy of doing work at import time is fragile (e.g. tests that capture logs may behave inconsistently depending on import order). Prefer calling it from get_clob_client() (already cached).

Recommendation

Move _install_sdk_log_filter() invocation into get_clob_client() (it's lru_cached so idempotency is preserved) and drop the bare module-level call.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →

From the same review

These findings passed the unanimous gate on the same PR review. The disagreement above was filtered out; the findings below were posted.