Repository navigation
improve(team-reports): reduce activity aggregation queries - #159148
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 4:24 PM ET / 20:24 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Team Reports plugin now reads activity metadata once per source during aggregation, retains 100-row payload batches, and adds a SQLite query-budget regression test. Merge readiness✅ Ready for maintainer review Current main still makes repeated metadata queries, so this PR remains useful. The revised test addresses the previous review finding, and I found no introduced defect that warrants another repair cycle. Priority: P2 Review scores
Verification
How this fits togetherTeam Reports collects GitHub and optional Discord activity into a worker-owned SQLite scratch table. The worker orders that activity and supplies bounded payload batches to daily report generation. flowchart LR
A[GitHub and Discord activity] --> B[Worker collection]
B --> C[SQLite scratch table]
C --> D[Metadata ordering]
D --> E[Payload batches]
E --> F[Daily report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -9, Tests +72. Total +63 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the single metadata read in the existing Team Reports SQLite worker while preserving its ordering and bounded payload decoding. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows repeated metadata pages, and the PR body gives a concrete SQLite-backend benchmark for the same aggregation path; this review did not execute it. Is this the best way to solve the issue? Yes. The change removes redundant reads within the existing worker while retaining the sorting and payload limits already used by reports. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fb3d7c33a716. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash auto-merge.
|
…159148) * improve(team-reports): reduce activity aggregation queries * test(team-reports): observe native statement reads directly * test(team-reports): count reads across SQLite execution paths
What Problem This Solves
Team Reports aggregation repeatedly fetches small metadata pages even though it must retain all of that metadata before sorting activity.
User Impact
Aggregation performs fewer SQLite queries while producing the same reports. Payload reads remain limited to 100 rows, and no migration or configuration change is required.
Why This Change Was Made
Read compact activity metadata once per source, preserving its initial key order and the existing JavaScript collation. Keep comment/message payloads in their existing bounded batches. This removes redundant pagination without changing the worker owner or retaining additional payloads.
Evidence
iterate()andall()paths. Scoped lint and extension test typechecking pass.