Skip to content

fix: keep PR identity checks working when GraphQL quota is exhausted - #153296

Merged
steipete merged 2 commits into
mainfrom
codex/pr-rest-writer-20260919
Sep 20, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/pr-rest-writer-20260919

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #153199.

What Problem This Solves

PR review and preparation stop at writer-identity preflight when GraphQL quota is exhausted, even if the same authenticated writer still has REST quota available.

User Impact

Writer checks and reviewer claims can proceed using REST/core quota. This does not make the entire landing workflow GraphQL-free: merge-queue state, squash previews, required-check app binding, and atomic publication keep their existing contracts.

Why This Change Was Made

One shared helper runs gh api user --include through the selected protected CLI and validates the REST response and process result before exposing the login. Included headers preserve the native writer route; ordinary pooled or saved-login responses cannot establish writer authority. All five identity consumers use this owner, including administrative checks and merge recovery.

Reviewer claims use the REST assignees endpoint and verify that GitHub actually returned the requested user. Existing credential selection, host binding, quota diagnostics, and merge-outcome handling remain intact. No custom HTTP client, credential extraction, or fallback to a different identity is added.

Evidence

  • Controlled preflight reproduction with exhausted GraphQL and available REST: the baseline fails; the candidate succeeds with one REST request and no GraphQL request.
  • 27 focused macOS identity cases pass, covering malformed responses, selected hosts/CLI overrides, quota exhaustion, and failure before mutation.
  • Live proof confirms the writer had zero GraphQL points remaining while the REST identity helper still returned the intended writer. The idempotent reviewer assignment also passed its live REST check; the returned assignment and readback were verified on the tracking issue.
  • Independent P0–P2 review passed with no actionable findings.
  • Blacksmith Testbox proof: 920 tests passed across 12 affected workflow files. The first static gate caught a shadowed callback parameter; after that naming-only fix, all four assignment cases and the complete changed-code gate passed. The final verified source tree was 7a168731a9e416cc3d1892bffbf8ee55988559c3, matching pre-rebase commit e1845dc4aee27e94263bd4daef40f478a13e861b. The retained wrapper summary reports exitCode: 0 and runStatus: succeeded; lease cleanup can make the linked Actions run show cancelled. The lease has been stopped.

Local broad proof hit a five-second Git fixture setup deadline before the changed entry point. Isolated tracing showed the unchanged 1,247-file staging command varying from 1.96 to 8.24 seconds under host filesystem load; interleaved base/candidate setup checks behaved similarly. No assertion, timeout, or staging scope was weakened. The remote run provides the broader proof.

Hosted CI follow-up

The first hosted CI run failed in two unchanged test areas. The shared-worker cleanup failure also reproduced on main and is repaired by merged #153286. The transcript producer failure reproduced locally in the original file order, together with two neighboring startup polls; merged #153336 replaces those one-second startup polls with capture lifecycle completion. Its complete producer and shutdown run passed all 53 tests, and its scoped checks, hosted CI, and independent review passed.

Both repairs are included in refreshed base 26505c528b50ff0fadd4d4df6e3a53d879f3f2bf. Rebase commit 3502ef47c05a4effc05b571cbe31881024682be8 preserves the reviewed REST patch exactly, verified by Git range-diff and stable patch hashes.

The refreshed CI run cleared both original failures and exposed only two stale acknowledgement-worker tests after #153083 deliberately prohibited claimless settlement of live claims. This PR now corrects their cleanup to use the captured owner and retains meaningful null/undefined transfer coverage by checking missing-row behavior. Production ownership checks are unchanged. All 36 acknowledgement-worker and storage tests, the complete scoped static gate, and independent P0–P2 review pass. Final-head CI passed for 514517d55841c3c6aa2795c37cd2236a711c0839. The native maintainer workflow merged this head as 883b2a9441654a0f4ea988cc9bfd209ed9a1be46.

@clawsweeper

clawsweeper Bot commented Sep 20, 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 00:41
@steipete steipete self-assigned this Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 10:34 PM ET / September 20, 2026, 02:34 UTC (Revision 5).

ClawSweeper review

What this changes

Moves PR writer identification and reviewer assignment to validated REST requests and updates workflow and acknowledgement tests.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main and in v2026.9.5. No actionable introduced defect was found, including in the acknowledgement-test follow-up.

Priority: P2
Reviewed head: 514517d55841c3c6aa2795c37cd2236a711c0839

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with relevant boundary coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository context identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports live REST writer identification under exhausted GraphQL quota and successful assignment/readback; inspected boundary coverage retains member and revoked-admin rejection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository context identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports live REST writer identification under exhausted GraphQL quota and successful assignment/readback; inspected boundary coverage retains member and revoked-admin rejection.
Evidence reviewed 9 items Shared identity owner preserves the selected CLI: The helper requests included-header REST identity through pr_gh_plain, preserves quota/access failures, and validates HTTP status, process success, and a nonempty login. The underlying selected-CLI and credential owner is unchanged.
Assignment verifies the observed result: Reviewer assignment resolves the repository and host through the existing locator, posts through the plain CLI route, and rejects responses that do not contain the requested assignee.
Administrative authorization remains separate from identity: The changed identity producer still feeds fresh active-admin membership checks. Existing boundary tests retain member rejection, successful admin dispatch, and revocation rejection before merge dispatch; these tests were inspected, not executed.
Findings None None.
Security None None.

