Render clips past the length target instead of failing them#72
Merged
Conversation
The vertical/square formats capped clips at 45s with a hard raise in generate_clip, so any longer clip died before a single frame was cut. The card was left with a dead Retry that re-ran the same check and failed again. The real ceiling (180s vertical, 300s horizontal) is already enforced upstream, so 45s was only ever a preference. Turn it into a warning: the clip renders and returns a 'warning' field, shown as an amber note next to the file size. Play, download, and retry all work as normal. Under-target clips are unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughClip duration overflow is now treated as a non-fatal warning rather than a hard error. The Claude prompt wording, clip_generator's duration check, and the UI/CSS were updated to surface a "warning" field instead of failing rendering. The package version was also bumped. ChangesDuration Warning Handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Vertical/square clips over 45s never rendered.
generate_clipraisedValueError("Clip too long...")before cutting a single frame, so the result card was stuck with aRetrybutton that re-ran the same check and failed forever. After a long wait, you got a dead clip and no file to download.The actual system ceiling (180s vertical, 300s horizontal) is already enforced upstream in
web-server.ts, so 45s was only ever a preference, not a real limit.Change
clip_generator.py: replace the hardraisewith a non-blockinglength_warning, attached to the result aswarning. The clip renders.EpisodeWorkspace.jsx: renderr.warningas an amber note next to the file size. Existing card logic already shows Play / Download / Retry for any successful clip.styles.css: add--ambertoken and.clip-meta .warn, following the existing--red/.errpattern.claude_suggest.py: the LLM prompt claimed over-45s clips "WILL FAIL rendering" (now false); corrected to say they render but get flagged. Still steers toward shorter clips.Result
The card reads e.g.
12:47 → 13:12 · 99s · 20.1MB · 99s, over the 45s vertical targetin amber, with working Play / Download / Retry.Verification
Rendered against a synthetic source (not just typecheck):
warningpresentwarningkey (normal path unchanged)tsc --noEmitclean, 61/61 vitest passPatch bump to 2.4.3.
Summary by CodeRabbit
New Features
Bug Fixes
Chores