Repository navigation
fix(media): report CLI models with missing command or args - #151969
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 3:30 PM ET / 19:30 UTC (Revision 5). ClawSweeper reviewWhat this changesAdds 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 Review scores
Verification
How this fits togetherMedia 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +61, Tests +201, Docs +2. Total +264 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel 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
HistoryReview history (4 earlier review cycles)
|
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 thanks for considering! |
|
Merged via squash.
|
…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) ...
…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)
…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.
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
argsis missing.User Impact
Doctor reports missing CLI commands or argument lists with the exact
tools.media.models[index].commandor.argspath 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:1115accepted the emptyargsdefault and ran the command alone. The existing resolution owner now supplies Doctor and execution with one minimum-input check and closedcli-missing-command/cli-missing-attachment-argreasons.A cross-field Zod error is deliberately omitted:
validation-core.tsconverts schema issues to invalid config, andassertValidGatewayStartupConfigSnapshotthrows 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 atvoice-recording.ts:181–188, warned, excluded the utterance, cleaned up its WAV, and settled its queue. The test hung at its success-onlyawait 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.tsadds 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:changedpassed (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, on8f58cddf468216ebf2158b33aa0a7e73138ce9a6.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, thenGREEN. 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
caf5b76adbbcc285802c735585bc8b2e645961c1is empty; only the reviewed Discord test repair (+59/-12) follows it.