Skip to content

fix: send infer audio/video --model files only to the requested model - #190287

Merged
obviyus merged 7 commits into
openclaw:mainfrom
alkor2000:codex/fix-infer-media-model-override-20261101
Nov 19, 2026
Merged

obviyus merged 7 commits into
openclaw:mainfrom
alkor2000:codex/fix-infer-media-model-override-20261101

Conversation

@alkor2000

@alkor2000 alkor2000 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: src/cli/capability-cli/media-understanding-command.ts:49 passes --model only as activeModel (a conversation-model hint), and the media selector never treats it as a choice: src/media-understanding/runner.ts:727 takes configured tools.media.models entries without looking at it, and with no entries, audio swaps the requested model for the provider default (runner.ts:439).

Related: #176246 (reported by @yetval; the earlier strict-pin proposal #172409 was closed in favor of that issue).

What Problem This Solves

openclaw infer audio transcribe --model provider/model and openclaw infer video describe --model provider/model ignore the flag when tools.media.models has an entry, and upload the file to that configured entry, which is often a different provider. With no configured entry, --model openai/whisper-1 is sent as gpt-4o-transcribe. The docs say --model provider/model pins a specific backend (docs/cli/infer.md).

User Impact

With --model, the file goes only to the requested provider and model. If that model fails, its existing error is returned and no configured entry, CLI backend or provider default receives the file. Runs without --model keep today's configured selection and fallback chain.

Why This Change Was Made

The maintainers chose strict pinning, as the docs already promise. The requested model becomes the only media attempt. It reuses a configured descriptor (credential owner, base URL, headers) only when that entry is the same provider and model. The CLI reaches this through an internal runtime entry, so the plugin runtime API is unchanged. The earlier revision's optional public modelOverride field and its SDK doc are removed. docs/cli/infer.md keeps the pin wording and adds one line for audio and video.

Thanks @alkor2000 for the original change (kept as the first four commits) and @yetval for the report and repro.

Evidence

Observed proof: #190287 (comment). The CLI was built from source with isolated state and local fixture providers that record every upload. A is the configured chain (a failing entry, then a working one) for audio and video, B is requested with --model, and W is a transcription endpoint for the whisper-1 case.

Run Base 5fb2315 This PR f3d3739
audio --model openai/gpt-4o-mini-transcribe A ×3 (voxtral-a-broken ×2, voxtral-a), B 0 B ×1 (gpt-4o-mini-transcribe), A 0
video --model moonshot/kimi-b A ×3 (qwen-a-broken ×2, qwen-a), B 0 B ×1 (kimi-b), A 0
audio --model openai/b-fail (B returns 500) A ×3, exit 0 with A's text B ×2 (500, transport retry), A 0, exit 1 with "Audio transcription failed (HTTP 500)"
video --model moonshot/b-fail (B returns 500) A ×3, exit 0 with A's text B ×2 (500), A 0, exit 1 with "Moonshot video description failed (HTTP 500)"
audio, no --model (control) A ×3, result voxtral-a A ×3, result voxtral-a (same)
video, no --model (control) A ×3, result qwen-a A ×3, result qwen-a (same)
audio --model openai/whisper-1, no tools.media.models W model=gpt-4o-transcribe W model=whisper-1
  • src/media-understanding/resolve.test.ts: the new pin case (audio and video) fails on the merge base and passes here. src/cli/capability-cli.test.ts (121 tests) and the media runner/runtime suites pass.
  • Full build (--dts) passes, including the plugin SDK export check. Head 2057fd7 adds only a // mock-isolation: comment on the media runtime mock in capability-cli.test.ts (the mock-exports ratchet asks for one when a mock factory changes; the mocked runtime would otherwise reach provider uploads and credential lookup), and drops that factory's stale grandfathered hash from config/test-mock-exports-baseline.txt, on top of the proven f3d3739; production code is identical.
  • Deltas against the merge base: production +60/−25, tests +54/−23 (the new regression, plus one CLI case moved to the media CLI test module to stay under its line cap), docs +1.

Merge danger: two-way door. A revert restores the old selection; nothing is written or migrated, and the public plugin runtime types are unchanged. Blast radius: only openclaw infer audio transcribe and openclaw infer video describe runs that pass --model. Channel media understanding and runs without --model take the same path as before.

@clawsweeper

clawsweeper Bot commented Nov 1, 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 cli CLI command changes plugin: file-transfer size: S labels Nov 1, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Explicit audio and video inference model selections become the only attempted backend while retaining an exact matching configured entry’s settings.

Example: Run audio transcription with --model openai/whisper-1 while Deepgram nova-3 is configured.

  • Before: The recording goes to Deepgram nova-3, ignoring the flag.
  • After: The recording goes only to OpenAI whisper-1, and its failure does not trigger another backend.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, approved repair with relevant shipped-CLI proof and no actionable findings; required current-head CI has not finished.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The recorded built-CLI run exercises real media selection and provider transports with isolated state and recording HTTP fixtures, covering successful pins, failed pins without alternate uploads, no-flag controls, and whisper-1 preservation; the exercised production files match this head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An explicit audio or video model flag can silently upload the file to another configured backend or use a different transcription model.
Reason: The documented backend-selection contract has clear user value, and the written maintainer decision settles strict pinning without adding configuration or public API surface.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current CLI selection bug with approved fallback semantics; no actionable introduced defects were found, and current-head CI remains in progress.

Priority: P2
Reviewed head: 11c6bd14e2d9fdb97352d735adadbaac9b94706c

Before merge

None.

Findings

None.

Agent review details

How this fits together

The inference CLI passes a file and explicit model into the shared media runtime, which resolves one provider descriptor and returns text with provider/model attribution.

flowchart LR
  A[Inference CLI] --> B[File media runtime]
  B --> C[Media entry resolver]
  C --> D[Requested provider descriptor]
  D --> E[Provider transport]
  E --> F[Attributed text or error]
Loading

Technical review

Best possible solution:

Land the approved single-model selection through the existing media resolver once required current-head checks pass.

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

Current-main source establishes configured-entry precedence and automatic audio model substitution, consistent with yetval’s report and the supplied before/after CLI traces; this review executed no target code.

Is this the best way to solve the issue?

The patch repairs explicit selection in the existing resolver, preserves matching descriptor ownership, and leaves automatic channel selection and public plugin runtime contracts intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8a6d3a04ee74.

Provenance checked

  • CLI explicit-model forwarding changes intended behavior with a stated reason (feat: Add first-class infer CLI for inference workflows #62129: The original inference CLI reused shared media runtime operations; the later CLI consolidation preserved its existing flags and behavior.)
  • Configured model selection and secret ownership keeps the original intent (1e29cb3: The merged resolver refactor preserved capability filtering, preference order, and original configuration indexes for credential owners.)
  • Automatic audio selection and upload failure behavior keeps the original intent (9bbba7b: Provider-owned audio authentication and lazy automatic selection prevent an uploaded recording from silently moving to another provider while retaining explicitly configured fallback lists.)
  • Audio attribution regression keeps the original intent (fix(cli): preserve audio transcription provider and model output #147170: The CLI must report the provider and model that actually produced the transcript and preserve request hints and file output.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1e29cb3 adds src/media-understanding/resolve.ts:122 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1e29cb301fc4; files: src/media-understanding/resolve.ts)
  • Tak Hoffman: Raw commit ac66939 adds docs/cli/infer.md:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ac6693986bbf; files: docs/cli/infer.md)
  • Vincent Koc: Raw commit 6e74d77 adds src/media-understanding/runtime.ts:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 6e74d77a42e9; files: src/media-understanding/runtime.ts)

PR surface