How this fits together

OpenClaw’s maintainer scripts identify the authenticated GitHub writer before preparing, claiming, or landing PRs. That identity feeds assignment, administrative authorization checks, and recovery records.

flowchart TD
  A[PR workflow request] --> B[Selected GitHub CLI]
  B --> C[REST writer identity]
  C --> D[Validate response and exit status]
  D --> E[Reviewer assignment]
  D --> F[Fresh administrative checks]
  D --> G[Merge recovery record]
  F --> H[Permitted dispatch]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +48, Docs +3, Other +29. Total +80 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 11 189 141 +48
Docs 1 5 2 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 8 54 25 +29
Total 20 248 168 +80

Review metrics

Metric Value Why it matters
Production and test growth Production/tooling +29 net lines; tests/support +48 net lines Production growth provides the shared identity validator path and verified REST assignment without adding configuration or another credential owner.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #153199
Summary: This PR is the explicit implementation candidate for the open writer-identity quota report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Use one validated REST writer-identity owner while retaining fresh authorization checks and GraphQL operations whose contracts still require it.

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

Yes, source establishes that exhausted GraphQL quota blocks current-main authentication preflight despite available REST quota. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes, the patch reuses the selected CLI and response-validation owners, migrates all five identity consumers, and verifies assignment without replacing authorization or merge contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 42dcea5312ff.

Labels

Label justifications:

  • P2: This repairs a bounded quota-related interruption of maintainer PR workflows without a demonstrated product-runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository context identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports live REST writer identification under exhausted GraphQL quota and successful assignment/readback; inspected boundary coverage retains member and revoked-admin rejection.

Evidence

What I checked:

  • Shared identity owner preserves the selected CLI: The helper requests included-header REST identity through pr_gh_plain, preserves quota/access failures, and validates HTTP status, process success, and a nonempty login. The underlying selected-CLI and credential owner is unchanged. (scripts/pr-lib/github.sh:59, 514517d55841)
  • Assignment verifies the observed result: Reviewer assignment resolves the repository and host through the existing locator, posts through the plain CLI route, and rejects responses that do not contain the requested assignee. (scripts/pr-lib/github.mjs:351, 514517d55841)
  • Administrative authorization remains separate from identity: The changed identity producer still feeds fresh active-admin membership checks. Existing boundary tests retain member rejection, successful admin dispatch, and revocation rejection before merge dispatch; these tests were inspected, not executed. (test/scripts/pr-crabbox-merge-bypass.test.ts:597, 514517d55841)
  • Re-review delta preserves acknowledgement ownership: Compared with the previously reviewed head, only the acknowledgement-worker test changes. Cleanup now presents the captured claim; explicit null/undefined owners still reject a missing row, while an omitted owner remains idempotent, matching the production kernel. (src/infra/outbound/delivery-queue-ack.worker.test.ts:70, 514517d55841)
  • Current main still requires GraphQL identity: The fetched main revision retains the mandatory GraphQL viewer request in authentication preflight, so available REST quota cannot rescue that request. The linked open issue remains the canonical problem report: PR identity checks fail when GraphQL quota is exhausted despite available REST quota #153199. (scripts/pr-lib/worktree.sh:33, 42dcea5312ff)
  • Latest supplied release retains the same dependency: The v2026.9.5 worktree helper also requests GraphQL viewer identity; the requested REST replacement is not present there. (scripts/pr-lib/worktree.sh:27, ec9c1a13db89)

Likely related people:

  • 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 (4 earlier review cycles)
  • reviewed 2026-09-20T00:47:25.006Z sha e1845dc4aee27e94263bd4daef40f478a13e861b :: blocked before merge. :: none
  • reviewed 2026-09-20T01:32:46.027Z sha e1845dc4aee27e94263bd4daef40f478a13e861b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T01:49:25.561Z sha e1845dc4aee27e94263bd4daef40f478a13e861b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T02:09:34.389Z sha 3502ef4 :: needs maintainer review before merge. :: none

