Skip to content

feat(review): CPU-aware default --jobs + --rate-limit-per-minute#89

Merged
steipete merged 5 commits into
openclaw:mainfrom
coletebou:pr/jobs-rpm
May 22, 2026
Merged

feat(review): CPU-aware default --jobs + --rate-limit-per-minute#89
steipete merged 5 commits into
openclaw:mainfrom
coletebou:pr/jobs-rpm

Conversation

@coletebou
Copy link
Copy Markdown
Contributor

Summary

Two ergonomics improvements for clawpatch review:

  1. CPU-aware default --jobs: today defaults to a hard 10, which is hot for laptops and saturates Bedrock RPM quotas. New default: min(max(floor(cpus/2), 1), 10). Explicit --jobs <n> is honored unchanged (32-cap preserved).

  2. New --rate-limit-per-minute <n> (env CLAWPATCH_RPM): rolling-60s-window cap on provider invocations across all jobs. Off by default — fully backwards-compatible. The real bottleneck on most hosted LLMs is RPM, not local CPU.

Files

  • src/rpm-limiter.ts (new) — createRpmLimiter (serialized rolling-timestamp queue with injectable clock), rpmFromFlag (flag > env), defaultJobs(cores)
  • src/app.tsreviewJobs(flags, coreCount?) exported, CPU-aware default; worker loop calls await limiter.acquire() before each reviewFeature
  • src/cli.ts — new flag registered in commandFlags.review and valueFlagNames
  • src/rpm-limiter.test.ts (new), src/review-jobs.test.ts (new) — 14 cases including a fake-clock delay path

Validation

  • pnpm format:check — clean
  • pnpm typecheck — clean
  • pnpm lint — clean
  • pnpm build — clean
  • pnpm test — 555 passed, 1 skipped

Notes

Default behavior changes (lower --jobs on small machines), so this is a minor-bump candidate. Operators on 16+ core CI runners are unaffected.

Replaces the hardcoded `--jobs 10` default with `floor(cpuCores / 2)`
clamped to `[1, 10]`, so a 4-core box stops fanning out 10 parallel
Bedrock streams it cannot sustain. Explicit `--jobs <n>` is honored
unchanged (still capped at 32).

Adds `--rate-limit-per-minute <n>` (and `CLAWPATCH_RPM` env var) which
caps provider invocation starts within any rolling 60s window across
all jobs. Default unset preserves prior behavior. Implementation is a
serialized rolling-timestamp queue shared by all workers; the (N+1)th
acquire sleeps until the oldest slot expires.

Tests cover the CPU-aware default, explicit override, RPM no-op when
unset, and the rolling-window delay path under a fake clock.
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label May 21, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 21, 2026

Codex review: needs real behavior proof before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • 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.

Summary
Review failed before ClawSweeper could summarize the requested change.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

PR rating
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Summary: PR readiness rating was not assessed because the Codex review failed.

What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

Real behavior proof
Not applicable: Real behavior proof was not assessed because the Codex review failed.

Risk before merge

  • No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
Review did not complete, so no work-lane recommendation was made.

Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

Label changes:

  • add rating: 🌊 off-meta tidepool: Current PR rating is 🌊 off-meta tidepool because proof is 🌊 off-meta tidepool, patch quality is 🌊 off-meta tidepool, and PR readiness rating was not assessed because the Codex review failed.

Label justifications:

  • rating: 🌊 off-meta tidepool: Current PR rating is 🌊 off-meta tidepool because proof is 🌊 off-meta tidepool, patch quality is 🌊 off-meta tidepool, and PR readiness rating was not assessed because the Codex review failed.

What I checked:

  • failure reason: timeout.
  • codex failure detail: Codex review failed for this PR: spawnSync codex ETIMEDOUT.
  • codex stdout: Per-item Codex failure; continuing with the rest of the shard.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)

Codex review notes: model gpt-5.5, reasoning high; reviewed against b93473fe446a.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 21, 2026

ClawSweeper PR egg

🥚 Incubating: this PR egg is tucked into the review nest.

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.
What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@steipete steipete requested a review from a team as a code owner May 22, 2026 09:45
@steipete steipete merged commit e15650a into openclaw:main May 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants