Skip to content

fix(github): reserve App quota for privileged operations - #1034

Merged
steipete merged 1 commit into
mainfrom
codex/router-public-comment-read-20260805
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/router-public-comment-read-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Why

Production routers and review admission repeatedly fail with HTTP 403 for GitHub App installation 122230863 because public reads share the limited installation quota required for bot authorization and mutations.

Change

  • Route only read-only REST requests for the exact public openclaw/openclaw issue and PR endpoints through the existing workflow token.
  • Keep private repositories, explicit credentials, GraphQL, collaborator checks, actor verification, every mutation, and every untrusted subprocess on their original credential boundaries.
  • Use the workflow token only for the public pre-review live-item check; keep reviewer execution and bot writes on scoped App tokens.
  • Preserve all existing workflows and avoid a dashboard Worker deployment.

Verification

  • 129 focused router, workflow, security, and environment tests passed.
  • 42 independent adversarial credential-boundary cases passed.
  • Main and repair TypeScript builds, lint, formatting, and an independent security review passed.
  • Production baseline before this fix: 50 throttle-deferred reviews and 62 publication retries versus six resolutions over 15 minutes.

@steipete
steipete requested a review from a team as a code owner August 5, 2026 14:06
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:12 AM ET / 14:12 UTC.

ClawSweeper review

What this changes

The PR routes allowlisted read-only OpenClaw issue and pull-request REST calls through the workflow token while retaining GitHub App credentials for mutations and privileged checks.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

This PR remains necessary: current main still uses the ambient GitHub credential for shared CLI calls, while the branch adds a narrowly allowlisted public-read token path. Static review found no correctness defect, but merge should wait for redacted after-fix workflow proof and the required OpenClaw Bay impact statement.

Priority: P1
Reviewed head: 055cf59823b0f3ffd7cc3ca69d6e16db8e9654c4

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused, well-covered credential boundary is promising, but real after-fix workflow proof is still a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports focused tests and security review, but it does not include after-fix evidence from a real workflow or production-path trace; add redacted runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports focused tests and security review, but it does not include after-fix evidence from a real workflow or production-path trace; add redacted runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main gap: Current main passes the ambient GitHub CLI environment directly to synchronous and asynchronous text requests; the PR introduces the new command-specific credential selector, so the requested quota isolation is not already implemented on main.
Narrow read-only allowlist: The branch only substitutes the public token when the command is a GitHub REST call to OpenClaw issues or pulls, has no input or explicit credential, rejects non-GitHub hosts and path traversal/encoding tricks, and permits only pagination or jq flags.
Mutation identity preserved: The comment-router workflow retains the App token as GH_TOKEN and supplies the public token separately for both initial and retry routing invocations.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s workflow reads live GitHub items before routing reviews and then performs authorized publication or repair actions. This change separates public OpenClaw read traffic from the App-token path that downstream privileged operations use.

flowchart LR
A[GitHub workflow event] --> B[Live item and comment routing]
B --> C[Credential selection]
C --> D[Allowlisted public OpenClaw reads]
D --> E[Review and repair routing]
E --> F[GitHub App mutations]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports focused tests and security review, but it does not include after-fix evidence from a real workflow or production-path trace; add redacted runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR has no redacted after-fix production-path trace showing public reads recover while privileged operations retain the App identity.
  • Resolve merge risk (P1) - The PR body does not state whether OpenClaw Bay is affected, as required for workflow and review-publication changes.
  • Complete next step (P2) - The PR owner needs to supply real behavior proof and the Bay-impact declaration; no safe automated repair is indicated.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change size production +49/-3, tests +121/-1 Most growth is focused boundary coverage around a small shared credential-selection change.
Credential-routing surfaces 2 workflows and 1 shared GitHub CLI helper changed The change spans both direct review admission and comment-router execution paths.

Merge-risk options

Maintainer options:

  1. Add production-path proof before merge (recommended)
    Provide a redacted after-fix workflow trace that demonstrates public reads use the workflow token while mutation and authorization paths remain on the App token.

Technical review

Best possible solution:

Keep the strict allowlist, add a redacted after-fix Actions trace proving the credential split and recovery, and record that Bay is unaffected because no Bay data contract or observer surface changes.

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

No: the reported quota exhaustion has a stated production baseline, but this review did not receive a current after-fix runtime trace or execute a live workflow.

Is this the best way to solve the issue?

Yes, with proof pending: a deny-by-default allowlist that preserves explicit credentials and all mutation paths is the narrowest maintainable split; it needs production-path evidence before landing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4dc8d1d8c533.

Labels

Label changes:

  • add P1: The PR targets repeated production review-admission and publication failures caused by GitHub App quota exhaustion.
  • add merge-risk: 🚨 security-boundary: It changes which credential authenticates GitHub API requests, so the allowlist must remain constrained to public read-only operations.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests and security review, but it does not include after-fix evidence from a real workflow or production-path trace; add redacted runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The PR targets repeated production review-admission and publication failures caused by GitHub App quota exhaustion.
  • merge-risk: 🚨 security-boundary: It changes which credential authenticates GitHub API requests, so the allowlist must remain constrained to public read-only operations.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests and security review, but it does not include after-fix evidence from a real workflow or production-path trace; add redacted runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main gap: Current main passes the ambient GitHub CLI environment directly to synchronous and asynchronous text requests; the PR introduces the new command-specific credential selector, so the requested quota isolation is not already implemented on main. (src/repair/github-cli.ts:153, 4dc8d1d8c533)
  • Narrow read-only allowlist: The branch only substitutes the public token when the command is a GitHub REST call to OpenClaw issues or pulls, has no input or explicit credential, rejects non-GitHub hosts and path traversal/encoding tricks, and permits only pagination or jq flags. (src/repair/github-cli.ts:252, 055cf59823b0)
  • Mutation identity preserved: The comment-router workflow retains the App token as GH_TOKEN and supplies the public token separately for both initial and retry routing invocations. (.github/workflows/repair-comment-router.yml:197, 055cf59823b0)
  • Boundary test coverage: The focused test exercises allowed issue/pull read paths and rejects collaborator checks, foreign repositories, encoded traversal, write flags, request bodies, host overrides, and explicit credentials. (test/repair/github-cli.test.ts:46, 055cf59823b0)
  • Feature-history provenance: Git history shows the shared GitHub CLI helper was introduced in the recent safe-closure work, and blame attributes the new selector to this PR commit. (src/repair/github-cli.ts:252, 0319bd567b5a)
  • Proof gap: The PR body reports test and baseline results, but it contains no redacted after-fix workflow trace showing the intended credential split and successful recovery. (055cf59823b0)

Likely related people:

  • Peter Steinberger: Introduced the shared GitHub CLI helper in the recent safe-closure work and authored the current credential-routing change. (role: shared GitHub CLI contributor and recent area author; confidence: high; commits: 0319bd567b5a, 055cf59823b0; files: src/repair/github-cli.ts, test/repair/github-cli.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted post-change Actions trace showing the read/mutation credential boundary and successful recovery.
  • State in the PR body that OpenClaw Bay is unaffected and why.

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.

@steipete
steipete merged commit a47ccba into main Aug 5, 2026
18 checks passed
@steipete
steipete deleted the codex/router-public-comment-read-20260805 branch August 5, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant