Grouped aggregate queries for the agent scorecard

Featurekamo-shared-library
Ya
22 Julai 2026, 17:18 UTC
Mwandishi
Kamo
Ahadi ya
8e83ad9

Twelve @Query aggregates across sessions, messages, usage records and outbound touches, so a scorecard is a handful of grouped queries rather than loading rows into memory. Two properties are enforced in the predicates rather than left to callers: - **isTest sessions are excluded in the query itself.** On a young agent the author's own test drives would otherwise be most of the data, and a caller who forgets to filter produces numbers that look real and are not. - **count(costEstimate) counts only NON-NULL costs.** That is what lets the scorecard distinguish 'nothing was priced' from 'it cost zero' - collapsing those would put a confident $0.00 in front of an org whose traffic simply predates pricing. Outbound touches are grouped by decision rather than filtered to sends. The refusals are the more interesting half: an agent whose touches are nearly all SUPPRESSED_QUIET_HOURS is misconfigured, and that is invisible if decoders are discarded.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei