Skip to content

fix(review): avoid admission delays when Actions quota is exhausted - #1598

Merged
vincentkoc merged 3 commits into
mainfrom
fix/exact-review-admission-20260916
Sep 17, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/exact-review-admission-20260916

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes exact reviews being deferred for 20 minutes when the repository Actions quota is exhausted even though the existing target App credential can perform the admission read.

User Impact

Eligible public reviews can continue after one successful fallback read. Private targets retain their App credential requirement; later optional reads still warn and follow the existing admission behavior.

Why This Change Was Made

The live-item workflow now uses the existing workflow CLI and GitHub read owner in one process, so its single fallback allowance covers the whole admission. The pure scheduled no-op classifier moves into the compiled source owner and its obsolete script wrapper is removed. Branch, missing-item, locked-item, and oversized-PR decisions retain their existing contracts.

The proof runtime owns its dependency copies and removes them on success or failure. Rename-aware production/workflow growth is seven lines; that establishes the shared admission lifetime without adding another token-selection policy.

This branch now includes main through 4057a611890e, including the dispatched-credential attribution fix in #1600. No additional production composition change was needed. Both operational changelog entries are preserved.

OpenClaw Bay Impact

No Bay change is needed. Admission outputs, retry kinds, publication records, and dashboard schemas are unchanged. The proof checks the existing output and decision contracts.

Documentation Impact

Reviewed docs/target-dispatcher.md and docs/github-egress-telemetry.md. Existing provisioning, credential scopes, and durable queue contracts remain accurate. Added an operational changelog entry.

Evidence

  • Current signed head: 387af5acf9a9ba503239b2ff9b06e1f46c0b4228; tree 185aba260b16045d0a7b7a8f47b53f29756a9d66; qualification base 4057a611890e04cf3fc106ce6ce7a168ddbfa148.
  • Fresh AWS Crabbox run run_8563a18d575e passed the paired 65-case workflow proof and corepack pnpm run check: 6,281 passed, 19 platform skips, zero failures or cancellations (6,300 tests total). Format, lint, builds, static checks, and coverage gates passed.
  • All 16 tracked proof inputs were verified against the integration index before the signed commit and against committed blobs afterward. The committed tree exactly matches the qualified tree.
  • Fresh native Codex review before commit and again on committed head against exact main. Committed review found no actionable regressions in admission logic, credential fallback, or workflow integration (log SHA-256 bccb5d8baeb07e5bec484c4ede7c80174e059bd50bf666b95182a0f343792024). The inherited scanner finding from the precommit integration review is explicitly dispositioned below. Runtime proof was executed separately on the isolated AWS lease.
  • Hosted checks must qualify the current head. Earlier-head CI and the September 16 durable review are historical evidence only.

Real Behavior Proof

Claim/surface: execute the frozen main live-item YAML command and the candidate compiled workflow CLI through the existing GitHub read/retry owner, preserving one admission-wide App fallback and the admission decision contracts.

Paired workflow proof: 65 scenarios passed on the integrated tree. Baseline Actions issue HTTP 429 produces the existing 20-minute defer. Candidate Actions issue 429 → App issue success → Actions pull 429 → Actions comments 429 returns proceed=true and both optional-read warnings without a second App fallback. Coverage also includes public missing-App reads, private missing-App rejection despite an ambient token, repository-access/404 distinctions, five-minute branch deferral, paginated comments, closed/locked/no-op decisions, and oversized artifacts.

Command/environment: node scripts/e2e/exact-review-noop-read-scope.mjs --build --baseline-capsule .artifacts/exact-review-admission-baseline-composed-20260917.json --output .artifacts/exact-review-admission-proof-composed-20260917.json, followed by corepack pnpm run check, on one isolated AWS Crabbox lease with Node 24.18.1, pnpm 12.4.1, and Bash 5.3.9. Its physical dependency install used corepack pnpm install --frozen-lockfile. The baseline capsule was verified against main 4057a611890e04cf3fc106ce6ce7a168ddbfa148; a normal Git checkout can use --baseline 4057a611890e04cf3fc106ce6ce7a168ddbfa148.

Real GitHub CLI transport proof

Native AWS Crabbox run run_aef70d479036 passed at 2026-09-17T03:07:10.504Z using unmodified GitHub CLI 2.46.0, the compiled candidate, and the exact frozen baseline shell. Exit 0; command 4,425 ms, total 4,554 ms, sync skipped. The source, compiled files, and dependencies remained unchanged.

Case Real-client request sequence Observed admission
Frozen main baseline, 105 ms Actions GET issues/41 → 429 proceed=false, admission_retry=true, retry_kind=throttle; 20-minute defer
Candidate recovery, 152 ms Actions GET issues/41 → 429; App GET issues/41 → 200; Actions GET pulls/41 → 429 proceed=true, admission_retry=false; optional PR-metadata warning; exactly one App fallback; later failure attributed to repository_actions
Candidate, both pools exhausted, 122 ms Actions GET issues/41 → 429; App GET issues/41 → 429 proceed=false, admission_retry=true, retry_kind=throttle; 20-minute defer attributed to target_app

The six GETs used synthetic item 41 on a loopback TLS fixture. Method, host, TLS SNI, endpoint, credential role, order, request count, native error text, and the absence of a second fallback were asserted. All three children exited naturally with stdout/stderr EOF. Each tunnel had both natural read EOF and write completion, zero queued bytes, and no socket error before the scenario was accepted.

Fixture lifecycle qualification: a separate deterministic canary used the same tunnel owner. The server sent EOF first; only after receiving that EOF did the client send its 59,392-byte tail. Exact prefix/tail bytes and hashes matched, and both tunnel halves plus all scenario sockets closed naturally. The fixture preserves independent half-closes and treats socket errors, premature close, or a two-second settlement timeout as fatal.

Isolation/command: crabbox run --id <owned-lease> --no-sync --no-hydrate --keep --timing-json --script <reviewed-proof-script>. A separate network namespace exposed only loopback and no external routes. The real-gh CONNECT proxy accepted only api.github.com:443 and connected only to the local TLS fixture. It used fake tokens, a cleared environment, a read-only source mount, and an invocation-scoped fixture CA with certificate validation enabled. The private fixture and owned children were removed/closed after proof.

Exact proof identities and source binding
  • Paired workflow receipt .artifacts/exact-review-admission-proof-composed-20260917.json: 111,716 bytes; SHA-256 a3eba1b4bc11a91d7ca6dcf47564d32ba37a6c69d42aec0863cd05ddd70a286a.
  • Real-gh receipt .artifacts/exact-review-admission-real-gh-halfclose-20260917.json: 17,289 bytes including final LF; SHA-256 3fce4352e2b327497cbad921227fc7f9be1fdb64442c2344f1a037afb61aaec0.
  • Full-check log SHA-256: 679c32870674197dd4d40f70497178b7f0e0e83d8b80276b86e116b0e483cc90.
  • Reviewed real-gh proof script SHA-256: c76df7d4266faf9dc78c3a47943cb00b91026820cfdc0e8eb57e3abe5991a70f.
  • Real gh binary SHA-256: 80671b8dab3e41893f3e338fb104c997a390b0a51fafc34eb30048e2df99ab54.
  • Source tree digest: 5b05a34bbdf901d7dda104e221320b9a78dd90474e22fb4d20c803df5c3be624; runtime config digest: 0fe6611b9697a790fcb8f998ac274071e259d8be17a351db60db2eac2d0d4863; compiled digest: 0b33e8604379131879be8c997f971dab0b5db168979415135a5081314ad3322d.
  • Exact main baseline shell: 79c98f9192de1320c4ce82918ecac6bbd6a0aaa6ca5117fa0cc91ba4ba6676c3; capsule: 8b444242e975b97f10f870b0ce37e70d7cd75495aa3869ba7f7e31c6cd3b1d89.
  • Compiled admission owner: 571492daeae0350a00dc3de5db5b7b44fac6b0e314f48257594f0706f9062839; workflow CLI: 19947a163d9b1d00f33905fd0e41506ce6539cbd09a7e02c1c5ea7416b9d4c90.

The bound owner inputs include src/repair/github-cli.ts (a955c4cb0680b1856d67dd1226ea866894d65b127fb8e1d1649df759d7facc4b) and src/github-retry.ts (cd988d2e48c23847d5bbe95b0a4bea7f04c5344b7cb29e66cffedcaf66aecd51), so the proof covers the credential-attribution composition from #1600.