Source +35, Tests +32, Docs +1, Other -1. Total +67 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 60 25 +35
Tests 3 54 22 +32
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 10 115 48 +67

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: same_root_cause
Canonical: #176246
Summary: This PR repairs the explicit audio/video selection defect documented by the canonical report, which was closed administratively rather than fixed.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded advanced CLI workflow currently sends media to a different provider or model despite an explicit selection.
  • merge-risk: 🚨 compatibility: Explicit selections now fail with the requested backend instead of using configured alternatives; obviyus records maintainer acceptance of this deliberate contract.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-01T11:51:13.656Z sha 7c722be :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-19T22:26:07.927Z sha f3d3739 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-19T23:06:51.894Z sha 2057fd7 :: needs maintainer review before merge. :: none

Reviewed November 19, 2026, 6:21 PM ET / 23:21 UTC (Revision 4).

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Nov 15, 2026
@alkor2000

Copy link
Copy Markdown
Contributor Author

Author maintenance update, November 15, 2026: this remains a draft pending the audio/video selection contract.

I rechecked official main snapshot 932b13220bfdac6e4b191c831421e0e8772b9c3d. The CLI still forwards explicit --model only as activeModel (command, lines 62–64); the media runner still selects configured capability entries before its automatic/chat-model route (runner, lines 727–740). This is a source recheck, not a new CLI or vendor test. Head remains b0908db8813de03305b51aec8828be7d11fd3c15; the November 8 validation in the body remains evidence for that head.

The decision needed is whether an explicit audio/video model is strictly pinned, or tried first with configured media fallbacks afterward. This draft implements requested-first with fallback, which can upload the file to another configured provider after failure. It does not claim approval of that policy or the optional public runtime field. I will keep it in draft until the contract is settled.

The related issue was closed by inactivity automation, explicitly without confirming the problem fixed. Original report/reproduction credit remains with yetval and #172409.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Nov 19, 2026
- An explicit --model is now the only media attempt: it reuses a configured
  tools.media.models descriptor only for the same provider/model, and never
  falls back to other configured entries, CLI backends or provider defaults.
- Route the CLI through an internal runMediaFileWithModel entry instead of
  a new public plugin runtime field; restore the documented pin contract.
@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Proof for head f3d3739 (built CLI, isolated state, local fixture providers that record every upload; no real accounts or keys). Base = merge base 5fb2315.

# #176246 / PR #190287: infer audio transcribe / video describe --model must pin the requested model
# Built CLI from source (ocx tiers: base dist-nodts 5fb231527f4f = PR merge base; candidate full build f3d3739a89),
# isolated HOME/OPENCLAW_HOME/OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH under mktemp, --profile p176246base|p176246cand.
# Fixtures (fixtures.mjs, local only, no real keys): A = configured tools.media.models chain
#   [mistral/voxtral-a-broken -> mistral/voxtral-a] (audio), [qwen/qwen-a-broken -> qwen/qwen-a] (video);
#   B = requested via --model (openai audio transcriptions, moonshot chat completions); W = openai transcription endpoint,
#   whisper case with no tools.media.models. Models containing "fail"/"broken" answer HTTP 500.
# Harness: run.sh <base|cand> <tree>. Each step lists the result and every upload the fixtures recorded.

# base tree=<tree>
# isolation: state=$S/state-<cfg> config=$S/<cfg>.json home=$S/home (S=$S)
$S/configured.json
## pin-audio: openclaw infer audio transcribe --file $S/tone.wav --model openai/gpt-4o-mini-transcribe (config=configured)
exit=0 result: {"provider":"mistral","model":"voxtral-a","text":"reply from A voxtral-a"}
uploads:
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a","status":200}
## pin-video: openclaw infer video describe --file $S/clip.mp4 --model moonshot/kimi-b (config=configured)
exit=0 result: {"provider":"qwen","model":"qwen-a","text":"reply from A qwen-a"}
uploads:
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a","status":200}
## pin-audio-fails: openclaw infer audio transcribe --file $S/tone.wav --model openai/b-fail (config=configured)
exit=0 result: {"provider":"mistral","model":"voxtral-a","text":"reply from A voxtral-a"}
uploads:
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a","status":200}
## pin-video-fails: openclaw infer video describe --file $S/clip.mp4 --model moonshot/b-fail (config=configured)
exit=0 result: {"provider":"qwen","model":"qwen-a","text":"reply from A qwen-a"}
uploads:
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a","status":200}
## control-audio: openclaw infer audio transcribe --file $S/tone.wav (config=configured)
exit=0 result: {"provider":"mistral","model":"voxtral-a","text":"reply from A voxtral-a"}
uploads:
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a","status":200}
## control-video: openclaw infer video describe --file $S/clip.mp4 (config=configured)
exit=0 result: {"provider":"qwen","model":"qwen-a","text":"reply from A qwen-a"}
uploads:
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a","status":200}
## whisper-no-config: openclaw infer audio transcribe --file $S/tone.wav --model openai/whisper-1 (config=whisper)
exit=0 result: {"provider":"openai","model":"gpt-4o-transcribe","text":"reply from W gpt-4o-transcribe"}
uploads:
  {"fixture":"W","path":"/v1/audio/transcriptions","model":"gpt-4o-transcribe","status":200}

# cand tree=<tree>
# isolation: state=$S/state-<cfg> config=$S/<cfg>.json home=$S/home (S=$S)
$S/configured.json
## pin-audio: openclaw infer audio transcribe --file $S/tone.wav --model openai/gpt-4o-mini-transcribe (config=configured)
exit=0 result: {"provider":"openai","model":"gpt-4o-mini-transcribe","text":"reply from B gpt-4o-mini-transcribe"}
uploads:
  {"fixture":"B","path":"/v1/audio/transcriptions","model":"gpt-4o-mini-transcribe","status":200}
## pin-video: openclaw infer video describe --file $S/clip.mp4 --model moonshot/kimi-b (config=configured)
exit=0 result: {"provider":"moonshot","model":"kimi-b","text":"reply from B kimi-b"}
uploads:
  {"fixture":"B","path":"/moonshot/v1/chat/completions","model":"kimi-b","status":200}
## pin-audio-fails: openclaw infer audio transcribe --file $S/tone.wav --model openai/b-fail (config=configured)
exit=1 result: {"provider":null,"model":null,"text":null}
error: [media-understanding] audio: failed (0/1) reason=Audio transcription failed (HTTP 500) Audio transcription failed (HTTP 500): B fixture failure 
uploads:
  {"fixture":"B","path":"/v1/audio/transcriptions","model":"b-fail","status":500}
  {"fixture":"B","path":"/v1/audio/transcriptions","model":"b-fail","status":500}
## pin-video-fails: openclaw infer video describe --file $S/clip.mp4 --model moonshot/b-fail (config=configured)
exit=1 result: {"provider":null,"model":null,"text":null}
error: [media-understanding] video: failed (0/1) reason=Moonshot video description failed (HTTP 500) Moonshot video description failed (HTTP 500): B fixture failure 
uploads:
  {"fixture":"B","path":"/moonshot/v1/chat/completions","model":"b-fail","status":500}
  {"fixture":"B","path":"/moonshot/v1/chat/completions","model":"b-fail","status":500}
## control-audio: openclaw infer audio transcribe --file $S/tone.wav (config=configured)
exit=0 result: {"provider":"mistral","model":"voxtral-a","text":"reply from A voxtral-a"}
uploads:
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a-broken","status":500}
  {"fixture":"A","path":"/mistral/v1/audio/transcriptions","model":"voxtral-a","status":200}
## control-video: openclaw infer video describe --file $S/clip.mp4 (config=configured)
exit=0 result: {"provider":"qwen","model":"qwen-a","text":"reply from A qwen-a"}
uploads:
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a-broken","status":500}
  {"fixture":"A","path":"/qwen/v1/chat/completions","model":"qwen-a","status":200}
## whisper-no-config: openclaw infer audio transcribe --file $S/tone.wav --model openai/whisper-1 (config=whisper)
exit=0 result: {"provider":"openai","model":"whisper-1","text":"reply from W whisper-1"}
uploads:
  {"fixture":"W","path":"/v1/audio/transcriptions","model":"whisper-1","status":200}

@obviyus obviyus changed the title fix(cli): try requested audio and video inference models first fix: send infer audio/video --model files only to the requested model Nov 19, 2026
@obviyus
obviyus marked this pull request as ready for review November 19, 2026 22:18
@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Marking ready for review: the maintainers decided the fallback contract. It follows docs/cli/infer.md (--model provider/model pins a specific backend), so an explicit --model is the only attempt and runs without it keep the configured fallbacks. Proof: #190287 (comment)

@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 19, 2026
- The mock factory changed with runMediaFileWithModel, so the mock-exports
  ratchet needs an isolation reason; prune its stale grandfathered hash.
@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit 577dd00 into openclaw:main Nov 19, 2026
121 checks passed
@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks @alkor2000 for the fix and @yetval for the report in #176246. This is merged in 577dd00: openclaw infer audio transcribe --model provider/model and infer video describe --model provider/model now pin the requested model, as docs/cli/infer.md says. The file goes only to that model (reusing a configured entry's settings only when it is the same provider and model); if it fails, the provider's existing error is returned and no other configured provider receives the file. Runs without --model keep the configured media models and fallbacks unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…openclaw#190287)

Root cause: src/cli/capability-cli/media-understanding-command.ts:49 passes `--model` only as `activeModel` (a conversation-model hint), and the media selector never treats it as a choice: `src/media-understanding/runner.ts:727` takes configured `tools.media.models` entries without looking at it, and with no entries, audio swaps the requested model for the provider default (`runner.ts:439`).

Related: openclaw#176246 (reported by @yetval; the earlier strict-pin proposal openclaw#172409 was closed in favor of that issue).

## What Problem This Solves

`openclaw infer audio transcribe --model provider/model` and `openclaw infer video describe --model provider/model` ignore the flag when `tools.media.models` has an entry, and upload the file to that configured entry, which is often a different provider. With no configured entry, `--model openai/whisper-1` is sent as `gpt-4o-transcribe`. The docs say `--model provider/model` pins a specific backend (`docs/cli/infer.md`).

## User Impact

With `--model`, the file goes only to the requested provider and model. If that model fails, its existing error is returned and no configured entry, CLI backend or provider default receives the file. Runs without `--model` keep today's configured selection and fallback chain.

## Why This Change Was Made

The maintainers chose strict pinning, as the docs already promise. The requested model becomes the only media attempt. It reuses a configured descriptor (credential owner, base URL, headers) only when that entry is the same provider and model. The CLI reaches this through an internal runtime entry, so the plugin runtime API is unchanged. The earlier revision's optional public `modelOverride` field and its SDK doc are removed. `docs/cli/infer.md` keeps the pin wording and adds one line for audio and video.

Thanks @alkor2000 for the original change (kept as the first four commits) and @yetval for the report and repro.

## Evidence

Observed proof: openclaw#190287 (comment). The CLI was built from source with isolated state and local fixture providers that record every upload. A is the configured chain (a failing entry, then a working one) for audio and video, B is requested with `--model`, and W is a transcription endpoint for the whisper-1 case.

| Run | Base 30c2ded | This PR f3d3739 |
|---|---|---|
| audio `--model openai/gpt-4o-mini-transcribe` | A ×3 (voxtral-a-broken ×2, voxtral-a), B 0 | B ×1 (gpt-4o-mini-transcribe), A 0 |
| video `--model moonshot/kimi-b` | A ×3 (qwen-a-broken ×2, qwen-a), B 0 | B ×1 (kimi-b), A 0 |
| audio `--model openai/b-fail` (B returns 500) | A ×3, exit 0 with A's text | B ×2 (500, transport retry), A 0, exit 1 with "Audio transcription failed (HTTP 500)" |
| video `--model moonshot/b-fail` (B returns 500) | A ×3, exit 0 with A's text | B ×2 (500), A 0, exit 1 with "Moonshot video description failed (HTTP 500)" |
| audio, no `--model` (control) | A ×3, result voxtral-a | A ×3, result voxtral-a (same) |
| video, no `--model` (control) | A ×3, result qwen-a | A ×3, result qwen-a (same) |
| audio `--model openai/whisper-1`, no `tools.media.models` | W model=gpt-4o-transcribe | W model=whisper-1 |

