Repository navigation
fix(gateway): enforce control-plane limits on cron mutations - #128287
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 12:56 PM ET / 16:56 UTC. ClawSweeper reviewWhat this changesThe PR marks cron creation, update, removal, and manual execution RPCs as control-plane writes and adds regression coverage for their descriptor policy. Merge readinessKeep open: current main still omits the cron mutation classification, while the PR applies it at the canonical descriptor boundary and has no actionable correctness finding. The protected maintainer label and incomplete exact-head checks require normal maintainer merge handling. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway method descriptors define each RPC’s authorization and admission attributes before the Gateway dispatches its handler. Operator cron requests flow through that shared descriptor registry, where control-plane writes consume the per-method budget before mutating scheduled jobs. flowchart LR
A[Authenticated operator request] --> B[Gateway method descriptor]
B --> C[Control-plane write check]
C --> D[Rate-limit admission]
D --> E[Cron mutation handler]
E --> F[Scheduled job state]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +17. Total +17 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the four mutations in the canonical descriptor policy and land after exact-head CI confirms the existing budget is the intended compatibility boundary for cron automation. Do we have a high-confidence way to reproduce the issue? Yes—source inspection on current main shows the four cron mutations lack the descriptor flag, while the shared request envelope consumes the budget only when that flag is present. Is this the best way to solve the issue? Yes. The descriptor table is the canonical policy owner, and the existing Gateway envelope already enforces that policy before invoking the cron handler. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7941c05e44e5. 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
|
|
Land-ready evidence for
ClawSweeper disposition:
Rank-up moves: exact-head CI is complete. No separate supported burst cron client was identified; the shared envelope rate-limit regression is the canonical deterministic proof, so no client-specific live burst was manufactured. There is no UI-visible behavior to capture. |
|
Merged via squash.
|
Co-authored-by: Amp <[email protected]>
What Problem This Solves
Fixes an issue where authenticated operators could repeatedly add, update, remove, or manually run cron jobs without those mutating requests consuming the Gateway's control-plane write budget.
Why This Change Was Made
Classifies the four administrative cron mutations as control-plane writes at the canonical Gateway method-descriptor boundary. Read-only cron methods and agent-runtime scratch updates keep their existing admission behavior.
User Impact
Operators retain normal cron management behavior, while runaway or abusive cron mutation loops are now limited by the existing per-method control-plane budget instead of bypassing it.
Evidence
cron.addwas not classified as a control-plane write; both Gateway projects reproduced the failure.main:OPENCLAW_VITEST_MAX_WORKERS=4 node scripts/run-vitest.mjs src/gateway/server-methods-list.test.ts src/gateway/server-methods.control-plane-rate-limit.test.ts— 116/116 tests passed.node scripts/check-changed.mjs -- src/gateway/methods/core-descriptors.ts src/gateway/server-methods-list.test.ts— passed all selectedcore, coreTestschecks.