The receipts truthfully identify the precommit integration tree. Signed commit 387af5acf9a9ba503239b2ff9b06e1f46c0b4228 has exactly that tree; all tracked proof input hashes were checked against its committed blobs.

Failed-fixture disposition: preceding composed run run_5af80d6fc3d9 stopped on the fixture proxy's EPIPE before accepting a scenario; it is not proof or evidence of a vendor quota failure. The reviewed successor repaired the fixture-owned half-close and peer-destruction lifecycle, added the deterministic canary, and passed once with strict error and cleanup guards retained. No production code was changed for this fixture repair.

Limits: the real client received controlled TLS responses; this was not live GitHub quota exhaustion or a production-capacity measurement. Installed gh 2.46.0 lacks --slurp, so the additional real-client proof does not exercise paginated comments; the 65-case workflow proof covers their argument/decision contract. The full suite retains 19 platform-specific skips. This qualification did not change production queues or deploy services.

Review Finding Disposition

The precommit integration review found an inherited scanner issue: after a Git-metadata proof masks an index OID, replaying an otherwise approved URI finding from that same patch section can fail with material_not_reviewed. The reviewed reproduction classified the URI alone, then required metadata proof for mixed findings, then refused the replay because the masked patch no longer supplied the original witness.

This belongs to the scanner proof owner and is being handled in a separate scanner-qualification follow-up. src/agent-input-scan.ts has the same Git blob 3a0f67ea3d9453b893378bb50001a327f15a5967 in main 4057a611890e04cf3fc106ce6ce7a168ddbfa148 and this branch; its masking/replay path at lines 725–729 is outside the admission delta. The scanner, patch-witness, and fixture modules have no diff against that main. Keeping the repair separate avoids expanding this admission change or treating the inherited finding as silently resolved.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 11:13 PM ET / September 17, 2026, 03:13 UTC (Revision 4).

ClawSweeper review

What this changes

Moves the pre-review admission check into the shared workflow CLI so eligible throttled reads can use one scoped App-token fallback while preserving existing admission decisions.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still defers admission when the Actions credential is throttled. The reviewed patch has no actionable correctness findings, and the supplied current-head transport proof supports the intended recovery.

Priority: P2
Reviewed head: 387af5acf9a9ba503239b2ff9b06e1f46c0b4228

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused integration with strong composed transport evidence, preserved behavior coverage, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The supplied current-head AWS trace exercises the compiled admission owner through real gh against controlled TLS faults: baseline defers, one App fallback recovers, and exhausted pools still defer. The 65-case harness supplements this with admission and private-credential guards; no live quota-capacity or real-client pagination claim is made.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The supplied current-head AWS trace exercises the compiled admission owner through real gh against controlled TLS faults: baseline defers, one App fallback recovers, and exhausted pools still defer. The 65-case harness supplements this with admission and private-credential guards; no live quota-capacity or real-client pagination claim is made.
Evidence reviewed 8 items Repository policy: Read the complete root AGENTS.md and applied its narrow-change, proof, review-continuity, and Bay-impact guidance. No nested AGENTS.md or maintainer-notes directory was found.
Current main still needs admission recovery: Main's live-item step invokes gh directly with the Actions credential for OpenClaw and emits a 20-minute throttle deferral. The existing shared fallback is therefore not sufficient without this workflow integration.
Admission and credential boundaries: The new admission owner uses one process and the existing GitHub read helper. Non-core targets require the App credential before I/O; repository metadata keeps its explicit credential. The unchanged public-read classifier restricts fallback eligibility to read-only OpenClaw issue/pull endpoints.
Findings None None.
Security None None.

How this fits together

Exact-review admission checks a claimed GitHub item before ClawSweeper spends review capacity. GitHub state and credential availability determine whether the workflow proceeds, defers, or completes without a review.

flowchart TD
  A[Claimed review item] --> B[Admission check]
  B --> C[GitHub read]
  C --> D{Eligible public throttle?}
  D -->|Yes| E[One scoped App fallback]
  D -->|No| F[Evaluate item state]
  E --> F
  F --> G[Proceed, defer, or complete]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Net code growth Production/workflow +7 lines; tests/proof +292 lines Rename-aware growth establishes one admission-wide fallback lifetime, with most added code devoted to qualification.
