Repository navigation
perf(pr): stop small reviews from spending uncached REST quota - #115199
Conversation
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 10:39 AM ET / 14:39 UTC. ClawSweeper reviewWhat this changesThis PR lets native pull-request review initialization use a complete cacheable GraphQL file list for small PRs, while retaining paginated REST collection for large, incomplete, or older-client responses. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep open for maintainer review. The submitted change is focused and its tests cover the intended cache-first and REST-fallback branches, with no concrete line-level defect established; however, this protected Likely related people: Priority: P3 Review scores
Verification
How this fits togetherThe native PR landing scripts obtain GitHub pull-request metadata before review and landing guards run. This change selects a complete cached GraphQL file list when possible, otherwise preserves the existing REST pagination path before handing normalized change data to those guards. flowchart LR
A[Pull request number] --> B[GitHub metadata request]
B --> C{Complete typed file list?}
C -->|Small and complete| D[Cached GraphQL files]
C -->|Large or incomplete| E[Paginated REST files]
D --> F[Normalized changed paths]
E --> F
F --> G[Review and landing guards]
Decision needed
Why: The patch modifies the metadata source used by native landing guards, and its supplied validation is mock/Testbox coverage rather than direct evidence from the real GitHub CLI and API path. Before merge
Agent review detailsSecurityNone. PR surfaceTests +68, Other +31. Total +99 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current Do we have a high-confidence way to reproduce the issue? Not applicable: this PR targets an internal GitHub quota and review-initialization path, not a user-reported product failure. The supplied focused tests reproduce the intended branch selection with a fake GitHub CLI. Is this the best way to solve the issue? Likely yes: using the cacheable file list only when it is complete and typed, while retaining exhaustive REST fallback, is the narrow maintainable approach. A live current-client run is still needed to confirm the dependency contract in practice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3fa4805563eb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: test(codex): de-flake attempt turn-watch timing tests (#115258) fix: preserve retryable ACPX lease ownership (#115247) fix: serialize ACPX lease ownership transitions fix: retain ACPX leases across wrapper reconnects refactor: parse ACPX lease command identity fix: preserve OpenClaw profile env in macOS launch-at-login plist (#99752) refactor(config): retire compaction truncateAfterCompaction gate (#115206) improve(ui): reduce duplicate chat startup work (#114743) fix(ui): keep reconnects, browser tabs, and localized search consistent (#115221) perf(pr): cache complete small file lists (#115199) perf(sqlite): skip no-op automatic schema repair (#115193) docs(browser): correct Docker sandbox setup (#115254) fix(ui): avoid duplicate session refreshes during startup (#114764) # Conflicts: # ui/src/pages/agents/panels-tools-skills.browser.test.ts
* origin/main: test(codex): de-flake attempt turn-watch timing tests (#115258) fix: preserve retryable ACPX lease ownership (#115247) fix: serialize ACPX lease ownership transitions fix: retain ACPX leases across wrapper reconnects refactor: parse ACPX lease command identity fix: preserve OpenClaw profile env in macOS launch-at-login plist (#99752) refactor(config): retire compaction truncateAfterCompaction gate (#115206) improve(ui): reduce duplicate chat startup work (#114743) fix(ui): keep reconnects, browser tabs, and localized search consistent (#115221) perf(pr): cache complete small file lists (#115199) perf(sqlite): skip no-op automatic schema repair (#115193) docs(browser): correct Docker sandbox setup (#115254) fix(ui): avoid duplicate session refreshes during startup (#114764)
What Problem This Solves
Fixes an issue where every
scripts/pr review-initbypassed the shared GitHub cache and spent direct REST quota to paginate changed files, even when the PR had only a handful of files andgh pr view --json filesalready returned the complete list. Exhausted direct quota then blocked the entire native landing workflow until reset.Why This Change Was Made
PR metadata now uses the cacheable GraphQL file list when the reported count is at most 100 and every file has the complete typed shape. Large, truncated, malformed, or older-CLI responses still fall back to the existing paginated REST path, with the same head-drift and count validation.
User Impact
Most PR review and landing initialization no longer spends uncached REST quota, reducing latency and avoiding quota stalls. Large PRs and incomplete client responses preserve the current exhaustive fail-closed behavior.
Evidence
pr_meta_json 115199returned the exact two-file typed GraphQL list while an instrumentation guard made anypulls/115199/filesREST call fail with exit 97. The command exited 0 and the guard never fired.939878c2348b2f4c5dbb6b6860c346b6e63fa2de; files:scripts/pr-lib/worktree.shandtest/scripts/pr-metadata.test.ts, bothMODIFIEDwith exact additions/deletions.changeTypefall back to REST instead of weakening deletion classification.pnpm test test/scripts/pr-metadata.test.ts— 6 passed on Blacksmith Testboxtbx_01kymc4jc055dfmpf8b9nfh7wd.pnpm check:changed— passed test-root typecheck, script lint, formatting, declaration contracts, and repository guards on the same Testbox.30361211077— green.gpt-5.6-sol, high) — first pass found and fixed the older-CLIchangeTypegap; final pass clean with no accepted/actionable findings.The branch remains behind
mainwithout conflicts. Per repository landing policy, behind-main drift is advisory;scripts/pr merge-runwill perform the strict App-owned test merge against currentmainrather than rewriting this already-green exact head solely for drift.