- `src/media-understanding/resolve.test.ts`: the new pin case (audio and video) fails on the merge base and passes here. `src/cli/capability-cli.test.ts` (121 tests) and the media runner/runtime suites pass.
- Full build (`--dts`) passes, including the plugin SDK export check. Head 2057fd7 adds only a `// mock-isolation:` comment on the media runtime mock in `capability-cli.test.ts` (the mock-exports ratchet asks for one when a mock factory changes; the mocked runtime would otherwise reach provider uploads and credential lookup), and drops that factory's stale grandfathered hash from `config/test-mock-exports-baseline.txt`, on top of the proven f3d3739; production code is identical.
- Deltas against the merge base: production +60/−25, tests +54/−23 (the new regression, plus one CLI case moved to the media CLI test module to stay under its line cap), docs +1.

Merge danger: two-way door. A revert restores the old selection; nothing is written or migrated, and the public plugin runtime types are unchanged. Blast radius: only `openclaw infer audio transcribe` and `openclaw infer video describe` runs that pass `--model`. Channel media understanding and runs without `--model` take the same path as before.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
…#190287)

Root cause: src/cli/capability-cli/media-understanding-command.ts:49 passes `--model` only as `activeModel` (a conversation-model hint), and the media selector never treats it as a choice: `src/media-understanding/runner.ts:727` takes configured `tools.media.models` entries without looking at it, and with no entries, audio swaps the requested model for the provider default (`runner.ts:439`).

Related: #176246 (reported by @yetval; the earlier strict-pin proposal #172409 was closed in favor of that issue).

## What Problem This Solves

`openclaw infer audio transcribe --model provider/model` and `openclaw infer video describe --model provider/model` ignore the flag when `tools.media.models` has an entry, and upload the file to that configured entry, which is often a different provider. With no configured entry, `--model openai/whisper-1` is sent as `gpt-4o-transcribe`. The docs say `--model provider/model` pins a specific backend (`docs/cli/infer.md`).

## User Impact

With `--model`, the file goes only to the requested provider and model. If that model fails, its existing error is returned and no configured entry, CLI backend or provider default receives the file. Runs without `--model` keep today's configured selection and fallback chain.

## Why This Change Was Made

The maintainers chose strict pinning, as the docs already promise. The requested model becomes the only media attempt. It reuses a configured descriptor (credential owner, base URL, headers) only when that entry is the same provider and model. The CLI reaches this through an internal runtime entry, so the plugin runtime API is unchanged. The earlier revision's optional public `modelOverride` field and its SDK doc are removed. `docs/cli/infer.md` keeps the pin wording and adds one line for audio and video.

Thanks @alkor2000 for the original change (kept as the first four commits) and @yetval for the report and repro.

## Evidence

Observed proof: #190287 (comment). The CLI was built from source with isolated state and local fixture providers that record every upload. A is the configured chain (a failing entry, then a working one) for audio and video, B is requested with `--model`, and W is a transcription endpoint for the whisper-1 case.

| Run | Base 5fb2315 | This PR f3d3739 |
|---|---|---|
| audio `--model openai/gpt-4o-mini-transcribe` | A ×3 (voxtral-a-broken ×2, voxtral-a), B 0 | B ×1 (gpt-4o-mini-transcribe), A 0 |
| video `--model moonshot/kimi-b` | A ×3 (qwen-a-broken ×2, qwen-a), B 0 | B ×1 (kimi-b), A 0 |
| audio `--model openai/b-fail` (B returns 500) | A ×3, exit 0 with A's text | B ×2 (500, transport retry), A 0, exit 1 with "Audio transcription failed (HTTP 500)" |
| video `--model moonshot/b-fail` (B returns 500) | A ×3, exit 0 with A's text | B ×2 (500), A 0, exit 1 with "Moonshot video description failed (HTTP 500)" |
| audio, no `--model` (control) | A ×3, result voxtral-a | A ×3, result voxtral-a (same) |
| video, no `--model` (control) | A ×3, result qwen-a | A ×3, result qwen-a (same) |
| audio `--model openai/whisper-1`, no `tools.media.models` | W model=gpt-4o-transcribe | W model=whisper-1 |

- `src/media-understanding/resolve.test.ts`: the new pin case (audio and video) fails on the merge base and passes here. `src/cli/capability-cli.test.ts` (121 tests) and the media runner/runtime suites pass.
- Full build (`--dts`) passes, including the plugin SDK export check. Head 2057fd7 adds only a `// mock-isolation:` comment on the media runtime mock in `capability-cli.test.ts` (the mock-exports ratchet asks for one when a mock factory changes; the mocked runtime would otherwise reach provider uploads and credential lookup), and drops that factory's stale grandfathered hash from `config/test-mock-exports-baseline.txt`, on top of the proven f3d3739; production code is identical.
- Deltas against the merge base: production +60/−25, tests +54/−23 (the new regression, plus one CLI case moved to the media CLI test module to stay under its line cap), docs +1.

Merge danger: two-way door. A revert restores the old selection; nothing is written or migrated, and the public plugin runtime types are unchanged. Blast radius: only `openclaw infer audio transcribe` and `openclaw infer video describe` runs that pass `--model`. Channel media understanding and runs without `--model` take the same path as before.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 577dd00)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit b2c0c30f5eda50b952a59fac964791bbb19eff80)
(cherry picked from commit 90c5ede417cb3ae2bcd454a31c4a9d0773c4d28d)
tideclaw-bot added a commit that referenced this pull request Nov 24, 2026
…#190287)

Baseline adaptation: Keep stable file runtime entry points and thread a separate explicit model pin to the shared media resolver. Preserve exact configured transport and credentials and implicit fallback. Prove only the requested provider model receives the video even on failure.

(cherry picked from commit 577dd00)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit fd2658eb1004bb8b5be83643648e1329cdddf49b)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…94251)

fix(infer): stop video runs on Ctrl+C

`openclaw infer video` dropped its execution context, and with it the cancel signal, so Ctrl+C left the provider request open until the CLI was force-killed about 2 seconds later. The existing execution context is now passed through, as audio already does. Uninterrupted runs are unchanged.

Evidence: built CLI with a real MP4 against a slow local video-provider fixture, twice per ref. Main needed SIGKILL after about 2,090 ms; with this change the CLI exits with 130 in under 100 ms and the HTTP request closes within 1.1 ms. Uninterrupted output and request bodies are identical. Details: openclaw#194251 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 3af1447)

Release adaptation: Forward video execution signal/assertCurrent and move existing guarded fetch/process scope to shared file owner. Retain baseline audio CLI and filesystem resolution: excluded HOLD audio/path migration not imported. Only13-line cancel regression, no fixture refactor.

Follow-up dispositions: 577dd00 fix: send infer audio/video --model files only to the requested model (openclaw#190287); bcb47e8 feat(google): add Nano Banana 2.1 image model as the default (openclaw#200468); 6f5d3b3 fix: local path commands pick a neighboring file when a symlinked folder is followed by `..` (openclaw#200031); 3577724 fix(auth): only the running Gateway refreshes shared OAuth sign-ins (openclaw#198214); 81daea9 fix(cli): run infer model run through the Gateway that owns state (openclaw#198141); 22b1aac fix(media): cancel interrupted attachment downloads (openclaw#194399); e43ec1e fix(infer): cancel interrupted image descriptions (openclaw#194391)

Validation: Baseline canceled-video assertion fails with16controls passing; candidate17/17passes,194251-green.log. Existing audio cancellation and workspace/cleanup behavior retained. Real MP4/CLI interrupt proof remains upstream-attributed, not locally rerun.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 853a96335df6193815789ebcc02d38af11123fcf)
(cherry picked from commit 2ea2570de7f13823a8174590bfddfbfabdbcd915)
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

2 participants