#1675
[BUG] Dedupe confidence accepts NaN and out-of-range values from the model
_parse_dedupe_response validates is_duplicate (a bool) and duplicate_id (names an existing report), but takes confidence straight from the model:
{"is_duplicate": false, "confidence": "nan"} -> confidence = nan
{"is_duplicate": false, "confidence": "inf"} -> confidence = inf
{"is_duplicate": false, "confidence": -3} -> confidence = -3.0
{"is_duplicate": false, "confidence": 99} -> confidence = 99.0The prompt (dedupe.py:133) documents "confidence is a number between 0 and 1", and the value is returned to callers and logged with %.2f. A NaN defeats every comparison it reaches - sorting a list of decisions, a threshold check, a UI badge - so one malformed answer can hide or reorder results instead of failing loudly.
Expected: the parser holds the value to the range the prompt asks for.
Activity
0No activity yet.