Skip to content

Fix H3 rejoin assembling stale clips after an image rerun - #410

Merged
IAnMove merged 1 commit into
cursor/critical-bug-management-48e0from
cursor/critical-bug-management-h3-stale-rejoin
Sep 12, 2026
Merged

Fix H3 rejoin assembling stale clips after an image rerun#410
IAnMove merged 1 commit into
cursor/critical-bug-management-48e0from
cursor/critical-bug-management-h3-stale-rejoin

Conversation

@cursor

@cursor cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Resumen ejecutivo

Esta primera sección está pensada para project managers y revisores no
técnicos. Mantén el detalle técnico completo más abajo.

Qué cambia

Rejoin de producciones MiniMax H3 ahora rechaza un clip marcado video_stale en vez de montar los segmentos o la toma seleccionada.

Para qué sirve

Después de regenerar la imagen de inicio, el vídeo ya no corresponde al nuevo fotograma. En H3, Rejoin igual ensamblaba ese material y publicaba una película final desactualizada.

Impacto para el usuario

Rejoin pide regenerar el vídeo stale antes de unir. El comportamiento no-H3 no cambia.

Riesgo

  • Bajo
  • Medio
  • Alto

Estado

  • En desarrollo
  • Listo para revisión
  • Bloqueado por CI o revisión
  • Requiere migración o acción manual

Summary

rejoin_clips only checked video_stale on the non-H3 path. Sequential H3 productions (minimax_h3 / minimax_h3_legacy) took a different branch that assembled playable h3_segments or an explicit selected_video_filename without looking at the clip-level stale flag.

rerun_clip_image marks video_stale=True and leaves those files in place for playback. A later Rejoin therefore concatenated the pre-rerun video into a new minimax_h3_*_rejoin_*.mp4 and wrote it as final_output_filename.

Hoist the existing stale-clip ValueError so both branches share it. Segment-level H3 stale checks and whole-slot selections stay as they were once the clip is current.

Overview

  1. User finishes an H3 multi-clip production.
  2. User reruns the start image on clip 1. The old segments remain on disk; the clip is video_stale.
  3. User clicks Rejoin.
  4. Before this change: ffmpeg concatenated the old H3 segments (or a Studio selection) and the dashboard showed a new final movie.
  5. After this change: Rejoin raises Regenerate stale video clip(s) 1 before rejoining. Concatenate is not called.

Detailed changes

Backend

  • app/services/director_pipeline.py _rejoin_clips_impl: evaluate video_stale before the H3/non-H3 split. Remove the duplicate check from the non-H3 branch.

UI and Wizard

No UI change. The dashboard already surfaces stale clips; Rejoin now matches that gate for H3.

Data, provenance and compatibility

No checkpoint migration. Existing H3 files stay playable; only assembly is blocked until video is regenerated.

Files and ownership

Validation

  • Date (UTC): 2026-09-12

  • Base SHA: 60e867a

  • Head SHA: 4048ebd

  • Validation scope: focused

  • python scripts/verify_clean_repo.py

  • python -m compileall -q app/services/director_pipeline.py

  • Focused Python tests: PYTHONPATH=/workspace python -m pytest tests/test_director_h3_workflow_edits.py tests/test_director_cancellation.py::TestDirectorCancellation::test_rejoin_rejects_stale_video_instead_of_omitting_clip -q → 8 passed

  • cd ui && npm run i18n:check (no UI change)

  • UI tests: N/A (no UI change)

  • cd ui && npm run lint -- --max-warnings=0 (no UI change)

  • cd ui && npm run build (no UI change)

  • git diff --check

  • E2E/smoke checks: N/A — Rejoin H3 assembly is covered by the focused pytest; no live ffmpeg/provider run

Code quality

  • Score: pending CI
  • Complexity trend: pending CI
  • Production LOC trend: pending CI
  • Regression versus main: pending CI
  • Ratchet: pending CI

CI and review

  • CI of this HEAD: pending
  • Independent agent review of this HEAD: pending
  • Human merge click (operational, not code review): pending

