Repository navigation
improve: reduce dashboard GitHub API reads - #382
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 5:37 AM ET / 09:37 UTC. Summary Reproducibility: not applicable. as a performance/operational PR rather than a bug report. Current-main source shows the existing direct reads, and the PR body includes live request-count proof for the changed path. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the narrow dashboard request cache and GraphQL batch hydration after normal maintainer review and required checks, preserving the REST fallback and focused dashboard-worker coverage. Do we have a high-confidence way to reproduce the issue? Not applicable as a performance/operational PR rather than a bug report. Current-main source shows the existing direct reads, and the PR body includes live request-count proof for the changed path. Is this the best way to solve the issue? Yes. The implementation is a narrow maintainable path: reuse one exact-path REST reader per snapshot and batch recent automerge detail hydration when authenticated while preserving the REST fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d3ad07b3efdd. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…s-cache # Conflicts: # dashboard/worker.ts
|
Landed in ebddd6c. The current-main rewrite keeps one exact-path REST cache per status snapshot, includes the newer apply-health and cluster-repair reads, and batches recent automerge hydration through GraphQL with the previous REST path as fallback. Proof on exact head
Thank you @brokemac79 for the original implementation and live-proof work. |
Cache exact GitHub REST reads within one dashboard status snapshot and hydrate recent automerge timing in one authenticated GraphQL batch with a REST fallback. Co-authored-by: brokemac79 <[email protected]>
What Problem This Solves
Resolves an operational problem where the ClawSweeper live dashboard spends extra GitHub API budget while building a status snapshot. Duplicate or per-item dashboard hydration can add latency and rate-limit pressure when the dashboard reads active workflow runs, live PR CI state, cluster repair metadata, recent closes, and automerge timing.
Why This Change Was Made
This adds a per-status-snapshot GitHub REST reader that memoizes exact API paths and passes it through the dashboard hydration paths that run during one snapshot. Authenticated recent automerge timing now hydrates the small search page with one GraphQL request instead of per-PR REST detail calls, while preserving the existing REST fallback when GraphQL is unavailable.
The current-main rewrite also routes the newer apply-health and cluster-repair marker reads through the same snapshot cache.
User Impact
Operators should see the same dashboard data with fewer redundant GitHub API requests during cache misses. That reduces rate-limit pressure and keeps dashboard status refreshes cheaper without changing the visible dashboard contract.
Evidence
Exact reviewed head:
69162849c609b4c4417302a1928062be7f6d7353node --test test/dashboard-worker.test.tspassed: 53/53.pnpm run checkpassed: build, lint, 599 unit tests, 595 repair tests, changed/full coverage, and formatting.patch is correct(0.85 confidence).Live dashboard status proof, redacted: ran the real
dashboard/worker.tsstatus handler locally against live GitHub API with a wrappedfetchthat counted GitHub paths. The token came fromgh auth tokenand was not printed. This proves the authenticated recent-automerge path hydrated four live automerge items with one search and one GraphQL request, instead of the previous2 * item_countREST PR/comment detail shape.{ "status": 200, "generated_at": "2026-07-04T09:22:32.804Z", "automerge_item_numbers": [99099, 99098, 89671, 92667], "automerge_samples": 4, "recent_automerge_search_requests": 1, "recent_automerge_graphql_requests": 1, "rest_detail_requests_for_automerge_items": 0, "previous_rest_detail_shape_for_same_items": 8, "duplicate_exact_rest_paths_observed": [], "graphql_operation_counts": { "WorkerTargetTitles": 2, "RecentAutomerge": 1 }, "github_call_count": 76 }