Skip to content

[Bug]: inference commands accept omitted required repeatable inputs #130607

Closed

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The inference CLI accepts omitted required repeatable inputs, allowing image describe-many to report successful empty output instead of a usage error.

Steps to reproduce

  1. Use main at b8d2ac735a87a6745685b91381dc4b5db41c474e with a configured agent. No provider credentials are needed.
  2. Run openclaw infer image describe-many --json without --file.
  3. Observe exit status and stdout. Repeat without --json, or replace infer with capability.

Expected behavior

The required --file option should be rejected before inference, with a nonzero exit and command-specific help. This matches singleton image describe and the declared required-option contract.

Actual behavior

All four actual built-process cases (both command names, text/JSON) exited 0. JSON output was:

{"ok":true,"capability":"image.describe-many","transport":"local","attempts":[],"outputs":[]}

Text output was image.describe-many via local followed by outputs: 0.

OpenClaw version

Main b8d2ac735a87a6745685b91381dc4b5db41c474e, exact source-built CLI.

Operating system

macOS, Node 24.19.0.

Install method

Source checkout, repository cliStartup build, actual openclaw.mjs launcher.

Model

None; the empty description path does not perform inference.

Provider / routing chain

Local CLI, isolated test HOME/state/config/workspace, no Gateway or provider credentials.

Logs

$ openclaw infer image describe-many
image.describe-many via local
outputs: 0
# exit 0

Screenshots, recordings, and evidence

The actual CLI reproduction above was repeated under infer and capability, with and without --json. Real Commander registration regressions also confirmed all three affected commands: image edit without --file, image describe-many without --file, and embedding create without --text.

Impact and severity

Automation can mistake omitted inputs for completed work. The same registration defect lets image editing reach generation without a source image and embedding creation reach provider initialization without text. This report does not claim a live paid-provider request was made during proof.

Additional information

All three registrations specify an empty-array default for a mandatory repeatable option. Commander treats a defined default as satisfying the requirement. The existing option collector already initializes its own array, so the defaults are redundant. The declarations are present in stable v2026.4.7 and current main; the first-class inference CLI commit is 97c031a8db489ae91378a3c9a6cd5b848e9033e6.

Activity

  1. added
    bug
    on Aug 27, 2026
  2. added
    maintainer
    on Aug 27, 2026
  3. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:other
    issue-rating: 🦞 diamond lobster
    maturity:stable
    P1
    on Aug 27, 2026
  4. clawsweeper commented on Aug 27, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 26, 2026, 10:37 PM ET / August 27, 2026, 02:37 UTC.

    Summary
    Keep this issue open: current main still has the defective registrations, and the formally linked open PR is the focused repair path. The protected maintainer label also requires explicit maintainer handling rather than automated closure or duplicate repair dispatch.

    Reproducibility: yes. —current main directly shows defined empty-array defaults on each required repeatable option, while the issue supplies a concrete built-CLI reproduction of the resulting false success.

    Next step
    The explicitly linked open PR already owns this narrow repair, and the maintainer label prevents duplicate automated repair routing.

    Review details

    Best possible solution:

    Review and land the linked parser-registration repair with its missing-input and repeated-input regressions, preserving the existing collector as the sole array initializer.

    Do we have a high-confidence way to reproduce the issue?

    Yes—current main directly shows defined empty-array defaults on each required repeatable option, while the issue supplies a concrete built-CLI reproduction of the resulting false success.

    Is this the best way to solve the issue?

    Yes—the linked PR removes only the redundant defaults at the command-registration boundary and relies on the existing collector, avoiding downstream validation or provider-specific workarounds.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning high; reviewed against c35b18309329.

    Label changes

    Label changes:

    • add P1: A missing required input can report false successful inference output and mislead CLI automation or operators.
    • add impact:other: The concrete impact is a false-success command result, which does not fit a more specific owned impact class.
    • add maturity:stable: The broken boundary is the documented required-option contract of the M4 Stable CLI surface.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.

    Label justifications:

    • P1: A missing required input can report false successful inference output and mislead CLI automation or operators.
    • impact:other: The concrete impact is a false-success command result, which does not fit a more specific owned impact class.
    • maturity:stable: The broken boundary is the documented required-option contract of the M4 Stable CLI surface.
    Evidence reviewed

    What I checked:

    • Current registration retains the defect: All three affected required repeatable options provide an empty-array default; the image handlers subsequently accept those arrays, including describe-many mapping an empty list to an ok: true envelope. (src/cli/capability-cli/image.ts:369, c35b18309329)
    • Shared collector makes registration defaults redundant: The repeatable-option collector already defaults its previous value to an empty array, so removing registration-level defaults keeps valid repeated values on the canonical collection path. (src/cli/program/helpers.ts:6, c35b18309329)
    • CLI aliases share one command tree: infer is registered with capability as its alias, and the top-level lazy router sends both names through the same capability registrar; one registration repair covers both reported spellings. (src/cli/capability-cli.ts:102, c35b18309329)
    • Documented CLI contract: The inference reference presents repeated --file inputs for multi-image description and --text for embedding creation, establishing these as input-bearing commands rather than valid empty operations. Public docs: docs/cli/infer.md. (docs/cli/infer.md:98, c35b18309329)
    • Feature provenance and shipped surface: The first-class inference CLI was introduced by commit 97c031a8db489ae91378a3c9a6cd5b848e9033e6 and is contained by stable tag v2026.4.7; the current registrations were most recently carried forward by the August refactor. (src/cli/capability-cli/image.ts:413, 97c031a8db48)
    • Open fixing PR: The provided GitHub context identifies fix(cli): reject missing repeatable inference inputs #130608 as an open, cleanly mergeable PR with closing syntax for this issue and a narrowly matching repair description. (b29370a6a241)

    Likely related people:

    • Takhoffman: Authored the first-class inference CLI commit that established this command surface. (role: feature introducer; confidence: high; commits: 97c031a8db48; files: src/cli/capability-cli.ts)
    • steipete: Current affected image-registration lines blame to the recent CLI-area refactor that carried the declarations forward. (role: recent area contributor; confidence: high; commits: 162e8d139404, 67d22a58acad; files: src/cli/capability-cli/image.ts, src/cli/capability-cli/embedding.ts)
    How this review workflow works
    • 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.
  5. steipete commented on Aug 27, 2026

    @steipete
    ContributorAuthor

    Fixed on main by PR #130608, merged as d3d43eb6cfcda69c9ad0e4bcaf975f4ecbd084f4.

    The three redundant option defaults were removed, so missing --file/--text now produces the existing usage error before inference work. Repeated valid inputs still use the same collector. Proof includes 198 focused tests independently repeated, 38 independent actual CLI checks, seven source-blind clauses across 54 actual invocations, the full local changed-file gate, and green exact-head CI. Positive CLI controls prove parsing, not live-provider inference.

    Post-merge fetch verified the full merge commit is an ancestor of main; its stable patch ID exactly matches the reviewed source commit. The issue is closed as fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugclawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:otherissue-rating: 🦞 diamond lobstermaintainermaturity:stable

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions