Skip to content

fix(cli): reject missing repeatable inference inputs - #130608

Merged
steipete merged 1 commit into
mainfrom
codex/qa-cli-infer-required-20260827
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-cli-infer-required-20260827

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #130607

Additional instructions

Maintainer edits are enabled on this same-repository branch.

What Problem This Solves

Fixes an issue where operators omitting required repeatable inference inputs could receive successful empty output or reach a provider operation instead of a usage error. It affects image edit, image describe-many, and embedding create, through both infer and capability.

Why This Change Was Made

Remove three redundant empty-array option defaults so Commander can enforce the existing required-input contract. The canonical collector already initializes and preserves repeated values; no extra handler guard or parallel validation path is needed. Optional inputs, provider routing, authentication, and persistence are unchanged.

Production LOC: +3/-3 (net zero). Tests: +37/-3. Docs: +1/-0. AI-assisted.

User Impact

Omitted --file/--text now exits 1 with the exact missing flag and command-specific help. JSON callers receive the canonical ok:false / cli_error envelope. Valid one-input and repeated-input behavior is preserved. The inference CLI reference now states this requirement explicitly.

Evidence

  • Pre-edit real Commander regressions failed for all three commands under both aliases; the three repeated-input controls passed.
  • Four actual built CLI baseline cases reproduced exit-0 empty success for image describe-many under both aliases in text/JSON modes.
  • The same repaired boundary passed all six missing-input regressions and all repeated-input controls. Full focused suite: 198 tests across command behavior, lazy registration, and shared parser helpers.
  • Twelve actual built CLI cases (three commands, both aliases, text/JSON) all exited 1 with the correct missing option, recovery hint, and JSON envelope. Isolated fixture state was cleaned; no provider credentials or live-provider claim.
  • An independent verifier reran all 198 focused tests and 38 actual built-CLI checks on the unchanged patch: all passed, including missing inputs, help, missing values, and single/repeated input acceptance.
  • A source-blind validator passed all seven prewritten behavior clauses using 54 actual CLI invocations: 16 missing-input cases, 16 flags without values, eight help cases, and 14 safe positive parser controls. Both aliases and text/JSON renderers were exercised with fresh varied values; no timeouts or behavioral findings. Positive controls prove parser acceptance only, not live inference.
  • Baseline and repaired cliStartup builds passed. The complete changed-file gate, Oxfmt, and git diff --check passed.
  • Fresh authenticated Codex whole-patch review, including complete affected owners/callers/siblings/tests/docs and reproduction evidence: zero actionable P0-P2 findings.

The first local changed gate found a missing UI importer dependency link, resolving root transitive pako 1.0.11 instead of UI's pinned 3.0.1. The link was repaired using the already-installed exact dependency donor, without package changes or validation waivers. The next pass caught a lint issue in the new test table; its direct projection was corrected, the targeted regressions passed again, and the final complete gate and refreshed whole-patch review passed. Independent and source-blind verification used the same final source bytes.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: XS maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 02:31
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for b29370a:

The missing-input defect was reproduced before the change at the real Commander boundary and in four actual built-CLI invocations. The repair removes three redundant defaults at registration; the existing collector continues to own repeated values. Production +3/-3 (net zero), tests +37/-3, docs +1/-0.

Validation passed:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/cli/capability-cli.test.ts src/cli/capability-cli.lazy.test.ts src/cli/program/helpers.test.ts — 198 tests; independently repeated on the final bytes.
  • node --import tsx scripts/build-all.mts cliStartup — baseline and repaired builds; actual built CLI verified under isolated test state.
  • node scripts/check-changed.mjs -- src/cli/capability-cli/image.ts src/cli/capability-cli/embedding.ts src/cli/capability-cli.test.ts docs/cli/infer.md — full changed-file gate passed after repairing the local dependency-link prerequisite and test-table lint issue; no waiver.
  • Independent actual CLI checks: 38 passed. Source-blind validation: all seven behavior clauses passed across 54 invocations, including both aliases, text/JSON errors, help, missing values, and safe single/repeated parser controls. Positive controls establish parser acceptance, not live-provider inference.
  • Final authenticated Codex whole-patch review: no actionable P0-P2 findings.
  • Exact-head CI 33033550308 passed, including openclaw/ci-gate.
  • Native review artifacts validated and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 130608 passed without a rebase or extra push. Current main was checked for changes to the affected owner, callers, siblings, documentation and dependency contract; none conflict with the repair.

The latest ClawSweeper comment is still a started-review placeholder with no findings or Rank-up moves to address. No live-provider outcome is claimed; absent input is rejected before that boundary. Documentation: https://docs.openclaw.ai/cli/infer

@steipete
steipete merged commit d3d43eb into main Aug 27, 2026
206 checks passed
@steipete
steipete deleted the codex/qa-cli-infer-required-20260827 branch August 27, 2026 02:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: inference commands accept omitted required repeatable inputs

1 participant