Skip to content

fix(openai): use canonical multipart video submissions - #116995

Merged
steipete merged 1 commit into
mainfrom
codex/wave3-openai-video-multipart
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/wave3-openai-video-multipart

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenAI Sora video generation sent both text-only and image-reference requests as JSON even though the official OpenAI API and the installed [email protected] SDK require multipart uploads for POST /v1/videos.

Two independently verified user-visible root causes:

  1. Text-to-video creation used application/json instead of multipart prompt, model, and generation options.
  2. Image-to-video creation encoded a JSON data URL instead of uploading its actual image as the multipart input_reference file.

Why This Change Was Made

The private OpenAI video owner now builds one canonical multipart request for text generation, image-reference generation, and existing video edits. Text and image creation target /videos; edits continue targeting /videos/edits with only the SDK-supported prompt and video fields.

The refactor deletes duplicate JSON/data-URL request branches and removes 42 production lines. Authentication, SSRF policy, dispatcher policy, polling, timeout budgets, download bounds, release cleanup, and public provider contracts remain unchanged.

User Impact

  • Text-to-video requests match OpenAI's actual Sora upload contract.
  • Image-to-video requests upload the reference image with its correct filename, MIME type, and bytes.
  • Existing video edits, immediate terminal failures, polling, configured request policy, and bounded downloads continue to work.

Evidence

  • Frozen canonical baseline: 36b80ada3ceae2de21b3d8710b883d778e4c4578.

  • Immutable reviewed candidate: 31c962e4f769736e9b4d7ece9a7b763fdd5b024c.

  • Official OpenAI SDK inspected directly: node_modules/openai/src/resources/videos.ts:14, :84, :178, and :225.

  • Actual installed SDK capture-fetch proof confirmed that text creation, image-reference creation, and video edits all emit multipart requests; the image is uploaded under input_reference and edits send only prompt plus video.

  • Remote Blacksmith Testbox recreated a detached worktree from the exact frozen baseline, verified both changed Git blobs, and proved its complete staged tree exactly matched immutable candidate tree be47a1ed9fca5486d677a89f218a117eefa3ce75.

  • Exact reconstructed candidate owner suite:

    pnpm test extensions/openai/video-generation-provider.test.ts
  • 19/19 owner tests passed. Provider: blacksmith-testbox; lease: tbx_01kywr09d6pf5bxg0a89kzfs2h; run: https://github.com/openclaw/openclaw/actions/runs/30656525347. The lease was stopped and its completed status verified.

  • Exact full-branch Codex/Sol high-reasoning autoreview with explicit --max-priority P3: zero actionable P0/P1/P2/P3 findings, confidence 0.96, genuine TruffleHog clean.

  • Separate blind owner/SDK/source review: clean across P0/P1/P2/P3.

  • Targeted oxfmt, oxlint, git diff --check, immutable base/tree/blob guards, and clean final worktree: passed.

  • Production delta: 32 additions / 74 deletions = -42 lines; regression tests: 28 additions / 26 deletions.

@steipete
steipete marked this pull request as ready for review July 31, 2026 18:58
@steipete
steipete merged commit 652a47e into main Jul 31, 2026
147 of 151 checks passed
@steipete
steipete deleted the codex/wave3-openai-video-multipart branch July 31, 2026 19:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant