Files
multica/server/pkg
jayavibhavnk 67212b0bef fix(server): fix ListRuntimeUsage to filter by date range instead of row count
GetRuntimeUsage accepted a ?days=N query parameter intended to return N
days of history, but the underlying ListRuntimeUsage query used it as a
raw LIMIT on rows. When a runtime uses multiple models (e.g. claude-opus
and claude-sonnet), each day produces multiple rows, so LIMIT 90 would
only return ~30 days of data instead of 90, silently truncating history.

Fix: replace the LIMIT clause with AND date >= $2 in the SQL query,
update ListRuntimeUsageParams to hold a Since pgtype.Date instead of a
Limit int32, and compute the date cutoff in the handler using
time.Now().AddDate(0, 0, -days). The generated Go code and the handler
are updated consistently.

Closes #731

Made-with: Cursor
2026-04-12 22:42:56 +08:00
..