Skip to content

fix(media): report CLI models with missing command or args - #151969

Merged
steipete merged 5 commits into
mainfrom
upd/media-cli-model-command
Sep 18, 2026
Merged

steipete merged 5 commits into
mainfrom
upd/media-cli-model-command

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #151883

Related: #151939 (overlapping config warnings) and #151941 (optional-placeholder documentation).

What Problem This Solves

CLI media models can pass validation and Doctor but invoke a transcriber without an attachment when args is missing.

User Impact

Doctor reports missing CLI commands or argument lists with the exact tools.media.models[index].command or .args path and a manual fix. Incomplete entries record a runtime failure without launching the binary, and the next configured model is tried. If none succeeds, the attachment gets a failure outcome and a warning is logged.

Gateway startup validation remains unchanged. Doctor does not invent commands or rewrite media configuration. Empty argument lists are unavailable because the runner supplies no stdin. Nonempty literal paths and custom arguments retain their shipped behavior; template interpolation remains optional. A valid CLI returning empty stdout still counts as completed processing.

Why This Change Was Made

The original argv construction at src/media-understanding/runner.entries.ts:1115 accepted the empty args default and ran the command alone. The existing resolution owner now supplies Doctor and execution with one minimum-input check and closed cli-missing-command / cli-missing-attachment-arg reasons.

A cross-field Zod error is deliberately omitted: validation-core.ts converts schema issues to invalid config, and assertValidGatewayStartupConfigSnapshot throws before startup. An optional media problem must not become an update/startup refusal.

The v2026.9.4 execution contract accepts literal arguments and gives Antigravity commands the attachment directory as their cwd. Those contracts remain intact. Coordinate the overlapping Doctor diagnostic in #151939 before landing both approaches.

Thanks to @fede-kamel for the report and the clarification that missing commands already throw at runtime; the silent case is a command with missing args. No reporter code was adopted.

Release-note context: report incomplete CLI media models in Doctor and prevent command-only transcription attempts, preserving Gateway startup, custom arguments, and configured fallbacks.

Evidence

  • 203 tests passed across the full Discord integration file and seven media/resolution/Doctor suites. Tests cover no-spawn refusals, fallback, literal-argument execution through the real process executor, cwd-relative custom arguments, and report-only Doctor behavior.

  • Discord regression repaired: the empty-stdout fixture omitted args, so the new refusal prevented its stdout mock from running. Production already caught the refusal at voice-recording.ts:181–188, warned, excluded the utterance, cleaned up its WAV, and settled its queue. The test hung at its success-only await recorded.promise (previous line 184). The fixture now passes {{AttachmentPath}}, and CLI cases join the owned recording/conversation queues. The separate oversized capture scan retains its recording-completion wait. Original whole-utterance and cleanup assertions remain.

  • Both original Discord cases reproduced a timeout with a shortened 15-second test limit. Queue synchronization alone exposed the precise missing-args warning immediately. After the fixture repair, all eight Discord cases passed: empty-output conversation/control in 116/98 ms, and actual missing-command/missing-args refusals in 13/12 ms with a warning, no spawn, no dispatch, and WAV cleanup.

  • Audited consumers: Telegram/WhatsApp/Discord attachment preflight completes with no transcript and a shared warning; general attachments retain the failure decision and agent-visible marker; the file API rejects promptly with the reason/fix, and the capability CLI reports it and exits unsuccessfully. No additional unresolved wait was found. These consumer observations are source inspection, not live channel proof.

  • Follow-up delta: production +0/-0; tests +59/-12 (net +47). Whole PR: production +106/-45 (net +61); tests +254/-53 (net +201); docs +2.

  • No live Gateway or user configuration was used. Maintainer decision on ClawSweeper rank-up and compatibility requests: skip the published-updater × candidate run for this diagnostic-only Doctor change. There is no persisted shape, migration, backfill, update-path, or service-lifecycle change; Doctor only adds advisory reporting, and Gateway startup validation remains unchanged. This also resolves the review’s data-model compatibility request: doctor-config-analysis.ts adds a diagnostic, not a stored-data repair. No updater compatibility run is claimed. The shared resolver, literal/custom arguments, and configured fallbacks are preserved and covered by the focused tests. Coordination with the overlapping diagnostic PR is deferred to that PR’s landing; this landing does not change other PRs.

  • pnpm check:changed passed (exit 0), including core/test typechecks, changed-file lint, export scans, architecture guards, and zero runtime import cycles.

  • Fresh committed-branch Codex review: --mode branch --base origin/main --max-priority P1 — scoped-clean, score 0.91, on 8f58cddf468216ebf2158b33aa0a7e73138ce9a6.

  • Exact-head CI succeeded: run 35385552484, head 8f58cddf468216ebf2158b33aa0a7e73138ce9a6, completed successfully at 19:42 UTC. REST verification at 20:24 UTC found 211 completed check runs: 167 success, 43 skipped, 1 neutral; 0 failing or pending. The CI workflow has 156 completed jobs: 141 success and 15 skipped. The previously failing checks-node-compact-small-42 is successful. There are no failing jobs to classify.

  • Native watcher: the authoring lane was blocked by the shared writer GraphQL quota and verified CI through REST. During landing, the watcher succeeded on its single retry after the printed quota reset: STATUS rollup=green github_rollup=SUCCESS pending=0 superseded=18, then GREEN. It attached to the existing successful run 35385552484; no CI rerun was performed.

  • Landing verification: REST re-read of the exact head found 217 completed checks: 170 success, 46 skipped, 1 neutral; 0 failing or pending. The production diff from reviewed head caf5b76adbbcc285802c735585bc8b2e645961c1 is empty; only the reviewed Discord test repair (+59/-12) follows it.

Share CLI command and attachment-argument validation between Doctor and media execution. Record typed unavailable reasons, preserve configured fallbacks, and report manual repairs without changing media configuration or tightening the startup schema.

Keep execution-option resolution with the media resolution owner and reuse canonical Doctor path helpers in tests.

Fixes #151883. Thanks to @fede-kamel for the report and runtime clarification; no reporter code was adopted.
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: M maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 17:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 18, 2026, 3:30 PM ET / 19:30 UTC (Revision 5).

ClawSweeper review

What this changes

Adds Doctor warnings and prevents media commands with missing commands or argument lists from launching, while preserving custom arguments and configured fallbacks.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains a useful fix absent from current main. The earlier literal-argument defect is resolved, and no new blocking code defect was found; the repository-required upgrade validation remains outstanding.

Priority: P2
Reviewed head: 8f58cddf468216ebf2158b33aa0a7e73138ce9a6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with meaningful regression coverage and no supported blocking code finding; upgrade validation remains a landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Reported tests exercise the production CLI runner, including real literal-path execution and mocked Discord settlement; the separate required published-updater check remains outstanding.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Reported tests exercise the production CLI runner, including real literal-path execution and mocked Discord settlement; the separate required published-updater check remains outstanding.
Evidence reviewed 9 items Current main still permits command-only execution: The fetched main implementation still defaults missing args to an empty array and checks only the command. The new CLI-input diagnostic symbols are absent from that revision.
Latest release retains the old behavior: GitHub contents for v2026.9.4 confirm that missing args default to an empty array; this release does not contain the proposed refusal.
Shared validation preserves custom arguments: The resolver rejects blank commands and absent or empty argument arrays, without requiring placeholders. Doctor consumes the same result, and execution checks it before staging or spawning.
Findings None None.
Security None None.

How this fits together

Media understanding converts incoming attachments into text before agent processing. Configured command-line tools participate in the same ordered fallback pipeline as provider models, while Doctor diagnoses their configuration.

flowchart TD
  A[Media configuration] --> B[Shared CLI input check]
  B --> C[Doctor warnings]
  D[Incoming attachment] --> B
  B -->|Complete inputs| E[Run configured command]
  B -->|Incomplete inputs| F[Record failure and try fallback]
  E --> G[Transcript or attachment outcome]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The shipped updater's invocation of candidate Doctor with existing media configuration remains unverified; focused tests do not establish that upgrade boundary.
  • Complete next step (P2) - Before merge, record the published-updater-to-candidate check with existing CLI media configuration, confirming advisory warnings, preserved configuration, and successful Gateway startup.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +61, Tests +201, Docs +2. Total +264 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 106 45 +61
Tests 4 254 53 +201
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 362 98 +264

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +61 lines; tests net +201 lines Production growth supplies shared input validation and actionable diagnostics; coverage protects refusal, fallback, custom arguments, and asynchronous cleanup.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-analysis.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #151883
Summary: This PR targets the canonical missing-input report; another open PR overlaps diagnostics but does not implement runtime refusal.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one shared CLI-input check with report-only diagnostics, preserved custom arguments and fallbacks, and demonstrated startup compatibility through the published updater.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one shared CLI-input check with report-only diagnostics, preserved custom arguments and fallbacks, and demonstrated startup compatibility through the published updater.

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

Yes, from source: current main accepts a CLI command without args and passes an empty argument array to execution. The linked report includes real-process reproduction; this review did not execute it.

Is this the best way to solve the issue?

Yes: sharing the minimum-input check between Doctor and execution is bounded and preserves startup validation and literal arguments. Coordinate overlapping diagnostics with #151939 before landing both.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47b6eb550cb4.

Labels

Label justifications:

  • P2: This repairs a bounded configuration-diagnostic and execution defect affecting explicitly configured CLI media models.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Reported tests exercise the production CLI runner, including real literal-path execution and mocked Discord settlement; the separate required published-updater check remains outstanding.

Evidence

What I checked:

  • Current main still permits command-only execution: The fetched main implementation still defaults missing args to an empty array and checks only the command. The new CLI-input diagnostic symbols are absent from that revision. (src/media-understanding/runner.entries.ts:1056, 47b6eb550cb4)
  • Latest release retains the old behavior: GitHub contents for v2026.9.4 confirm that missing args default to an empty array; this release does not contain the proposed refusal. (src/media-understanding/runner.entries.ts:1030, 3a9d69db306c)
  • Shared validation preserves custom arguments: The resolver rejects blank commands and absent or empty argument arrays, without requiring placeholders. Doctor consumes the same result, and execution checks it before staging or spawning. (src/media-understanding/resolve.ts:43, 8f58cddf4682)
  • Failure settlement and fallback remain owned by the runner: The existing attempt loop catches CLI failures, records failed attempts, and continues configured candidates. Exhausted failures produce a warning; the file API rejects promptly, and Discord recording catches that rejection and cleans up its WAV. (src/media-understanding/runner.ts:646, 8f58cddf4682)
  • Re-review continuity: Compared with reviewed head caf5b76, only the Discord integration test changes. It supplies valid args for empty-output fixtures, joins owned queues, and checks missing-input refusal, no dispatch, warnings, and cleanup. The previous literal-argument finding remains fixed. (test/transcripts-discord-audio.integration.test.ts:186, 8f58cddf4682)
  • Upgrade validation remains explicitly unverified: Root policy requires a published-driver × candidate cell for Doctor changes. The captured PR body explicitly says this check remains unverified. Report-only tests cover repair enabled and disabled, preserve media configuration, and assert no write, but do not exercise the shipped updater. (AGENTS.md, 8f58cddf4682)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the required published-driver × candidate update result using existing CLI media configuration.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-18T17:13:06.725Z sha 89884dc :: blocked before merge. :: [P1] Preserve executable literal and custom attachment arguments
  • reviewed 2026-09-18T18:23:59.793Z sha 33c9fab :: blocked before merge. :: none
  • reviewed 2026-09-18T18:58:56.639Z sha caf5b76 :: blocked before merge. :: none
  • reviewed 2026-09-18T19:07:54.720Z sha caf5b76 :: blocked before merge. :: none

Reject only missing commands and absent or empty argument lists. Preserve the shipped optional-interpolation and custom working-directory contracts, with real process proof for a literal attachment path.
@steipete steipete changed the title fix(media): reject CLI models without attachment arguments fix(media): report CLI models with missing command or args Sep 18, 2026
@fede-kamel

Copy link
Copy Markdown
Contributor

@steipete thanks for considering!

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 18, 2026
@steipete
steipete merged commit d492bb9 into main Sep 18, 2026
229 checks passed
@steipete
steipete deleted the upd/media-cli-model-command branch September 18, 2026 20:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…49075-c1-control-repair

* commit 'dc5b321b5f89f9cf0e704ee202ea3059fb1ce63d': (79 commits)
  fix: start background context maintenance after durable turns (#151936)
  fix(models): avoid ambient state reads during prepared selection (#152119)
  feat: recover abandoned Crabbox source staging (#152006)
  chore(ui): refresh control ui locales (#152098)
  fix(ui): keep cloud startup prompts and progress in chat (#152024)
  fix: report completed subprocess cleanup after cancellation (#152107)
  perf(reply): reuse normalized inbound text (#152110)
  fix(cron): paused future one-shots disappear after Run now (#152126)
  perf(sessions): reuse rows and skip discarded terminal labels (#152109)
  fix(ui): keep keyboard-focused automation controls clear of sticky actions (#152135)
  fix(ui): load remote images in compact activity previews (#152045)
  refactor(health): skip unused verbose account projection (#152108)
  fix: restore dashboard test limits and SQLite test compilation (#152089)
  test(qa-lab): stabilize timeout recovery delivery proof (#152100)
  fix: probe SQLite when Node denies worker threads (#152075)
  perf(gateway): keep GitHub co-author trailer scans linear (#152115)
  fix(media): report CLI models with missing command or args (#151969)
  refactor: remove retired runtime code and duplicate helpers (#151973)
  perf(plugins): combine runtime and tool call scopes (#152101)
  test(memory): seed restart fixtures with the Gateway stopped (#152038)
  ...
vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149282-proof-20260918

* commit 'dfa48c256f0853268c6b42cbe09fc1338d7d24ea':
  test(qa-lab): stabilize timeout recovery delivery proof (#152100)
  fix: probe SQLite when Node denies worker threads (#152075)
  perf(gateway): keep GitHub co-author trailer scans linear (#152115)
  fix(media): report CLI models with missing command or args (#151969)
  refactor: remove retired runtime code and duplicate helpers (#151973)
  perf(plugins): combine runtime and tool call scopes (#152101)
  test(memory): seed restart fixtures with the Gateway stopped (#152038)
  perf(gateway): avoid session list stalls on broad updates (#152074)
  fix: preserve model failure causes and worker fallback runtime (#152028)
  perf(logging): reduce Gateway hot-path info log volume (#152080)
  improve(gateway): reduce duplicate worker data fetched from SQLite (#151878)
  improve: format messages with many links faster (#152112)
  perf(cron): avoid unused SQL binding in config projections (#152029)
  fix: explain cloud worker startup failures (#152043)
  refactor(discord): share Markdown edit projection (#149214)
  refactor(media): remove unreachable geometry metadata backfills (#149272)
  chore(autoreview): sync mirror to agent-skills a7e91e1 (#152039)
  fix(ui): restore sidebar and chat test collection (#152099)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…151969)

CLI media models with a missing command or empty argument list passed Doctor. When a command existed but args were absent, the runtime invoked the transcriber without the attachment. Doctor and execution now share the media resolver's minimum-input check. Doctor reports the exact configuration path and a manual fix; execution records a typed refusal before spawning and continues configured fallbacks.

Gateway startup validation remains unchanged. Custom and literal arguments still work, and a valid command returning empty stdout still completes. The Discord fixture now supplies attachment arguments for its empty-output case and waits for owned work to settle on refusals, preserving warning, no-dispatch, and WAV-cleanup coverage.

Release-note context: report incomplete CLI media models in Doctor and prevent command-only transcription attempts while preserving Gateway startup, custom arguments, and configured fallbacks.

Fixes openclaw#151883. Thanks to @fede-kamel for reporting and clarifying the missing-args failure. No reporter code was adopted.

Validation: 203 focused tests reported passing, check:changed passing, clean Codex review, and exact-head CI run 35385552484 successful. Landing REST verification found 217 completed checks: 170 successful, 46 skipped, one neutral, and no failures or pending checks. The follow-up from the reviewed production head changes only the Discord integration test.

The published-updater compatibility check was explicitly skipped by maintainer decision: Doctor adds advisory diagnostics only, with no persisted-shape, migration, update-path, or service-lifecycle change. No updater compatibility run is claimed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A type: "cli" media model with no command/args passes config validation and doctor, then runs the command with no file

2 participants