Repository navigation
fix(tokens): keep review hydration on the App bucket to balance read pools - #1064
Conversation
…pools PR #1062 moved the exact-event review runtime's reads (~30 calls per review, the largest single stream) onto the per-repo Actions token pool, which the comment router, dashboard CI, and support lanes already share. Concentrating both major read streams on one bucket exhausted it while the App installation bucket idled. Review hydration returns to the App read token; with apply-guard memoization and the router offload in place, the two pools now each carry roughly half the read load.
|
Codex review: needs real behavior proof before merge. Reviewed August 7, 2026, 10:11 PM ET / August 8, 2026, 02:11 UTC. ClawSweeper reviewWhat this changesThis PR moves exact-event review hydration back to the scoped GitHub App read token and updates workflow tests to expect that routing. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep open: the intended quota rebalance is valid, but the new direct App-token selection removes the existing recovery path when the App read-token mint fails. The workflow deliberately continues after that mint, so an otherwise admissible exact review can now fail at hydration instead of using its repository workflow token. Priority: P1 Review scores
Verification
How this fits togetherThe exact-event review workflow claims a queued item, hydrates its GitHub context for Codex, then publishes a review result. Its read credential selection affects both review-lane availability and the quota available to other repository automation. flowchart LR
A[Exact review queue] --> B[Claimed item]
B --> C[App read-token mint]
C --> D[Credential selection]
D --> E[GitHub hydration]
E --> F[Codex review]
F --> G[Published review]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep App-backed hydration as the normal path, but preserve a narrowly tested fallback for a failed App-token mint and add current-head controlled proof of both the normal and fallback paths. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: force the continue-on-error App-token mint to yield no token for an openclaw/openclaw exact review; current main has a workflow-token path, while this patch reaches Is this the best way to solve the issue? No: returning hydration to the App pool is appropriate, but the App-only expression unnecessarily removes the current availability fallback for a mint failure. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7a9d33bed755. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
The 450/h trim ducked App installation 403s at ~30 API calls per review. Apply-guard memoization (#1060) cut that per-item cost and the read-pool split (#1062/#1064) moved router and public reads onto the Actions token pool, so the App bucket now carries only memoized hydration and writes. Post-#1064 telemetry shows ~336 ok reviews/h with near-empty throttle backoff at the 450 cap; restoring the historical 600/h uses the recovered headroom.
What Problem This Solves
PR #1062 moved the exact-event review runtime's GitHub reads (~30 calls per review, the largest single read stream) from the App installation bucket onto the per-repo Actions
GITHUB_TOKENpool. That pool is already shared by the comment-router public reads (#1034), dashboard CI, and every support lane in this repository. Concentrating both major read streams on one bucket exhausted it: after the merge at 00:20Z, queue telemetry shows review successes collapsing (184/hr → 40/hr by 01:21Z), throttle-retry backoff climbing past 95 items, and activegithub_throttlealerts doubling — while the App installation bucket idles.The Fix
One line: review hydration returns to the App read token. With apply-guard read memoization (#1060) and the router/public-read offload (#1034, #1062) in place, the two pools now each carry roughly half the read load instead of one carrying all of it:
All other #1062 changes (runtime public-read seam, inspection-token hardening, small step flips) are unchanged.
Proof
/api/exact-review-queue(reservation-claim throttle alerts, review-lane flow rates).