Repository navigation
fix(browser): reject unsupported buttons in click commands - #140976
Conversation
Validate --button during Commander parsing for click and click-coords. Raise a recognized commander.invalidArgument error before dispatch while preserving valid and omitted request bodies and server-side validation.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: needs real behavior proof before merge. Reviewed September 7, 2026, 3:42 AM ET / 07:42 UTC. ClawSweeper reviewWhat this changesThe Browser CLI rejects unsupported mouse buttons locally for click and coordinate-click commands, with regression coverage for invalid and omitted values. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused improvement absent from current main and the latest release. No blocking correctness defect was found, but real CLI behavior proof is still required before merge. Priority: P3 Review scores
Verification
How this fits togetherThe Browser CLI converts terminal commands into requests to OpenClaw’s browser service. Valid click requests reach browser automation; invalid button arguments now stop during command parsing. flowchart TD
A[Terminal click command] --> B[Parse button option]
B --> C{Supported or omitted?}
C -->|No| D[Argument error and exit]
C -->|Yes| E[Browser service request]
E --> F[Server validation]
F --> G[Browser click]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +32. Total +43 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep validation at the CLI parsing boundary while preserving supported button values, omission semantics, and server-side validation for other clients. Do we have a high-confidence way to reproduce the issue? Yes, from source: both current-main commands accept an arbitrary --button string and dispatch it before server rejection. No target code or tests were executed during this read-only review. Is this the best way to solve the issue? Yes, parsing the existing option before dispatch is a narrow repair, and the error shape matches Commander's implementation; no new API or configuration surface is needed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 86a3c7267be4. 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
|
|
Thanks @WOLIKIMCHENG! Proof: The compiled Browser CLI was checked with a request recorder and a real isolated Gateway, Chrome, and synthetic page. Independent behavior validation passed all 11 observable clauses. All 16 focused tests, formatting, lint, and exact-head CI passed.
The original contributor commit was preserved. Full before/after command output and build identities are recorded in the PR description. |
…140976) Reject unsupported mouse buttons during CLI option parsing for click and click-coords. Preserve supported and omitted request bodies and server-side validation. Co-authored-by: WOLIKIMCHENG <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…1-prep * commit 'da37d47920d102044a4cb33f8cd688b4abc3c2a6': (460 commits) refactor(memory): simplify built-in runtime delegation (openclaw#141847) refactor(comfy): remove unused cloud fixture input (openclaw#141844) fix(agents): keep canonical target casing for session-bound replies (openclaw#140418) fix(ci): hydrate release source ancestry through branch (openclaw#141840) fix(telemetry): include mixed-case configured providers (openclaw#141134) fix(qa): retain Slack presentation history (openclaw#127300) test(cli): compact argv case matrices (openclaw#141832) test(agents): compact code mode case matrices (openclaw#141831) test(gateway): compact control ui routing cases (openclaw#141834) test(reasoning): compact reasoning tag cases (openclaw#141833) fix(cli): keep progress spinners within terminal width (openclaw#141401) fix(release): provision native live harness dependencies (openclaw#141829) fix(cron): preserve prepared runtime and error ownership (openclaw#140941) fix(npm): recognize companion-owned runtime imports (openclaw#141647) fix(browser): reject unsupported buttons in click commands (openclaw#140976) refactor(gateway): keep cached turn replay with dedupe (openclaw#141824) fix(release): preserve frozen gateway package resolution (openclaw#141827) refactor: keep live image probe matching private (openclaw#141823) fix(browser): recover stale panel after stream disconnects (openclaw#141576) feat(cron): explain slow automation list requests (openclaw#141805) ...
What Problem This Solves
Fixes an issue where
openclaw browser clickandclick-coordssend unsupported--buttonvalues to the Browser service instead of reporting an argument error immediately.Why This Change Was Made
Both commands validate the existing option during Commander parsing. Valid values and omitted options keep their existing request bodies. Server validation remains in place for other clients.
User Impact
Unsupported buttons produce an immediate error that names
left,right, andmiddle, with exit code 1 and no Browser request. Supported clicks continue to work.Evidence
Tested the compiled CLI in an isolated Linux environment with a request recorder and a real Gateway, Chrome, and synthetic page.
left,right,middle, omittedExample after-fix output:
Baseline:
252158295ee487c4145404367fa15e3db588989b. Candidate:c3fb332dff1cd0b3ebf721b1bcc3971dd3ce8d91, using its CI test-merge artifact from19e6a765d94182b6e2e8e7746523f1d1c841464a.