Repository navigation
fix(cli): reject blank message channel selectors - #144802
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: blocked before merge. Reviewed September 11, 2026, 5:35 AM ET / 09:35 UTC (Revision 3). ClawSweeper reviewWhat this changesRejects explicitly blank message-channel arguments before command execution, adds parser regression coverage, and documents how omission preserves automatic channel selection. Merge readiness⛔ Blocked before merge - 3 items remain The fix remains necessary on current main, and no actionable patch defect was found. Real CLI evidence satisfies the earlier proof request; accepting the intentional compatibility change remains a maintainer choice. Priority: P2 Review scores
Verification
How this fits togetherThe message CLI translates operator arguments into outbound channel actions. Its shared argument parser runs before channel-plugin loading and dispatch, while the existing selection owner resolves omitted channels from targets or configuration. flowchart TD
A[Message CLI arguments] --> B{Explicit blank channel?}
B -->|Yes| C[Reject with CLI error]
B -->|No| D[Existing channel selection]
E[Target and configured channels] --> D
D --> F[Dry-run result or outbound action]
Decision needed
Why: Fresh and configured-state proof establishes the behavior, but cannot decide whether the intentional change to existing scripts is acceptable. Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +19, Docs +4. Total +34 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep validation at the shared CLI parser, preserve omitted and nonblank selection, and explicitly accept the documented empty-variable compatibility change. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main forwards a blank --channel value into normalization and sole-configured-channel selection. The reviewer did not execute a failing baseline; contributor evidence demonstrates the repaired CLI behavior. Is this the best way to solve the issue? Yes, technically: the shared argument parser is the narrowest boundary that rejects malformed CLI input without changing programmatic optional-channel semantics. The intentional script compatibility change still needs acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b52dc467b3e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Real CLI proof is now linked in the PR Evidence for exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The PR Evidence now includes the redacted real-CLI terminal receipt directly, in addition to the successful fork run/job links. Please re-check exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accept rejection of explicitly empty or whitespace-only |
|
Thanks @ly85206559! Merged as Proof: 88 complete real-CLI captures, 200 focused tests, clean independent source/behavior review, clean exact-head ClawSweeper gate, and green exact-head CI. The two new regression cases fail on baseline for the intended reason and pass on candidate.
The shared option now rejects blanks before message-specific startup. Scripts that want automatic selection must omit the option. Fresh-state, multi-channel, prefix, sibling-command, account, help, and required-argument controls pass. Dry-run proves routing and validation, not delivery. Baseline proof used |
Preserve the reviewed harness while incorporating the landed benchmark prerequisite. Punchcard-Session: coral-orchard-orchard-d4 * commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits) fix(perf): isolate benchmark subprocess transport (#144159) refactor(auth): await Copilot cache persistence (#144810) refactor(web-fetch): exercise URL normalization through the public tool (#144887) fix(ollama): preserve hosted subdomain model context (#144891) fix(doctor): explain Codex plugin health failures (#144813) fix(channels): honor pinned accounts in Mattermost model menus (#144880) fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729) fix(logging): preserve OpenClaw package references in diagnostics (#144808) fix: retain plugin detail tab selections while inspection loads (#144647) fix: keep discovered models when sign-in tokens renew (#144861) fix(update): preserve local package overrides (#89985) fix(update): resolve compatibility bridges within the runtime graph (#144831) chore(i18n): refresh native locales (#144856) fix: preserve child signal termination during CLI respawn (#144838) fix(text): hide encoded MiniMax tool envelopes (#126307) fix(subagents): deliver child replies that match the empty placeholder (#130647) fix(cli): reject blank message channel selectors (#144802) fix(telegram): preserve mixed text order and pending stop (#144839) fix(memory): restore FTS fallback for same-name view collisions (#144783) chore(release): close out 2026.9.4 on main (#144708) ...
Reject explicit empty or whitespace-only --channel values in the shared message CLI option parser before message-specific startup. Preserve omitted and nonblank selection, and document omission as the automatic-selection path for scripts. Closes openclaw#144795. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #144795
What Problem This Solves
An explicit empty or whitespace-only
--channelvalue was treated as omission. A shell command such asopenclaw message send --channel "$CHANNEL" ...could therefore select the sole configured channel when the variable was empty.Why This Change Was Made
The shared message option rejects blanks during argument parsing, before message-specific plugin loading and action startup. Omitted and nonblank selectors keep their existing routing. Shared programmatic optional-channel semantics are unchanged. Generic CLI bootstrap can still read configuration.
User Impact
Explicit blanks now fail with
--channel must not be blank. Scripts that want automatic selection must omit the option. Maintainer scope accepts this documented malformed-input correction and the omission migration; the earlier compatibility review is preserved as history.Evidence
Real compiled CLI proof used isolated normal setup, synthetic Discord/Slack configuration, numeric targets, and
--dry-run --json.--channel ""--channel " "discordor surrounding whitespaced9ad56cbe319ac6ba1c106a27ab547c4d50c7f05.8a9feadbfd230b706daf99318d5a67e8a551d9fb, containing reviewed contributor headfc9d2efaaf02a8eefa91907c2b94db239d0c23b6. Independent source/artifact review verified the exercised message behavior and dependency contracts; the merge build is not relabeled as a contributor-head build.helpers.test.ts,register.message.test.ts,account-selector-boundary.test.ts). The exact two new regression cases fail on baseline for the intended missing-parser reason, then pass on candidate.Dry-run proves routing and validation, not delivery. Send output does not echo message text; complete input preserves it. Broadcast retains an unrelated aggregate
dryRun: falsereporting inconsistency on both builds while child results are dry runs; the selector change does not alter that path. Earlier review judgments and the contributor’s report of a superseded non-required Auto response HTTP 500 failure remain preserved as history; the current exact-head CI result was independently verified.Original implementation and tests by @ly85206559. Maintainer validation was AI-assisted.