Use included-header REST identity reads through the protected selected CLI, preserving the actual mutation writer and quota diagnostics. Verify reviewer assignment through the REST assignees response. Keep GraphQL contracts for queue state, squash previews, required-check app binding, and atomic publication. Refs #153199.
@steipete
steipete force-pushed the codex/pr-rest-writer-20260919 branch from e1845dc to 3502ef4 Compare September 20, 2026 02:02
@steipete
steipete merged commit 883b2a9 into main Sep 20, 2026
179 checks passed
@steipete
steipete deleted the codex/pr-rest-writer-20260919 branch September 20, 2026 02:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 20, 2026
Carry the exact reviewed cleanup line from #153367, now covered by main #153296. Preserve the negative null and undefined ownership assertions. The postimage matches the canonical reviewed fixture and all four focused cases pass.
steipete added a commit that referenced this pull request Sep 20, 2026
Carry the focused ACK fixture repair from 883b2a9 (#153296). Use the acquired claim for cleanup and preserve explicit null/undefined owner checks after settlement.
steipete added a commit that referenced this pull request Sep 20, 2026
Carry only the delivery acknowledgement fixture correction from 883b2a9 (#153296). Preserve explicit null and undefined owner checks, use the acquired claim for cleanup, and keep omitted-owner acknowledgement idempotent after settlement.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…penclaw#153296)

* fix(scripts): use REST for writer identity and reviewer claims

Use included-header REST identity reads through the protected selected CLI, preserving the actual mutation writer and quota diagnostics. Verify reviewer assignment through the REST assignees response. Keep GraphQL contracts for queue state, squash previews, required-check app binding, and atomic publication. Refs openclaw#153199.

* test: preserve acknowledgement worker owner checks
steipete added a commit that referenced this pull request Sep 20, 2026
…quests (#152851)

* fix(github): keep publication options responsive with many pending requests

Stream and validate pending repository receipts on the existing shared-state worker, retaining the latest compact result. Revalidate current session and personal GitHub identity after the awaited read while preserving the non-repository fallback and canonical confirmation checks.

* test(codex): isolate turn-event fixture clocks

Use controlled clocks and an accepted-turn barrier for plan restoration and interrupted-completion fixtures. Keep the execution budget and assertions unchanged, and move the cases into a dedicated suite with the same database-worker routing.

* test: preserve acknowledgement worker owner checks

Carry only the delivery acknowledgement fixture correction from 883b2a9 (#153296). Preserve explicit null and undefined owner checks, use the acquired claim for cleanup, and keep omitted-owner acknowledgement idempotent after settlement.
steipete added a commit that referenced this pull request Sep 20, 2026
…read (#152319)

* refactor(skills): move usage and curator status SQL off the caller thread

* fix(skills): preserve worker errors and await usage test persistence

* fix: drain delivery queue maintenance during shutdown

* fix: keep Workshop event reads off the Gateway request thread

* test: isolate retired agent cleanup transport fixture (#153286)

* test(gateway): align curator checks with canonical lifecycle fixtures

Reuse the isolated cleanup fixture from #153286 and the held-terminal-write private completion fixture from #153226. Retain the curator cleanup await. The combined 36-case proof, targeted types/lint, and independent review pass; production is unchanged.

* test(outbound): clean up ACK fixtures with their owner

* test(outbound): clean up ACK fixtures with their captured owner

Carry the exact reviewed cleanup line from #153367, now covered by main #153296. Preserve the negative null and undefined ownership assertions. The postimage matches the canonical reviewed fixture and all four focused cases pass.

* test: join Doctor database cleanup before snapshots

* refactor(skills): consolidate workshop worker dispatch
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…quests (openclaw#152851)

* fix(github): keep publication options responsive with many pending requests

Stream and validate pending repository receipts on the existing shared-state worker, retaining the latest compact result. Revalidate current session and personal GitHub identity after the awaited read while preserving the non-repository fallback and canonical confirmation checks.

* test(codex): isolate turn-event fixture clocks

Use controlled clocks and an accepted-turn barrier for plan restoration and interrupted-completion fixtures. Keep the execution budget and assertions unchanged, and move the cases into a dedicated suite with the same database-worker routing.

* test: preserve acknowledgement worker owner checks

Carry only the delivery acknowledgement fixture correction from bee4ccd (openclaw#153296). Preserve explicit null and undefined owner checks, use the acquired claim for cleanup, and keep omitted-owner acknowledgement idempotent after settlement.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…read (openclaw#152319)

* refactor(skills): move usage and curator status SQL off the caller thread

* fix(skills): preserve worker errors and await usage test persistence

* fix: drain delivery queue maintenance during shutdown

* fix: keep Workshop event reads off the Gateway request thread

* test: isolate retired agent cleanup transport fixture (openclaw#153286)

* test(gateway): align curator checks with canonical lifecycle fixtures

Reuse the isolated cleanup fixture from openclaw#153286 and the held-terminal-write private completion fixture from openclaw#153226. Retain the curator cleanup await. The combined 36-case proof, targeted types/lint, and independent review pass; production is unchanged.

* test(outbound): clean up ACK fixtures with their owner

* test(outbound): clean up ACK fixtures with their captured owner

Carry the exact reviewed cleanup line from openclaw#153367, now covered by main openclaw#153296. Preserve the negative null and undefined ownership assertions. The postimage matches the canonical reviewed fixture and all four focused cases pass.

* test: join Doctor database cleanup before snapshots

* refactor(skills): consolidate workshop worker dispatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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.

PR identity checks fail when GraphQL quota is exhausted despite available REST quota

1 participant