Repository navigation
fix(video): retain registration resources through generation - #142876
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 2:21 AM ET / 06:21 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +37, Tests +353, Docs +6. Total +396 across 4 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
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.