PR Insights queries for the /agents analytics dashboard. These aggregate data from chat_diff_statuses (PR metadata) joined with chats and chat_messages (cost) to power the PR Insights view. Cost is computed per PR by summing the PR-linked chat's own cost plus the costs of any direct children (subag
(ctx context.Context, arg GetPRInsightsSummaryParams)
| 587 | // direct children (that lack their own PR), and deduped picks one row |
| 588 | // per PR for state/additions/deletions. |
| 589 | GetPRInsightsSummary(ctx context.Context, arg GetPRInsightsSummaryParams) (GetPRInsightsSummaryRow, error) |
| 590 | // Returns daily PR counts grouped by state for the chart. |
| 591 | // Uses a CTE to deduplicate by PR URL so that multiple chats referencing |
| 592 | // the same pull request are only counted once (keeping the most recent chat). |
no outgoing calls