AntFleet

Disagreement · 03a14240-anthropic-0

_reconcile_fill silently swallows partial-fill data when size_matched is the string "0"

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

Opus finding

_reconcile_fill silently swallows partial-fill data when size_matched is the string "0"

lowbugmedium
  • agent/tools/wallet.py:142-152
The chained `or` falls through on any falsy value. If size_matched is the string "0" or numeric 0 (no fill yet) we end up with "0" — fine. But if the API returns size_matched=0 and matched_size is the actual filled amount, the 0 will short-circuit to matched_size, which is OK. The real problem is the opposite: a legitimate "0" return is treated as falsy and we walk through alternative keys that may not exist. Low-severity ambiguity; the function still returns 0 correctly today, but logic is fragile if the V2 API ever changes shape.

Recommendation

Use explicit `if key in order` lookups rather than chained `or` to disambiguate "key absent" vs "key present with zero value".

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 →