Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 6:06 AM ET / 10:06 UTC. ClawSweeper reviewWhat this changesThis PR makes Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessThe focused repair is correct and still necessary: current main retains permissive numeric-prefix parsing, while this branch rejects malformed lifetime text before it can resolve an approval. Keep this PR open until its required exact-head CI gate passes. Priority: P2 Review scores
Verification
How this fits togetherThe approvals CLI converts an operator’s resolution command into a Gateway request for a pending approval. An allow-always resolution may create a standing grant, so the CLI validates the lifetime before the Gateway records the decision. flowchart LR
A[Operator CLI command] --> B[Approval resolution CLI]
B --> C[Validate lifetime text]
C -->|invalid| D[CLI error]
C -->|valid or omitted| E[Gateway approval resolver]
E --> F[Recorded approval decision]
F --> G[Standing grant terms]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +68. Total +64 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the strict parser once exact-head CI is green, retaining the Gateway’s existing 1–3650 contract and the supplied real CLI boundary proof. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s Is this the best way to solve the issue? Yes. Reusing the canonical strict positive-integer parser at the CLI boundary fixes the producer-side coercion without changing the Gateway protocol, approval ownership, or stored grant terms. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against de64e911270f. 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
HistoryReview history (4 earlier review cycles)
|
00ee28c to
b0fea86
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Reuse the canonical strict parser and consolidate range validation without changing valid or omitted grant terms. Cover malformed and boundary input. Co-authored-by: qingminlong <[email protected]>
|
Maintainer revision and source-bound before/after evidence are now in the PR body. Contributor credit is preserved. The pending CI investigation is disclosed; no merge until the required gate passes. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The unchanged transform suite passed all six cases on Node 24.19 with two-CPU affinity (65.53 seconds), using the exact CI baseline compiler/test sources. Serial execution was slower and was rejected; no test or production changes were made. The isolated host differs from the CI runner, so the timeout cause remains unproven. One retry of the failed jobs on the unchanged head is now running: https://github.com/openclaw/openclaw/actions/runs/33493484114. Required CI must pass before landing. |
|
Required exact-head CI is green for Attempt 2 passed on the unchanged head. The earlier subprocess timeout and independent unchanged-suite proof remain documented; no test or timeout changes were made. |
|
Merged via squash.
|
* fix(cli): reject malformed approval grant lifetimes * fix(cli): validate whole approval grant lifetimes Reuse the canonical strict parser and consolidate range validation without changing valid or omitted grant terms. Cover malformed and boundary input. Co-authored-by: qingminlong <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: qingminlong <[email protected]>
What Problem This Solves
Fixes an issue where
approvals resolve --expires-in-dayssilently accepted a numeric prefix:10junkbecame 10 days and1.5became 1 day. The operator could resolve an approval with a lifetime different from the text supplied.Why This Change Was Made
The CLI now uses the shared strict positive-integer parser already used by the standing-grant list command. One validation block rejects a present invalid value or a value above the existing 3650-day limit. The parser already establishes positivity and integrality, so their duplicate checks are removed. Omitted lifetimes still defer to the existing Gateway behavior, and valid lifetimes are forwarded as numbers.
User Impact
Malformed, fractional, empty, non-positive, and out-of-range values produce the existing whole-day validation error before
approval.resolve. Scripts that relied on numeric-prefix coercion must pass the intended whole-day value explicitly. The existing 1–3650 range, approval decisions, grant ownership, configuration defaults, and Gateway protocol remain unchanged.Evidence
8655892bb20and stablev2026.8.1contain the permissive parser. Three new tests failed on the baseline because10junk,1.5, and1e3unexpectedly reached resolution; the other 25 cases passed.node scripts/run-vitest.mjs src/cli/exec-approvals-cli.pending-resolve.test.ts packages/normalization-core/src/number-coercion.test.tspassed all 58 tests after the fix. The CLI cases cover malformed inputs, the lower and upper bounds, a normal 30-day value, and omission of the override. Existing pending-list, decision, identity, and resolution cases remain covered.10junkand1.5to an isolated loopback Gateway and both pending approvals becameallowed. A valid30control also resolved successfully.--expires-in-days must be a whole number of days between 1 and 3650.Follow-upapproval.getandexec.approval.listcalls confirmed each approval remained pending and listed. The valid30control still resolved successfully.Representative command, using only an isolated test Gateway:
Owner and Scope
The CLI owns parsing operator text before it calls the unified approval resolver. The Gateway already validates
grantExpiresInDaysas an integer from 1 through 3650 and retains ownership of approval transitions and frozen grant terms. This change fixes the malformed value at its producer without changing those contracts.The permissive block was introduced by de12e0a06c1b; the raw parent and patch were checked directly. The sibling grant-list parser already uses the strict helper following #133361.
Production:
+4/-8(net −4). Tests:+68/-0. The latest ClawSweeper suggestion to consolidate redundant validation is applied. No new dependency, option, environment variable, auth policy, protocol, schema, or persistence behavior.Thanks @qingminglong for the original fix and reproduction.
Maintainer-reviewed head:
374502a71e3c7053834865c2ff5ca90b7d1fa2a2. Contributor credit is preserved.Exact-head CI exposed five 120-second subprocess timeouts in the existing Vitest worker-artifact transform suite. Investigation is in progress; this PR will remain open until the required gate passes. No timeout has been increased.