Files
PaperClipAI/server
DottaandPaperclip 5d70cdfbe5 [PAP-3154] Stop padding /live-runs by default
The /companies/:companyId/live-runs route was inflating its response by
padding with up to 50 recent (non-live) heartbeat runs whenever a caller
didn't pass `minCount`. The Sidebar's "Dashboard NN live" badge reads
the array length from this endpoint, so every company saw "50 live" even
when only a handful of runs were actually queued or running.

Regression introduced by 6445bef9 ("Harden issue recovery reliability"),
which capped both `minCount` and `limit` at 50 with a fallback of 50
including for omitted values. The cap is correct for `limit` (a real
unboundedness guard); for `minCount` it conflates "no padding" with
"pad to the cap" and is what produced the bogus counts.

- Default `minCount` to 0 so callers asking for "live runs" only get
  actually-live runs unless they explicitly request padding.
- Keep `limit` capped at 50 by default to preserve the bound on response
  size.
- Add tests for the no-pad default and for explicit padding behavior so
  the contract stays clear.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-01 10:30:57 -05:00
..
2026-03-12 13:09:22 -05:00