Skip to content

fix(openai): preserve video terminal outcomes and valid edit requests - #116917

Merged
steipete merged 1 commit into
mainfrom
codex/qa100-openai-video-terminal-submit
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa100-openai-video-terminal-submit

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes issues where OpenAI video creation or editing could hide the provider's actual rejection, misleadingly complain about a missing video ID, or poll a job that was already complete. Also fixes video-edit requests that supplied an unsupported model parameter and could therefore be rejected by OpenAI's edit endpoint.

These are two independent private OpenAI provider-owner defects affecting Sora video creation and video-to-video editing.

Why This Change Was Made

Use the authoritative status and nested error returned by OpenAI's initial video creation/edit response before deciding whether an asynchronous status poll is necessary. Share the same failure interpretation between initial submissions and subsequent polling, preserve existing request cleanup, and send only the official prompt/video parameters to /videos/edits.

The repair stays inside the bundled OpenAI provider owner. Public plugin SDK, authentication, configuration, provider routing, request-network policy, generated-media limits, operation deadlines, and pending-job polling remain unchanged.

User Impact

  • A video generation or edit rejected immediately now reports OpenAI's original actionable error, even when the failed response has no video ID.
  • An already-completed video creation or edit downloads immediately without a redundant status request that could fail or consume the remaining operation deadline.
  • Video-to-video edits no longer submit the unsupported model multipart field and instead follow the provider's documented edit schema.
  • Existing pending-job polling, model metadata, configured network rules, media-size protections, and one-time response cleanup continue to work.

Evidence

  • Frozen clean baseline and direct commit parent: e051a7bb4a6ba69b87391e990b00813114b1d482.
  • Exact isolated branch: codex/qa100-openai-video-terminal-submit.
  • Exact structured-reviewed candidate: d8b1565ee23f9a591b85e3270870fb158b1211fd.
  • Frozen baseline reproduces both defects: unconditional polling at extensions/openai/video-generation-provider.ts:439 and an unsupported edit model field at extensions/openai/video-generation-provider.ts:389.
  • Exact-commit focused OpenAI video provider suite: 19/19 tests passed.
OPENCLAW_VITEST_MAX_WORKERS=1 \
  node scripts/run-vitest.mjs \
  extensions/openai/video-generation-provider.test.ts
  • Regression coverage includes immediately failed submissions with and without IDs, preserved provider error messages, immediately completed JSON creation, failed/completed multipart edits, official edit request fields, pending-job polling, request cleanup, configured network policy, and generated-media limits.
  • Installed official [email protected] source directly confirms creation/edit return the authoritative Video status and nested failure message at node_modules/openai/src/resources/videos.ts:16, :87, :158, and :204; VideoEditParams permits only prompt and video at node_modules/openai/src/resources/videos.ts:344.
  • Codex runtime/protocol behavior was inspected directly at ../codex/sdk/python/src/openai_codex/_run.py:60, ../codex/codex-rs/app-server-protocol/src/protocol/v2/turn.rs:30, and ../codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs:1187.
  • Genuine exact-commit structured Codex gpt-5.6-sol / high review: clean, zero findings, 0.93 confidence.
  • Official TruffleHog 3.96.0 exact-commit content preflight: clean.
  • Targeted formatting, git diff --check, clean isolated worktree, frozen-parent ancestry, and unchanged clean canonical main all passed.
  • No live video-provider request was made.

Distinct Root Causes

  1. Initial video submission terminal status/error ownership incorrectly belonged to asynchronous polling instead of the authoritative submission response.
  2. Multipart video edits reused the creation model parameter despite OpenAI's edit endpoint accepting only prompt and video.

Explicit Exclusions

Existing held OpenAI/xAI realtime terminal-event work is unrelated and unchanged. No public configuration, authentication, plugin SDK, gateway protocol, dependency, persistence, or canonical-main behavior is modified.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 11:35 AM ET / 15:35 UTC.

ClawSweeper review

What this changes

This PR updates the bundled OpenAI video provider to handle failed or completed creation/edit submissions before polling and to send only documented fields for video edits.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for protected maintainer review. The supplied context describes a focused OpenAI provider bug fix, but the read-only inspection environment failed before current source, history, dependency contracts, and the complete diff could be verified, so no merge or correctness verdict is safe.

Priority: P2
Reviewed head: d8b1565ee23f9a591b85e3270870fb158b1211fd
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The supplied patch is focused and test-backed, but the review could not independently inspect it and the available proof is mock/test-only rather than observed provider behavior.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused regression tests but explicitly states that no live video-provider request was made; add redacted after-fix runtime output if maintainers require real-provider proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused regression tests but explicitly states that no live video-provider request was made; add redacted after-fix runtime output if maintainers require real-provider proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 3 items Repository inspection blocked: The required read-only inspection command failed before it could read AGENTS.md, source, tests, git history, scoped guidance, or the installed dependency contract; this review therefore relies only on the supplied GitHub context.
Submitted validation claim: The PR body reports a focused 19-test OpenAI video-provider run at head d8b1565, but it is test evidence rather than independently inspected real provider behavior.
Protected maintainer handling: The supplied PR context includes the protected maintainer label, which requires explicit maintainer handling rather than automated cleanup.
Findings None None.
Security None None.

How this fits together

The bundled OpenAI extension submits video creation or editing requests, then either downloads completed media or polls pending provider jobs. Its response interpretation determines whether users receive the provider’s terminal error, a completed video, or a follow-up status request.

flowchart LR
  A[Video creation or edit request] --> B[OpenAI video provider]
  B --> C[Initial OpenAI response]
  C --> D{Terminal or pending status?}
  D -->|Failed| E[Actionable provider error]
  D -->|Completed| F[Download generated video]
  D -->|Pending| G[Poll video job]
  G --> F
Loading

Decision needed

Question Recommendation
Should an OpenAI-extension owner complete the blocked source/dependency review and decide whether test-only evidence is sufficient for this provider-runtime repair? Complete owner review: Inspect the exact head, current provider flow, OpenAI dependency types, and focused tests before deciding whether to merge.

Why: The protected maintainer label and unavailable repository inspection prevent an automated reviewer from safely judging the provider API contract or merge readiness.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused regression tests but explicitly states that no live video-provider request was made; add redacted after-fix runtime output if maintainers require real-provider proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Current source, the complete patch, installed OpenAI dependency types, relevant callers, tests, and feature history were not inspectable after the read-only sandbox failed; merging without that review would leave correctness and contract compatibility unverified.
  • Resolve merge risk (P1) - The PR body states that no live OpenAI video request was made, so after-fix behavior against the provider endpoint remains unproven.
Agent review details

Security

None.

PR surface

Source +9, Tests +110. Total +119 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 26 17 +9
Tests 1 111 1 +110
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 137 18 +119

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Have an OpenAI-extension owner review the exact head against the installed OpenAI video API contract, then retain the focused regression tests and add redacted after-fix provider evidence if a safe real-provider setup is available.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Have an OpenAI-extension owner review the exact head against the installed OpenAI video API contract, then retain the focused regression tests and add redacted after-fix provider evidence if a safe real-provider setup is available.

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

Unclear. The PR body describes source locations and focused regression coverage, but this review could not inspect or execute current source because the read-only sandbox failed before repository access.

Is this the best way to solve the issue?

Unclear. The proposed owner-local repair appears narrowly scoped from the supplied context, but current implementation, callers, sibling behavior, and the installed OpenAI dependency contract were not available for comparison.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 0d209991b684.

Labels

Label changes:

  • add P2: The reported behavior is a bounded provider-runtime defect that can misreport failed video operations or reject valid video edits, with no supplied evidence of broader availability or security impact.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused regression tests but explicitly states that no live video-provider request was made; add redacted after-fix runtime output if maintainers require real-provider proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: The reported behavior is a bounded provider-runtime defect that can misreport failed video operations or reject valid video edits, with no supplied evidence of broader availability or security impact.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused regression tests but explicitly states that no live video-provider request was made; add redacted after-fix runtime output if maintainers require real-provider proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Repository inspection blocked: The required read-only inspection command failed before it could read AGENTS.md, source, tests, git history, scoped guidance, or the installed dependency contract; this review therefore relies only on the supplied GitHub context.
  • Submitted validation claim: The PR body reports a focused 19-test OpenAI video-provider run at head d8b1565, but it is test evidence rather than independently inspected real provider behavior. (extensions/openai/video-generation-provider.test.ts, d8b1565ee23f)
  • Protected maintainer handling: The supplied PR context includes the protected maintainer label, which requires explicit maintainer handling rather than automated cleanup.

Likely related people:

  • steipete: The provided PR context attributes the OpenAI video-provider repair and its stated validation to this contributor; repository history could not be inspected to establish broader ownership. (role: proposed repair author; confidence: low; commits: d8b1565ee23f; files: extensions/openai/video-generation-provider.ts, extensions/openai/video-generation-provider.test.ts)

Rank-up moves

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

  • Provide redacted after-fix runtime evidence if a safe OpenAI video test setup is available.
  • Have an OpenAI-extension owner verify the exact dependency contract and current-main integration path.

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.

@steipete
steipete merged commit 51a78a4 into main Jul 31, 2026
94 of 101 checks passed
@steipete
steipete deleted the codex/qa100-openai-video-terminal-submit branch July 31, 2026 16: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

extensions: openai maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant