Skip to content

feat: editorial template static image rendering#136

Open
recoup-coding-agent wants to merge 1 commit intomainfrom
feature/rec-65-editorial-static-image
Open

feat: editorial template static image rendering#136
recoup-coding-agent wants to merge 1 commit intomainfrom
feature/rec-65-editorial-static-image

Conversation

@recoup-coding-agent
Copy link
Copy Markdown
Collaborator

@recoup-coding-agent recoup-coding-agent commented Apr 14, 2026

Summary

  • Add static image rendering to the editorial content pipeline so the Slack bot returns both a video and a static PNG (editorial image with playlist covers overlaid)
  • New renderStaticImage function composites base image + overlay images via ffmpeg, uploads to fal.ai storage
  • createContentTask generates static image when template uses overlay, returns staticImageUrl in output
  • pollContentRuns extracts imageUrl from task results and forwards through callback chain

Test plan

  • 5 tests for buildStaticImageArgs (pure ffmpeg arg builder)
  • 5 tests for renderStaticImage (mocked download/ffmpeg/upload)
  • 7 tests for pollContentRuns (updated to include imageUrl extraction)
  • All 355 existing tests pass

🤖 Generated with Claude Code


Summary by cubic

Adds static image rendering to the editorial pipeline so each run outputs both a video and a PNG with playlist cover overlays. Implements REC-65 and exposes the PNG as imageUrl in poll results.

  • New Features
    • Added renderStaticImage to compose base + overlay images via ffmpeg, upload to fal.ai, and return URL/size.
    • Added buildStaticImageArgs for single-frame crop to 9:16 (720×1280) and stacked overlays.
    • Updated createContentTask to render the PNG when overlays are used and include staticImageUrl in task output.
    • Updated pollContentRuns to map staticImageUrl to imageUrl for consumers.

Written for commit f645399. Summary will update on new commits.

Editorial content now renders both a video and a static image (editorial
base with playlist cover overlays). The static image is passed through
the callback chain as `staticImageUrl` alongside the video.

- New `buildStaticImageArgs` — ffmpeg args for single-frame image render
- New `renderStaticImage` — downloads base + overlays, runs ffmpeg, uploads PNG
- `createContentTask` renders static image when template uses overlay
- `pollContentRuns` extracts `imageUrl` from task output
- 12 new tests (all green)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@recoup-coding-agent has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3aad1d7-2b84-4ead-b07b-931e7f4d2f89

📥 Commits

Reviewing files that changed from the base of the PR and between ddf9404 and f645399.

📒 Files selected for processing (9)
  • src/content/__tests__/buildStaticImageArgs.test.ts
  • src/content/__tests__/pollContentRuns.test.ts
  • src/content/__tests__/renderStaticImage.test.ts
  • src/content/buildStaticImageArgs.ts
  • src/content/pollContentRuns.ts
  • src/content/renderStaticImage.ts
  • src/tasks/__tests__/createContentTask.test.ts
  • src/tasks/__tests__/createContentTaskApi.test.ts
  • src/tasks/createContentTask.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/rec-65-editorial-static-image

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 and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/content/renderStaticImage.ts">

<violation number="1" location="src/content/renderStaticImage.ts:61">
P2: Temp directory is never removed. The `finally` block unlinks individual files but leaves the `tempDir` directory on disk. Replace the per-file cleanup with a single recursive `rm` call on the directory.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.


return { imageUrl: result.url, mimeType: result.mimeType, sizeBytes: result.sizeBytes };
} finally {
const cleanupPaths = [imagePath, outputPath, ...overlayPaths];
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Temp directory is never removed. The finally block unlinks individual files but leaves the tempDir directory on disk. Replace the per-file cleanup with a single recursive rm call on the directory.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/content/renderStaticImage.ts, line 61:

<comment>Temp directory is never removed. The `finally` block unlinks individual files but leaves the `tempDir` directory on disk. Replace the per-file cleanup with a single recursive `rm` call on the directory.</comment>

<file context>
@@ -0,0 +1,64 @@
+
+    return { imageUrl: result.url, mimeType: result.mimeType, sizeBytes: result.sizeBytes };
+  } finally {
+    const cleanupPaths = [imagePath, outputPath, ...overlayPaths];
+    await Promise.all(cleanupPaths.map(p => unlink(p).catch(() => undefined)));
+  }
</file context>
Fix with Cubic

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