Skip to content

Render clips past the length target instead of failing them#72

Merged
nmbrthirteen merged 1 commit into
mainfrom
fix/clip-length-warning
Jul 8, 2026
Merged

Render clips past the length target instead of failing them#72
nmbrthirteen merged 1 commit into
mainfrom
fix/clip-length-warning

Conversation

@nmbrthirteen

@nmbrthirteen nmbrthirteen commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Problem

Vertical/square clips over 45s never rendered. generate_clip raised ValueError("Clip too long...") before cutting a single frame, so the result card was stuck with a Retry button 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 hard raise with a non-blocking length_warning, attached to the result as warning. The clip renders.
  • EpisodeWorkspace.jsx: render r.warning as an amber note next to the file size. Existing card logic already shows Play / Download / Retry for any successful clip.
  • styles.css: add --amber token and .clip-meta .warn, following the existing --red / .err pattern.
  • 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 target in amber, with working Play / Download / Retry.

Verification

Rendered against a synthetic source (not just typecheck):

  • 70s vertical → real 1080x1920, 70.1s, 24MB file, warning present
  • 30s vertical → renders, no warning key (normal path unchanged)
  • tsc --noEmit clean, 61/61 vitest pass

Patch bump to 2.4.3.

Summary by CodeRabbit

  • New Features

    • Clips that exceed the target duration can now continue processing instead of stopping outright.
    • Warning messages are now shown in the clip review view when a clip is over the target length.
  • Bug Fixes

    • Updated clip length handling so longer clips are flagged as “over target” rather than treated as a hard failure.
  • Chores

    • Updated the app version to 2.4.3.

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.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a26e5fda-1f18-420c-8be1-8212052c29b0

📥 Commits

Reviewing files that changed from the base of the PR and between a7bc212 and 851f040.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • backend/services/claude_suggest.py
  • backend/services/clip_generator.py
  • package.json
  • src/ui/client/EpisodeWorkspace.jsx
  • src/ui/public/css/styles.css

📝 Walkthrough

Walkthrough

Clip 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.

Changes

Duration Warning Handling

Layer / File(s) Summary
Backend soft-warning for over-duration clips
backend/services/claude_suggest.py, backend/services/clip_generator.py
The Claude prompt now describes exceeding max duration as flagged rather than a hard failure; generate_clip sets a length_warning, prints it, and includes it in the returned out["warning"] instead of raising ValueError.
UI warning display and version bump
src/ui/client/EpisodeWorkspace.jsx, src/ui/public/css/styles.css, package.json
The clip list conditionally renders a warning message when a successful result includes r.warning, styled via a new --amber token and .clip-meta .warn rule; package version bumped from 2.4.2 to 2.4.3.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • nmbrthirteen/podcli#37: Both PRs modify clip-duration validation logic in backend/services/clip_generator.py around spec.dur_max.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: clips over the length target now render instead of failing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clip-length-warning

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nmbrthirteen nmbrthirteen merged commit bf764b2 into main Jul 8, 2026
6 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.

1 participant