Repository navigation
fix(channels): reject blank integer channel add options - #145534
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 5:57 AM ET / 09:57 UTC (Revision 19). ClawSweeper reviewWhat this changesRejects explicitly blank integer options during channel account setup while preserving omitted integer settings and legacy text defaults. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and v2026.9.4 still silently discard explicitly blank legacy integer options. No actionable defect was found in the patch, and the retained real CLI evidence covers the changed behavior. Priority: P2 Review scores
Verification
How this fits togetherChannel setup translates CLI arguments and plugin metadata into account configuration. The forwarding layer distinguishes explicit arguments from defaults before the existing integer parser and guarded configuration writer run. flowchart TD
A[CLI arguments] --> C[Selected channel options]
B[Plugin metadata and defaults] --> C
C --> D[Distinguish explicit input from defaults]
D --> E[Validate integer input]
E -->|Invalid| F[Error without account changes]
E -->|Valid| G[Apply account configuration]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +48, Tests +104. Total +152 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep default-versus-explicit-input handling at CLI forwarding and let the existing integer parser reject invalid values before account configuration changes. Do we have a high-confidence way to reproduce the issue? Yes: a legacy plugin declaring an integer CLI option exposes the defect when that option is explicitly empty. Current-main source proves the bypass, and the contributor records a real before/after CLI run; this review did not execute it. Is this the best way to solve the issue? Yes: the patch repairs input forwarding and reuses the established parser while preserving omitted values, legacy text defaults, and modern plugin-owned setup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5594775538a3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (18 earlier review cycles; latest 8 shown)
|
5ed2def to
9d996c8
Compare
|
@clawsweeper re-review Added exact-head real behavior proof to the PR body (RED→GREEN CLI/Gateway transcripts). Please re-evaluate the needs-proof gate. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated the PR body with the additional exact-head real CLI controls you requested. Please re-check the needs-proof gate. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Pushed the legacy empty-default compatibility fix and refreshed exact-head proof: linked legacy plugin with |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
landpr-approve-admin-merge |
|
landpr-approve-admin-merge |
|
landpr-approve-unrelated-red |
|
landpr-approve-admin-merge |
|
landpr-approve-unrelated-red |
|
Thanks @hugenshen! Proof: The registered
|
What Problem This Solves
openclaw channels addaccepts an explicit empty legacy integer, silently leaves that field unchanged, and writes other account fields.Why This Change Was Made
The forwarding filter owns whether explicit input or a legacy default reaches setup. The existing integer parser owns validity. Registration supplies existing metadata; configuration keeps its guarded writer. Registration adds 23 lines; forwarding adds 25; validation is net zero.
Growth accepted under the owner's standing acceptance (2026-09-15).
User Impact
Blank integers fail before account changes. Omitted integers preserve settings; empty text defaults and valid integers still apply.
Evidence
Retained proof ran at
7364d02a041c85c958913719a1d9d6666955ee79, a merge of contributorb18936426675with main1be9b8013411. Production is unchanged by the test correction.pnpm openclaw channels add --channel legacy-int --token fixture-token --limit ''Baseline: exit 0; the integer stays unchanged while other fields change. Tested head: exit 1 with
--limit must be a non-negative integer.; all configuration bytes unchanged. Fresh and existing accounts also pass omission, empty text default, whitespace rejection, and valid integer controls. Whitespace already rejects on main.Compatibility
Existing plugin metadata and modern setup contracts are unchanged. No migration or documentation change beyond the existing integer contract.
Consumers
Legacy channel CLI setup; modern parsing remains plugin-owned.
Invalidation
No new cache; metadata is scoped to command registration.
Tests
Retained runs passed 71 CLI, 83 command, and 11 setup-contract tests. The first invocation exited 1 only because its third filename did not exist; both owner suites passed. The corrected sibling invocation exited 0. No failed assertion was retried or weakened.
Removing one duplicate helper-only case leaves 70 CLI cases. All registered-command assertions and the real-signature mock remain intact.