Behavior qualification 65 workflow scenarios; 3 real-gh transport scenarios The supplied evidence covers preserved admission decisions and actual-client throttle recovery.

Technical review

Best possible solution:

Keep admission on the shared bounded read owner while retaining private-target credential requirements and existing queue outcomes.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main source directly defers on the mandatory Actions-token throttle, and the supplied frozen-main transport trace demonstrates that path; this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes. Reusing the existing read owner avoids a competing credential policy, and the preserved decisions plus composed transport evidence support this narrow integration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4057a611890e.

Labels

Label justifications:

  • P2: Repairs avoidable 20-minute review deferrals under Actions throttling with a bounded operational change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The supplied current-head AWS trace exercises the compiled admission owner through real gh against controlled TLS faults: baseline defers, one App fallback recovers, and exhausted pools still defer. The 65-case harness supplements this with admission and private-credential guards; no live quota-capacity or real-client pagination claim is made.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied current-head AWS trace exercises the compiled admission owner through real gh against controlled TLS faults: baseline defers, one App fallback recovers, and exhausted pools still defer. The 65-case harness supplements this with admission and private-credential guards; no live quota-capacity or real-client pagination claim is made.

Evidence

What I checked:

  • Repository policy: Read the complete root AGENTS.md and applied its narrow-change, proof, review-continuity, and Bay-impact guidance. No nested AGENTS.md or maintainer-notes directory was found. (AGENTS.md:1, 387af5acf9a9)
  • Current main still needs admission recovery: Main's live-item step invokes gh directly with the Actions credential for OpenClaw and emits a 20-minute throttle deferral. The existing shared fallback is therefore not sufficient without this workflow integration. (.github/workflows/sweep.yml:795, 4057a611890e)
  • Admission and credential boundaries: The new admission owner uses one process and the existing GitHub read helper. Non-core targets require the App credential before I/O; repository metadata keeps its explicit credential. The unchanged public-read classifier restricts fallback eligibility to read-only OpenClaw issue/pull endpoints. (src/repair/exact-review-admission.ts:13, 387af5acf9a9)
  • Current-head real-client evidence: The complete supplied PR body records AWS Crabbox run run_aef70d479036 using unmodified gh 2.46.0 and controlled loopback TLS responses. Baseline issue 429 defers; candidate Actions 429 → App 200 proceeds despite a later Actions metadata throttle; both pools returning 429 retain deferral. Six GETs, credential roles, request counts, natural child exits, and tunnel completion were asserted. Receipt SHA-256: 3fce4352e2b327497cbad921227fc7f9be1fdb64442c2344f1a037afb61aaec0. This is supplied transport evidence, not a reviewer-executed run or live quota-capacity measurement. (387af5acf9a9)
  • Proof binding and supplemental validation: Verified checkout tree 185aba260b16045d0a7b7a8f47b53f29756a9d66 matches the supplied qualification identity. The body reports 65 workflow scenarios and 6,281 passing tests with 19 platform skips in AWS run run_8563a18d575e. Inspected harness coverage includes private missing-App rejection, single-fallback exhaustion, branch retries, missing/locked/closed items, pagination, and oversized admission. Real-gh pagination remains outside the transport proof. (scripts/e2e/exact-review-noop-read-scope.mjs:259, 387af5acf9a9)
  • Related merged work is complementary: GitHub confirms fix(router): fall back when public reads are throttled #1054 merged the shared fallback and fix(github): report the correct credential for CLI throttles #1600 merged credential attribution. Neither replaces the admission integration. The latter is already included in the pinned base and candidate. (src/repair/github-cli.ts:40, 4057a611890e)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-16T08:53:46.708Z sha 8946dcf :: needs changes before merge. :: none
  • reviewed 2026-09-16T09:09:29.566Z sha 8946dcf :: needs changes before merge. :: none
  • reviewed 2026-09-16T09:27:00.079Z sha 8946dcf :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review September 16, 2026 09:05
@vincentkoc
vincentkoc requested a review from a team as a code owner September 16, 2026 09:05
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. proof: sufficient Contributor real behavior proof is sufficient. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 16, 2026
@vincentkoc
vincentkoc merged commit ab35b4b into main Sep 17, 2026
16 of 18 checks passed
@vincentkoc
vincentkoc deleted the fix/exact-review-admission-20260916 branch September 17, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant