Skip to content

fix(video): retain registration resources through generation - #142876

Merged
steipete merged 1 commit into
mainfrom
codex/video-generation-resources
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/video-generation-resources

Conversation

@steipete

@steipete steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Related: #140674, #142834

What Problem This Solves

Default video generation could leak cold plugin registrations or close managed resources during asynchronous model-capability lookup and generation.

Why This Change Was Made

The video runtime now uses the shared capability owner from #142834. Its lifetime covers capability lookup, provider selection and fallback, actual generation, result validation, metadata projection, and tracked cleanup. The original operation body remains unchanged. Raw registrations and caller-supplied resolvers retain their existing custody.

User Impact

Operation-owned registrations close after completed video generation, including failures. The supported result contract still permits buffers and provider-hosted URLs; callers retain ownership of later URL downloads, and cleanup must preserve completed artifacts. Polling, timeout hints, aliases, model overrides, mode/capability checks, options, and duration normalization remain unchanged. No public API, configuration, schema, dependency, or version changes.

Evidence

The unchanged production baseline failed six native SQLite ownership cases while the raw-host control passed. All seven final cases and 137 existing video/shared/music sibling tests pass. The full independent Codex review is clean. The canonical changed gate passed in 363.1 seconds and the ordinary build in 215.0 seconds.

Actual compiled public video-generation calls ran buffer → URL → rejection → buffer in cold, managed, and raw modes. Cold operations registered/disposed four times; managed operations reused one registration until host release; raw operations received no automatic disposal and closed through caller cleanup. A separately owned fixture HTTP server served the returned URL after provider disposal. Saved and downloaded MP4 output independently decoded to the expected H.264 frame. Native close markers and read-only SQLite reopening verified completion. Source and all 11,389 artifacts stayed unchanged; every owned process group joined.

Illustrative call times were 25.52 / 4.84 / 6.20 / 3.21 ms cold, 8.90 / 1.93 / 4.01 / 4.82 ms managed, and 8.22 / 1.51 / 2.95 / 1.81 ms raw. These are synthetic observations, not a statistical before/after performance claim. No vendor credentials or real user state were used.

This default-runtime slice does not claim to cancel remote backend jobs, drain untracked vendor download siblings, or own the agent tool's prepared callbacks and detached jobs. Those require their actual producer owners.

@clawsweeper

clawsweeper Bot commented Sep 9, 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 size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 2:21 AM ET / 06:21 UTC (Revision 2).

ClawSweeper review

What this changes

The PR keeps plugin resources available throughout video generation and result processing, then releases operation-owned registrations, with lifecycle tests and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix absent from current main. No actionable introduced defect was found, and the previous draft-status blocker is resolved.

Priority: P2
Reviewed head: 884b6377df1e1a5b94f834f319838c71bc0cc847

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful native regressions and relevant compiled-runtime observations.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records compiled public video-runtime calls using native SQLite across cold, managed, and raw ownership, including rejection recovery and usable MP4/HTTP artifacts after cleanup; these observations exercise the changed acquisition-to-result boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records compiled public video-runtime calls using native SQLite across cold, managed, and raw ownership, including rejection recovery and usable MP4/HTTP artifacts after cleanup; these observations exercise the changed acquisition-to-result boundary.
Evidence reviewed 8 items Introduced ownership boundary: The wrapper retains providers around the complete existing operation and bypasses acquisition when both caller-owned resolvers are supplied. Provider indexing uses the existing canonical and alias helpers.
Existing shared lifetime owner: The acquisition helper retains managed registrations before provider projection, owns fresh registrations, waits for tracked work, and joins cleanup. Raw registrations retain their existing custody.
Regression coverage: Seven native-resource cases cover cold buffer, URL and rejection outcomes; managed release during capability lookup; raw ownership; override selection; and fallback. Assertions check metadata projection, physical database closure, and URL retrieval after disposal. Tests were inspected, not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The video runtime receives generation requests from the CLI and plugin runtime, selects providers, and returns completed video buffers or URLs. Plugin registration resources must survive capability lookup, generation, and result processing.

flowchart TD
  A[Video request] --> B[Acquire or retain plugin resources]
  B --> C[Select provider and check capabilities]
  C --> D[Generate video with fallback]
  D --> E[Validate assets and project metadata]
  E --> F[Release operation resources]
  F --> G[Return assets or error]
  G --> H[Caller downloads returned URLs]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +37, Tests +353, Docs +6. Total +396 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 37 0 +37
Tests 1 353 0 +353
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 396 0 +396

Review metrics

Metric Value Why it matters
Ownership implementation and coverage Production +37 lines; tests +353 lines across 7 cases Production growth adapts the existing shared owner, while most added code verifies actual resource lifetime and caller-custody boundaries.

Technical review

Best possible solution:

Use the shared operation owner for default video generation while preserving caller custody and completed buffer and URL artifacts.

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

Yes, source identifies the unowned default-generation path, and the native regression cases exercise early managed release and missing cold cleanup. No tests were executed in this read-only review.

Is this the best way to solve the issue?

Yes, this applies the established music/image ownership pattern without changing generation policy or adding a competing public API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 64ef483a1003.

Labels

Label justifications:

  • P2: This repairs bounded video-provider resource leaks and premature cleanup without evidence of a widespread runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records compiled public video-runtime calls using native SQLite across cold, managed, and raw ownership, including rejection recovery and usable MP4/HTTP artifacts after cleanup; these observations exercise the changed acquisition-to-result boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records compiled public video-runtime calls using native SQLite across cold, managed, and raw ownership, including rejection recovery and usable MP4/HTTP artifacts after cleanup; these observations exercise the changed acquisition-to-result boundary.

Evidence

What I checked:

  • Introduced ownership boundary: The wrapper retains providers around the complete existing operation and bypasses acquisition when both caller-owned resolvers are supplied. Provider indexing uses the existing canonical and alias helpers. (src/video-generation/runtime.ts:120, 884b6377df1e)
  • Existing shared lifetime owner: The acquisition helper retains managed registrations before provider projection, owns fresh registrations, waits for tracked work, and joins cleanup. Raw registrations retain their existing custody. (src/plugins/capability-provider-acquisition.ts:32, 884b6377df1e)
  • Regression coverage: Seven native-resource cases cover cold buffer, URL and rejection outcomes; managed release during capability lookup; raw ownership; override selection; and fallback. Assertions check metadata projection, physical database closure, and URL retrieval after disposal. Tests were inspected, not executed during this read-only review. (src/video-generation/runtime.resources.test.ts:182, 884b6377df1e)
  • Current main and release comparison: Both fetched main and v2026.9.3 still enter generation directly through unowned provider resolution; neither contains this video lifetime wrapper. (src/video-generation/runtime.ts:116, 64ef483a1003)
  • Released source: The latest supplied release has the prior direct generation entry point. (src/video-generation/runtime.ts:116, 1391f7cd2d40)
  • Recorded production-path evidence: The captured PR body, source revision 7a866c963043236d4d55b60d2dd8156eeed006dcba3a8448fdd671b4f70fc040, reports compiled public video calls in cold, managed, and raw modes across buffer, URL, rejection, and recovery. Observations include registration/disposal counts, native SQLite close markers, independently decoded MP4 output, and successful HTTP retrieval after disposal. This is contributor-reported runtime evidence, not reviewer execution. (884b6377df1e)

Likely related people:

  • Peter Steinberger: Raw commit 6f2bce0 adds src/plugins/capability-provider-acquisition.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6f2bce0aa92b; files: src/plugins/capability-provider-acquisition.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-09T06:15:23.200Z sha 884b637 :: needs changes before merge. :: none

@steipete
steipete marked this pull request as ready for review September 9, 2026 06:16
@steipete
steipete merged commit 873956e into main Sep 9, 2026
251 checks passed
@steipete
steipete deleted the codex/video-generation-resources branch September 9, 2026 07:33
@steipete

steipete commented Sep 9, 2026

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

docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

1 participant