Skip to content

feat(video): add the DubVideo tool that dubs a clip through the Videos API - #1844

Merged
edenreich merged 8 commits into
mainfrom
fix/issue-1840
Nov 15, 2026
Merged

edenreich merged 8 commits into
mainfrom
fix/issue-1840

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1840

Summary

Adds the DubVideo agent tool: a Mirelo model dub of an existing clip through the gateway's Videos API. The tool posts the multipart create to POST /v1/videos, polls the job with the TextToVideo polling code and its timeout and poll_interval knobs, and downloads the finished MP4 from /content. It is registered only when both video_to_sfx.enabled and video_to_sfx.dub are true - the switch pattern CreateAvatar uses under text_to_video - and its description states Mirelo's limit that only the generated mix is laid onto the clip, so it offers no track parameter.

The video_to_sfx block itself landed on main with the VideoToSFX tool (#1843) while this PR was open. This PR now adds only the dub switch to it, so video_to_sfx.enabled registers VideoToSFX as on main and DubVideo needs enabled and dub together.

The SDK (v1.46.0) carries the dubbing fields in CreateVideoRequest but its hand-written CreateVideo encoder drops them, so the dub create rides a small CLI-side gateway (agentinfra.DubGateway) that posts the same multipart form with bearer auth and provider routing. The SDK client keeps covering retrieve and content download, and go.mod ends this PR byte-identical to main.

Changes

  • config: a dub switch on the existing video_to_sfx block, next to enabled, model, output_dir and require_approval
  • agent domain: VideoDubRequest and a Dub method on the VideoService interface
  • agent infrastructure: Dub creates the job through the injected DubGateway (multipart create with the video part and preserve_speech), then shares TextToVideo's finishVideoJob (poll, download, write). The clip is checked against the gateway's 10 MiB body limit before sending
  • container: wires DubGateway from the gatewayEndpoint that VideoToSFX already uses (base URL, bearer key and the propagated gateway transport)
  • gateway supervisor: the auto-started gateway also gets VIDEOS_ENABLED=true while the dub switch is on
  • tools: DubVideo.yaml manifest, DubVideoTool (video looked up in the working directory, then the TextToVideo output directory, bare output_path into text_to_video.output_dir), ToolDubVideo constant, registry gating, the videoExtensions list shared with VideoToSFX, and the golden tool definitions snapshot (52 tools)
  • tests: a whitespace-trimming case and a table-driven validation test in the video_to_sfx config tests, infrastructure Dub tests against a stubbed Videos API, tool unit and registry tests, and a full-loop integration test (DubVideoToolAgainstMockGateway)
  • docs: DubVideo row and section in tools-reference.md, a Dubbing section in text-to-video.md, and the dub key and INFER_VIDEO_TO_SFX_DUB in the video_to_sfx section of configuration-reference.md, which now covers both tools

Downstream impact

…workflow

Registered only when video_to_sfx.enabled and video_to_sfx.dub are both true, the switch pattern CreateAvatar uses under text_to_video. The tool posts the multipart create to /v1/videos with video_to_sfx.model (default mirelo/sfx-2.0), polls the job with the TextToVideo polling code and its timeout and poll_interval knobs, and downloads the MP4 from /content. The description states Mirelo's limit that only the generated mix is laid onto the clip, so it offers no track parameter.

The dub create rides a small CLI-side gateway (agentinfra.DubGateway) because the SDK's CreateVideo drops the dubbing fields (the video part and preserve_speech) that schemas v1.14.0 added - the sync PR did not extend the SDK's hand-written encoder. The SDK client keeps covering retrieve and content download, and the auto-started gateway also gets VIDEOS_ENABLED=true while the dub switch is on.

Tests cover create, poll and download against a stubbed Videos API: infrastructure unit tests plus a full-loop integration test, along with config, tool and registry gating tests.
tools-reference.md gains a DubVideo row and section, text-to-video.md a Dubbing section with the configuration and Mirelo's mix-only limit, and configuration-reference.md documents the video_to_sfx block with its env overrides and the VIDEOS_ENABLED wiring the gateway now gets while the dub switch is on.
main gained the VideoToSFX tool, which defines the same video_to_sfx
config block this branch introduced for DubVideo.

- config: one VideoToSFXConfig - main's enabled, model, output_dir and
  require_approval plus this branch's dub switch
- registry: both tools register, VideoToSFX on enabled and DubVideo on
  enabled and dub
- container: the dub gateway reuses main's gatewayEndpoint and the
  duplicate sdkBaseURL helper is dropped
- tools: one shared videoExtensions list, and the DubVideo tests pass the
  extra NewRegistry argument
- golden tool definitions: 52 built-ins
- docs: the two video_to_sfx config sections are folded into one
The tool spelled its argument names, result keys, output file prefix and
extension as literals, each typed in Validate and again in Execute. They
are now constants, the accepted clip formats in its errors come from the
shared videoExtensions list, and the tests refer to ToolDubVideo.

The result key a media tool reports its saved file under gets one name,
savedPathKey, used by the shared formatter, DubVideo and VideoToSFX.
The dubbing create spelled its form field names, the Videos route, the
provider query parameter, the success status bounds, the error read cap
and the MiB conversion as literals. They are now constants, and the
upload limit in its error is derived from maxVideoUploadBytes.

The header names and bearer scheme are named once and shared by the two
raw gateway requests, the dub create and the VideoToSFX scoring call.
Dub split its model id on a literal slash where config.ParseModel already
does it. Its oversize test hardcoded 11 MiB instead of one byte past
maxVideoUploadBytes, and the integration test spelled the default model
id that config.VideoToSFXGatewayDefaultModel names.
The rule that DubVideo needs both video_to_sfx.enabled and dub was spelled
out in the registry, the tool and twice in the gateway supervisor, where
it also sat unparenthesized next to the TextToVideo check.

VideoToSFXConfig.DubEnabled now owns the rule and Config.NeedsGatewayVideos
decides when the managed gateway gets VIDEOS_ENABLED, the way
NeedsGatewayAudio already does for the Audio API.
@edenreich

Copy link
Copy Markdown
Contributor

@infer can you review this PR? is it ready for merge? use /ponytail:ponytail /ponytail:ponytail-review /clean-architecture /clean-code /domain-driven-design /go /go-concurrency Any code smell?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/glm-5.3-flash · Action: v0.59.8 · CLI: v0.261.0 · View Job

Todos

  • Read the full PR diff (origin/main...HEAD)
  • Read key changed files in full (gateway, service, tool, config, container)
  • Trace callers of changed/shared functions (finishVideoJob, videoExtensions, config helpers)
  • Check concurrency, error handling, and edge cases in the new code
  • Verify build/lint/tests pass on the PR head
  • Write the full review with ponytail-review format and findings JSON

Pull Request

#1844

✅ Infer Result: Success

All verifications are complete: full test suite green, lint clean. Let me finalize the todos and deliver the review.

Review of PR #1844 - DubVideo tool

What this change does: Adds the DubVideo agent tool, which dubs an existing clip through the gateway's Videos API: a multipart create (the SDK's CreateVideo drops the dub fields, so a small CLI-side DubGateway posts it, marked as a shortcut: until sdk#254 lands), then the reuse of the existing TextToVideo poll/download loop. Registration gates on video_to_sfx.enabled plus a dub switch, copying the CreateAvatar pattern, and the auto-started gateway gets VIDEOS_ENABLED=true while either needs the Videos API.

Architecture check (clean-architecture / DDD / clean-code / go / go-concurrency): holds up well. VideoDubRequest and Dub live on the domain VideoService interface, the tool consumes only that interface, the HTTP gap stays confined to infrastructure/ behind an intent-revealing port, the container wires the concrete, and the supervisor routes through the config helper instead of duplicating a second condition - dependencies point inward on every edge. Names carry intent, functions are small, errors wrap with context, no goroutines are started, cancellation threads through the ctx, and the test stubs are mutex-guarded. Verified locally: go test on config, agent/infrastructure, tools and the full integration suite all pass, and golangci-lint is clean on every changed package. The tests are unusually thorough (tool validation table, registry gating, golden snapshot at 52 tools, timeouts, and a full-loop mock-gateway test that asserts the exact multipart form).

Findings:

Must fix:

  1. A huge clip reads fully into memory before the 10 MiB check (internal/agent/infrastructure/video_dub_gateway.go:66-70)
    • What this is: CreateDubbing loads the clip with os.ReadFile, then checks len(data) > maxVideoUploadBytes.
    • Problem: The check runs after the read. A user asking to "dub holiday.mov" with a 4 GiB clip gets 4 GiB allocated - doubled again by the multipart bytes.Buffer - before the friendly limit error; on a typical machine the OOM killer can take down the whole CLI session instead of returning the intended message. The sibling VideoSFXService.Score streams the same payload (os.Open + io.Copy) and never holds the file.
    • Fix: os.Stat first and reject over the limit, then stream the file into the form part like Score does (or, minimal, keep the stat-first check and let the existing len(data) check stay as the belt). While there, note the 10 MiB is the gateway's default (SERVER_MAX_REQUEST_BODY_SIZE): if an operator raises it, "exceeds the gateway's 10 MiB request limit" becomes wrong - name the knob the way the SFX path's 413 handler does.
    • If we skip it: A plausible misuse crashes the CLI rather than producing the friendly error the check was added for.

Should fix:

  1. DubVideo ignores video_to_sfx.require_approval (internal/tools/dub_video.go:53)
    • What this is: DubVideoTool.Manifest() returns the bare manifest.
    • Problem: VideoToSFX wires .WithRequireApproval(t.config.VideoToSFX.RequireApproval), and CreateAvatar - the exact pattern this PR cites for the switch - wires the parent section's knob the same way. So a user who sets require_approval: true on video_to_sfx gets approval for VideoToSFX but not DubVideo, even though both upload the same footage to a third party, and no knob anywhere can require approval for a dub.
    • Fix: One line - .WithRequireApproval(t.config.VideoToSFX.RequireApproval) (the golden test is unaffected: the golden config leaves RequireApproval nil, and a nil pointer keeps the manifest's false default).
    • If we skip it: The approval gate users apply to footage leaving the machine silently does not cover dubs.

Nice to have:

  1. Job-loop scaffolding now copied three ways (internal/agent/infrastructure/video_service.go:120-122)

    • What this is: The timeout context (cmp.Or(...), WithTimeout, defer cancel) exists verbatim in both Dub and runVideoJob, and model resolution is duplicated too: Render splits with strings.Cut while Dub and Score use config.ParseModel.
    • Problem: Near-copies that must change together - a future fix (trimming, a new knob) lands in two of the three.
    • Fix: One small helper (a deadline context and/or the provider/model split) reused by Render and Dub. About -6 lines.
    • If we skip it: Cosmetic drift risk, nothing breaks today.
  2. Extension check runs on the untrimmed name (internal/tools/dub_video.go:67)

    • What this is: Validate trims for the empty check right above, but tests filepath.Ext(rawVideo) untrimmed; the sibling VideoToSFX trims before its ext check (video_to_sfx.go:75).
    • Problem: "video": "clip.mp4 " (trailing space) fails with "must be one of .mov, .mp4, .m4v, .webm" while VideoToSFX accepts the same argument.
    • Fix: Trim once and reuse across both checks.
    • If we skip it: A needless retry round-trip with the model on a whitespace-bearing name.

Verdict: fix 1 and 2 first.

Lean: -6 lines possible.

Not checked: the gateway's real Videos API dub form contract against the inference-gateway/gateway source and live provider behavior - both out of reach here, so the field names ride on the PR's schemas-v1.14.0 account; also the three pending CI checks (postgres, e2e, test) - I ran the unit/integration/lint equivalents locally and they are green.

Model: ollama_cloud/glm-5.3-flash · Action: v0.59.8 · CLI: v0.261.0 · Exit Code: 0 · Duration: 4m 17s

Tokens: 1,641,284 in · 30,262 out · 1,671,546 total (22 requests)

Tool calls: 34 total · 100% success rate

Traces
Session: 1794750406-a7571e5c

session (headless, success)                                                                        4m10s
├── chat ollama_cloud/glm-5.3-flash                                                                 4.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.8s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.8s
├── execute_tool Skill call_70l6fa1i                                                               133µs
├── execute_tool Skill call_eotay5cp                                                               229µs
├── chat ollama_cloud/glm-5.3-flash                                                                 1.3s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Skill call_txpcury7                                                                95µs
├── execute_tool Skill call_dhf9ox5i                                                                90µs
├── chat ollama_cloud/glm-5.3-flash                                                                 1.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.3s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.3s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.3s
├── execute_tool Skill call_mdjnh1i6                                                                77µs
├── execute_tool Skill call_tz4akggj                                                                77µs
├── chat ollama_cloud/glm-5.3-flash                                                                 1.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.2s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.2s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.2s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.2s
├── execute_tool Skill call_8cl1sx4x                                                                99µs
├── chat ollama_cloud/glm-5.3-flash                                                                 2.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     2.8s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        2.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 2.8s
├── execute_tool TodoWrite call_u5d2jni4                                                            67µs
├── chat ollama_cloud/glm-5.3-flash                                                                 1.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.5s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.5s
├── execute_tool Bash call_is35yzfr                                                                  1ms
├── chat ollama_cloud/glm-5.3-flash                                                                735ms
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      727ms
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    722ms
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       722ms
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                722ms
├── execute_tool BashOutput call_d9tln12s                                                           68µs
├── chat ollama_cloud/glm-5.3-flash                                                                18.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      18.8s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    18.8s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       18.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                18.8s
├── execute_tool TodoWrite call_crsrlft4                                                            87µs
├── execute_tool Read call_479901rz                                                                618µs
├── chat ollama_cloud/glm-5.3-flash                                                                 3.4s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       3.4s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     3.3s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        3.3s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 3.3s
├── execute_tool Memory call_bb842pgw                                                               87µs
├── execute_tool Bash call_nhuvwlwk                                                                  4ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.9s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.9s
├── execute_tool Grep call_lo9eeips                                                                839ms
├── execute_tool Grep call_jbgi5h8g                                                                214ms
├── chat ollama_cloud/glm-5.3-flash                                                                 1.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.5s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.5s
├── execute_tool Grep call_odz8kaqk                                                                 15ms
├── execute_tool Read call_j1ytsej5                                                                880µs
├── chat ollama_cloud/glm-5.3-flash                                                                36.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      36.1s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    36.0s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       36.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                36.0s
├── execute_tool Read call_qrmr1wat                                                                  1ms
├── execute_tool Read call_cf0kzijc                                                                949µs
├── chat ollama_cloud/glm-5.3-flash                                                                13.8s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      13.7s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    13.7s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       13.7s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                13.7s
├── execute_tool BashOutput call_xx0s6gw6                                                          104µs
├── execute_tool Grep call_fzb2q33l                                                                  3ms
├── chat ollama_cloud/glm-5.3-flash                                                                 2.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.9s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.8s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.8s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.8s
├── execute_tool Read call_9lihzr6w                                                                933µs
├── execute_tool Grep call_i3ihb247                                                                102ms
├── chat ollama_cloud/glm-5.3-flash                                                                13.7s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      13.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    13.6s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       13.6s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                13.6s
├── execute_tool Grep call_rzi0qow8                                                                379ms
├── execute_tool Bash call_6aonl35f                                                                 16ms
├── chat ollama_cloud/glm-5.3-flash                                                                 1.6s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       1.6s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.5s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.5s
├── execute_tool Read call_cn7w0a1d                                                                829µs
├── execute_tool Read call_ruj14wka                                                                  6ms
├── chat ollama_cloud/glm-5.3-flash                                                                 5.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       5.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     5.4s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        5.4s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 5.4s
├── execute_tool Bash call_ds9d9mnq                                                                 14ms
├── execute_tool BashOutput call_9ynk4pcq                                                           90µs
├── chat ollama_cloud/glm-5.3-flash                                                                24.1s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      24.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    23.9s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       23.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                23.9s
├── execute_tool Grep call_9xrjfd7h                                                                719ms
├── chat ollama_cloud/glm-5.3-flash                                                                 7.2s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       7.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     7.0s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        7.0s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 7.0s
├── execute_tool Wait call_fv7pwe8j                                                                52.5s
├── chat ollama_cloud/glm-5.3-flash                                                                 2.0s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                       2.0s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]     1.9s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                        1.9s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                 1.9s
├── execute_tool BashOutput call_x575r158                                                           59µs
├── chat ollama_cloud/glm-5.3-flash                                                                26.5s
│   ╰── POST /v1/chat/completions [inference-gateway, server]                                      26.5s
│       ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    26.5s
│           ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       26.5s
│               ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                26.5s
├── execute_tool TodoWrite call_4auudm9k                                                            69µs
╰── chat ollama_cloud/glm-5.3-flash                                                                20.8s
    ╰── POST /v1/chat/completions [inference-gateway, server]                                      20.8s
        ╰── POST 127.0.0.1:8080/proxy/ollama_cloud/chat/completions [inference-gateway, client]    20.7s
            ╰── POST /proxy/{provider}/{path...} [inference-gateway, server]                       20.7s
                ╰── POST ollama.com/v1/chat/completions [inference-gateway, client]                20.7s
Stats
Tool Calls

╭────────────┬───────┬───────┬─────────╮
│ Tool       │ Calls │ Fail% │ Avg     │
├────────────┼───────┼───────┼─────────┤
│ Skill      │ 7     │ 0%    │ 100µs   │
│ Read       │ 7     │ 0%    │ 2ms     │
│ Grep       │ 7     │ 0%    │ 325ms   │
│ BashOutput │ 4     │ 0%    │ 78µs    │
│ Bash       │ 4     │ 0%    │ 9ms     │
│ TodoWrite  │ 3     │ 0%    │ 69µs    │
│ Memory     │ 1     │ 0%    │ 86µs    │
│ Wait       │ 1     │ 0%    │ 52501ms │
╰────────────┴───────┴───────┴─────────╯

Token Usage

╭────────────────────────────┬─────────┬─────────┬────────────┬─────────┬──────╮
│ Model                      │ Prompt  │ Cached  │ Completion │ Total   │ Cost │
├────────────────────────────┼─────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/glm-5.3-flash │ 1641284 │ 1236480 │ 30262      │ 1671546 │ -    │
╰────────────────────────────┴─────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ headless │ 1        │
╰───────────┴──────────┴──────────╯

Triggered by edenreich · Infer Action · OSS

@inference-gateway-maintainer inference-gateway-maintainer Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full review: #1844 (comment)

Comment thread internal/tools/dub_video.go Resolved
Comment thread internal/tools/dub_video.go Resolved
- The dub create read the whole clip into memory before checking it
  against the upload limit, so a multi-gigabyte clip could exhaust memory
  instead of returning the limit error. It now checks the file size
  first and streams the clip into the form. The error calls the limit
  the gateway's default, which stays true when an operator raises it.
- DubVideo ignored video_to_sfx.require_approval, so the approval a user
  set for footage leaving the machine covered VideoToSFX but not a dub.
- The clip name is trimmed once, so a name with surrounding spaces passes
  the extension check as it does in VideoToSFX.
- Rendering and dubbing share one job deadline helper, and Render splits
  its model id with config.ParseModel like the other gateway services.
@edenreich
edenreich merged commit 9c88889 into main Nov 15, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1840 branch November 15, 2026 14:21
@edenreich edenreich moved this from Todo to Done in 2026 Nov 15, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.262.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add a DubVideo tool that returns a clip with its generated soundtrack

1 participant