test(vertex passthrough): surface unparseable spend log startTime

A row that matches the model and spend > 0 but whose startTime can't be parsed
was silently skipped, so a future /spend/logs format change would time out with
the "cost-tracking write was lost" message instead of pointing at the timestamp.
Print the offending value when that happens; matching behaviour is unchanged
This commit is contained in:
mateo-berri 2026-06-09 16:47:25 +00:00
parent 1b0031dada
commit cd7e99cd15
No known key found for this signature in database

View file

@ -163,7 +163,13 @@ async def get_request_spend_log(
if float(row.get("spend") or 0.0) <= 0:
continue
row_start = _parse_spend_log_start_time(row.get("startTime"))
if row_start is not None and row_start >= after_time:
if row_start is None:
print(
f"matching row has unparseable startTime {row.get('startTime')!r}",
row,
)
continue
if row_start >= after_time:
print(f"found spend log (elapsed={elapsed}s)", row)
return row
return None