Skip to content

Broad CLI command surface has no test coverage #83877

Description

@davinci282828

Severity: medium / Confidence: high / Category: test-gap
Triage: test-gap
Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18)
Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol

Evidence

  • extensions/browser/src/cli/browser-cli-actions-input/register.element.ts:41-226 (registerBrowserElementCommands)

  • extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts:14-67 (registerBrowserNavigationCommands)

  • extensions/browser/src/cli/browser-cli-actions-input/register.form-wait-eval.ts:14-103 (registerBrowserFormWaitEvalCommands)

Reasoning

The three test files cover only: download/waitfordownload outer timeout sizing, dialog --accept/--dismiss conflict, wait command outer timeout, and readFields field normalization. Completely untested at CLI level: click, click-coords, type, press, hover, scrollintoview, drag, select (all of register.element.ts), navigate and resize (register.navigation.ts), fill and evaluate (register.form-wait-eval.ts), and upload (register.files-downloads.ts). This represents 12 of 16 commands with zero CLI-layer tests. The input validation and body-building logic for each untested command can regress silently.

Recommendation

Add a register.element.test.ts and extend existing test files to cover at minimum: (1) that each command sends the expected body kind to callBrowserRequest, (2) requireRef rejects blank ref with exit 1, (3) the NaN coordinate guard once added. Use the existing test-support helpers (createBrowserProgram, getBrowserCliRuntime) that are already set up.

Why existing tests miss this

No test file exists for register.element.ts or register.navigation.ts at all. The form/files tests only cover timing and conflict behavior, not the primary success paths or input validation.

Suggested regression test

it('sends click body with correct ref', async () => {
const program = createActionInputProgram();
await program.parseAsync(['browser', 'click', 'e42'], { from: 'user' });
const [, req] = mocks.callBrowserRequest.mock.calls.at(-1);
expect(req.body).toMatchObject({ kind: 'click', ref: 'e42' });
});
it('rejects blank ref', async () => {
const program = createActionInputProgram();
await program.parseAsync(['browser', 'click', ' '], { from: 'user' });
expect(getBrowserCliRuntime().exit).toHaveBeenCalledWith(1);
});

Minimum fix scope

New register.element.test.ts; extensions to register.form-wait-eval.test.ts for fill/evaluate; extensions to register.files-downloads.test.ts for upload.


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-0029f9d57b-_5467af03cd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions