feat: add standalone primitive tasks for modular content creation#122
feat: add standalone primitive tasks for modular content creation#122recoupableorg wants to merge 2 commits intomainfrom
Conversation
Break the monolithic pipeline into independently callable primitives: - create-image: face guide + template + fal.ai image generation - create-video: image-to-video or lipsync audio-to-video - create-audio: song selection, transcription, clip analysis - create-render: ffmpeg crop + audio + text overlay - create-upscale: image or video upscaling Each primitive is a schemaTask with its own Zod schema. The existing create-content task (V1 full pipeline) is untouched. Made-with: Cursor
|
Warning Rate limit exceeded
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 17 minutes and 1 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces Zod-based schema validation and Trigger.dev v3 task definitions for content creation workflows. It adds payload schemas for image, video, audio, render, and upscale operations, along with corresponding executable tasks that validate inputs, integrate with the Fal service, and orchestrate the creation process. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/schemas/contentPrimitiveSchemas.ts`:
- Around line 3-4: Remove the dead declarations TEXT_LENGTHS and TextLength from
this module: delete the exported constant TEXT_LENGTHS and the exported type
alias TextLength so they no longer appear in
src/schemas/contentPrimitiveSchemas.ts; ensure there are no remaining references
or exports to TEXT_LENGTHS or TextLength in this file (and update any export
lists if present).
In `@src/tasks/createRenderTask.ts`:
- Around line 31-32: The code incorrectly reads result.videoUrl but
renderFinalVideo (RenderFinalVideoOutput) returns dataUrl; update the return to
use result.dataUrl (or rename to dataUrl consistently) and keep sizeBytes:
return { videoUrl: result.dataUrl, sizeBytes: result.sizeBytes } or, if you
prefer explicit types, change the returned shape to { dataUrl: result.dataUrl,
mimeType: result.mimeType, sizeBytes: result.sizeBytes } and adjust callers
accordingly (look for renderFinalVideo, RenderFinalVideoOutput, and logStep
usage).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f9b8913a-6a46-4c72-9d70-d854bc24cdc4
📒 Files selected for processing (7)
src/schemas/__tests__/contentPrimitiveSchemas.test.tssrc/schemas/contentPrimitiveSchemas.tssrc/tasks/createAudioTask.tssrc/tasks/createImageTask.tssrc/tasks/createRenderTask.tssrc/tasks/createUpscaleTask.tssrc/tasks/createVideoTask.ts
| logStep("Render complete", true, { sizeBytes: result.sizeBytes }); | ||
| return { videoUrl: result.videoUrl, sizeBytes: result.sizeBytes }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the return type of renderFinalVideo
ast-grep --pattern $'export interface RenderFinalVideoOutput {
$$$
}'Repository: recoupable/tasks
Length of output: 539
🏁 Script executed:
#!/bin/bash
# Read the createRenderTask.ts file around line 32
sed -n '25,40p' src/tasks/createRenderTask.tsRepository: recoupable/tasks
Length of output: 404
Incorrect property access: renderFinalVideo returns dataUrl, not videoUrl.
The RenderFinalVideoOutput interface defines { dataUrl, mimeType, sizeBytes }. Accessing result.videoUrl on line 32 will return undefined.
🐛 Proposed fix
logStep("Render complete", true, { sizeBytes: result.sizeBytes });
- return { videoUrl: result.videoUrl, sizeBytes: result.sizeBytes };
+ return { videoUrl: result.dataUrl, sizeBytes: result.sizeBytes };📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| logStep("Render complete", true, { sizeBytes: result.sizeBytes }); | |
| return { videoUrl: result.videoUrl, sizeBytes: result.sizeBytes }; | |
| logStep("Render complete", true, { sizeBytes: result.sizeBytes }); | |
| return { videoUrl: result.dataUrl, sizeBytes: result.sizeBytes }; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/tasks/createRenderTask.ts` around lines 31 - 32, The code incorrectly
reads result.videoUrl but renderFinalVideo (RenderFinalVideoOutput) returns
dataUrl; update the return to use result.dataUrl (or rename to dataUrl
consistently) and keep sizeBytes: return { videoUrl: result.dataUrl, sizeBytes:
result.sizeBytes } or, if you prefer explicit types, change the returned shape
to { dataUrl: result.dataUrl, mimeType: result.mimeType, sizeBytes:
result.sizeBytes } and adjust callers accordingly (look for renderFinalVideo,
RenderFinalVideoOutput, and logStep usage).
Addresses CodeRabbit review; exports were unused across the repo. Made-with: Cursor
Break the monolithic pipeline into independently callable primitives:
Each primitive is a schemaTask with its own Zod schema. The existing create-content task (V1 full pipeline) is untouched.
Made-with: Cursor
Summary by CodeRabbit
New Features
Tests