Skip to content

fix(channels): reject blank integer channel add options - #145534

Merged
obviyus merged 7 commits into
openclaw:mainfrom
hugenshen:cursor/fix-channels-add-blank-int-e997
Sep 15, 2026
Merged

obviyus merged 7 commits into
openclaw:mainfrom
hugenshen:cursor/fix-channels-add-blank-int-e997

Conversation

@hugenshen

@hugenshen hugenshen commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw channels add accepts 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 contributor b18936426675 with main 1be9b8013411. 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.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 5:57 AM ET / 09:57 UTC (Revision 19).

ClawSweeper review

What this changes

Rejects 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
Reviewed head: f55ea988e514b5110b76194ba117c88713c0cad9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair with relevant real CLI evidence, compatibility controls, and no identified blocking defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The captured real CLI results exercise legacy option forwarding through account setup: blank integers fail with configuration bytes unchanged, while fresh and existing account controls succeed. The changed production files are identical to the retained proof revision.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured real CLI results exercise legacy option forwarding through account setup: blank integers fail with configuration bytes unchanged, while fresh and existing account controls succeed. The changed production files are identical to the retained proof revision.
Evidence reviewed 8 items Current main still contains the defect: The legacy input builder converts an explicit empty string to undefined before reaching the strict integer parser.
Latest release also retains the blank-input bypass: The release source contains the same empty-string bypass. The initial local release-object read failed; the GitHub contents API supplied the release source successfully.
Existing integer contract and validation owner: Plugin documentation defines valueType int as non-negative integer coercion. The patch preserves explicit blanks for the existing strict parser, while removing empty integer defaults during CLI forwarding; modern parsing remains plugin-owned.
Findings None None.
Security None None.

How this fits together

Channel 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +48, Tests +104. Total +152 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 61 13 +48
Tests 2 146 42 +104
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 207 55 +152

Review metrics

Metric Value Why it matters
Production versus test growth Production net +48 lines; tests net +104 lines Production growth carries existing integer metadata into forwarding to preserve legacy defaults without duplicating integer validation.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This repairs a bounded legacy channel-setup validation defect that can silently apply other account fields despite invalid integer input.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured real CLI results exercise legacy option forwarding through account setup: blank integers fail with configuration bytes unchanged, while fresh and existing account controls succeed. The changed production files are identical to the retained proof revision.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured real CLI results exercise legacy option forwarding through account setup: blank integers fail with configuration bytes unchanged, while fresh and existing account controls succeed. The changed production files are identical to the retained proof revision.

Evidence

What I checked:

  • Current main still contains the defect: The legacy input builder converts an explicit empty string to undefined before reaching the strict integer parser. (src/commands/channels/add.ts:90, 5594775538a3)
  • Latest release also retains the blank-input bypass: The release source contains the same empty-string bypass. The initial local release-object read failed; the GitHub contents API supplied the release source successfully. (src/commands/channels/add.ts, 3a9d69db306c)
  • Existing integer contract and validation owner: Plugin documentation defines valueType int as non-negative integer coercion. The patch preserves explicit blanks for the existing strict parser, while removing empty integer defaults during CLI forwarding; modern parsing remains plugin-owned. Public docs: docs/plugins/manifest/package-json.md. (docs/plugins/manifest/package-json.md:57, f55ea988e514)
  • Real CLI proof retained across production-identical revisions: The captured PR body records a linked legacy plugin run at 7364d02: explicit blank input changes from exit 0 with partial account updates to exit 1 with the integer error and unchanged configuration bytes. Fresh and existing account controls cover omission, empty text defaults, whitespace, and valid integers. Comparing all three changed production files against the reviewed head produced no diff. Captured context sourceRevision: 018ba103f0b219695619805808cf1203c5a4a42aa74614e7b2a93c1f9f70bc7e. (7364d02a041c)
  • Regression coverage protects forwarding and account writes: Registered CLI tests distinguish omitted integer defaults from explicit blanks and retain empty text defaults. The command regression extends malformed-input coverage to blank input and asserts neither plugin account application nor configuration writing occurs. Tests were inspected, not executed during this read-only review. (src/commands/channels.add.test.ts:2314, f55ea988e514)
  • Re-review continuity: The previous completed review lists no findings. Production files are unchanged from its reviewed revision; the current introduced file list matches the host's five-file delta, and diff whitespace checks pass. (f55ea988e514)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-15T03:49:08.647Z sha dd958e6d9601e695fc2649ffd7e2ce667e3423b0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T04:59:13.277Z sha 2843d53728d6312e6fb35101dd472c8df1675cb7 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T05:47:03.773Z sha bf639de1af494e2d70061d287d5a5835d008b742 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T07:08:17.681Z sha b189364 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T07:39:31.315Z sha 7364d02 :: needs changes before merge. :: none
  • reviewed 2026-09-15T07:50:32.502Z sha 8041497 :: blocked before merge. :: none
  • reviewed 2026-09-15T08:06:31.745Z sha 3160c59 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T08:54:06.793Z sha e897f7a :: needs maintainer review before merge. :: none

@cursor
cursor Bot force-pushed the cursor/fix-channels-add-blank-int-e997 branch from 5ed2def to 9d996c8 Compare September 12, 2026 03:07
@hugenshen

Copy link
Copy Markdown
Contributor Author

@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.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with the additional exact-head real CLI controls you requested. Please re-check the needs-proof gate.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels Sep 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. cli CLI command changes size: M and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: S labels Sep 12, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Pushed the legacy empty-default compatibility fix and refreshed exact-head proof: linked legacy plugin with cliAddOptions --limit valueType=int defaultValue="". Omitting --limit succeeds and preserves limit=7; explicit blank/whitespace still fail with --limit must be a non-negative integer.; valid --limit 10 updates. Please re-check the waiting-on-author finding.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Sep 12, 2026
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-admin-merge
pr: 145534
head: 880f7a7
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 15, 2026 07:55
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: signal Channel integration: signal app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling extensions: acpx extensions: minimax extensions: xiaomi labels Sep 15, 2026
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-admin-merge
pr: 145534
head: 3160c59
scope: owner-review

@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 145534
head: f55ea98
run: 34952484747 attempt: 1
failed: security-fast job=104326455271 conclusion=failure
failed: checks-fast-contracts-plugins job=104330135194 conclusion=failure
failed: checks-node-compact-large-29 job=104330137804 conclusion=failure
failed: checks-node-compact-large-25 job=104330137909 conclusion=failure
failed: checks-node-compact-large-7 job=104330137989 conclusion=failure
failed: checks-node-compact-large-6 job=104330138056 conclusion=failure
failed: checks-node-compact-large-27 job=104330138068 conclusion=failure
failed: checks-node-compact-large-30 job=104330138237 conclusion=failure
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-admin-merge
pr: 145534
head: f55ea98
scope: owner-review

@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 145534
head: f55ea98
run: 34952484747 attempt: 1
failed: checks-fast-contracts-plugins job=104330135194 conclusion=failure
failed: checks-node-compact-large-25 job=104330137909 conclusion=failure
failed: checks-node-compact-large-27 job=104330138068 conclusion=failure
failed: checks-node-compact-large-29 job=104330137804 conclusion=failure
failed: checks-node-compact-large-30 job=104330138237 conclusion=failure
failed: checks-node-compact-large-6 job=104330138056 conclusion=failure
failed: checks-node-compact-large-7 job=104330137989 conclusion=failure
failed: security-fast job=104326455271 conclusion=failure
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks @hugenshen!

Proof: The registered channels add command rejects an explicitly blank integer before changing account settings. Fresh and existing accounts preserve omitted integers and empty text defaults, and valid integers still apply.

  • Bug: A script passing a blank integer received success while that field was silently skipped and other fields changed.
  • Fix: Preserve explicit input through option forwarding and use the existing integer validator before account configuration.
Before After
Blank integer reports success and changes other account fields. Integer diagnostic, exit 1, and unchanged configuration bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants