AntFleet

Disagreement · 6e0f16bf-anthropic-2

Log filter mutates levelno but record may have already been level-filtered

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

Opus finding

Log filter mutates levelno but record may have already been level-filtered

lowbugmedium
  • agent/tools/markets.py:30-41
logging filters run after the logger's effective level check but before handler-level checks. Mutating record.levelno from ERROR to INFO inside a filter does not propagate to logger.isEnabledFor or to handler level filtering that already passed; downstream handlers will still emit the record at whatever they accepted it as. More importantly, if any handler is configured to filter by levelno (some Lambda handlers do), this in-place mutation can produce inconsistent state. The cleaner pattern is to return False to drop, or to use a Filter that returns False for the specific marker.

Recommendation

Return False to suppress the record entirely, or attach the filter to handlers and reissue via logger.info. Avoid mutating LogRecord level fields post-dispatch.

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.