Cursor/Bugbot — pick exactly one.

  • Reviewed at current HEAD
  • Earlier review; HEAD has changed since (stale)
  • Pending
  • Unavailable

Coste de la tarea

  • Tests simulados: 0 tokens externos
  • Tests reales: N/A
  • Llamadas LLM externas: 0
  • Tokens de prompt: N/A
  • Tokens de respuesta: N/A
  • Tokens totales: N/A
  • Generaciones de imágenes/audio/vídeo: 0
  • Tiempo transcurrido: N/A
  • Proveedores/modelos: N/A

Notes and limitations

  • The H3 branch still skips start-image presence checks (pre-existing). This PR only shares the video_stale gate.
  • Selecting a different historical take via save_review still clears video_stale when the filename changes. That matches the review-desk projector test and was not changed here.

Follow-up work

Checklist

  • The executive summary is understandable without reading the code.
  • The detailed Summary/Overview has not been removed or shortened.
  • Tests and their actual results are recorded.
  • Generated assets, secrets and local-only files are not committed.
  • Required CI and Cursor/Bugbot review are complete, or the PR is clearly marked as waiting for them.
Open in Web View Automation 

Rejoin gated video_stale only on the non-H3 path. MiniMax H3 productions
still assembled playable segments or a Studio selection after the start
image changed, so the joined movie no longer matched the current frame.

Raise the same stale-clip error before the H3 branch.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@github-actions

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 2 file(s); +63/-11; backend services

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • No heuristic issues. Still run the CI checklist below.

Changed files

  • modified: app/services/director_pipeline.py, tests/test_director_h3_workflow_edits.py

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

@IAnMove
IAnMove changed the base branch from development to cursor/critical-bug-management-48e0 September 12, 2026 18:54
@github-actions

Copy link
Copy Markdown

Code health

Quality score: 63.8/100

Higher is better. The score is a trend dashboard; the independent ratchet below remains the CI gate.

Component Weight Current Change
Cyclomatic health 45% 59.2 +0.0
File concentration 25% 73.7 +0.0
Oversized-file debt 20% 49.4 +0.0
Modularity 10% 88.3 +0.0

Change vs PR base: +0.0 points.

Metric Value
Production LOC 313,652
Production files 1,052
Test LOC 127,860
Functions measured 21,367
Functions complexity ≥ 15 906
Maximum complexity 674
Policy code-health-policy-v1
HEAD 526a692863e9726434f80c7fce0000f1d35ecd9a
Base 60e867a6aae832d5b56c5ebd44b99867bda55b26
UI measurement complete

Markdown, JSON catalogs and tests are out of this table. Only app/ runtime + ui/src TS/JS count.

Most complex functions

Complexity Where
674 app/wgp.py:7230 generate_video
382 ui/src/stores/useStore.ts:4129 Async method 'startGeneration'
355 app/_launch_runtime.py:23674 _run_generation
308 app/wgp.py:12372 generate_video_tab
269 ui/src/components/Sidebar/SceneAnimatorPanel.tsx:508 Function 'SceneAnimatorPanel'
264 ui/src/stores/useStore.ts:8684 Async method 'loadSettingsFromOutput'
258 app/services/director/planners/short_film.py:3433 ShortFilmPlanner._plan_story_driven
248 app/services/director_pipeline.py:13614 _run_video_generation
245 app/services/director_pipeline.py:7714 _run_pipeline
233 ui/src/features/agent/agentActions.ts:1152 Function 'parseAction'
226 app/services/director_pipeline.py:6543 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2998 Async function 'executeAgentActions'

Trend vs baseline

Metric Δ
Production LOC +2
Test LOC +50
Functions ≥ 15 +0
Maximum complexity +0

Warnings

  • production LOC increased by +2
  • hotspot app/services/director_pipeline.py increased by +2 lines

Ratchet passed.

@IAnMove
IAnMove merged commit 1e9886f into cursor/critical-bug-management-48e0 Sep 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants