Skip to content

Fix/grok video image urls#46

Merged
Simplereally merged 2 commits intomainfrom
fix/grok-video-image-urls
Mar 11, 2026
Merged

Fix/grok video image urls#46
Simplereally merged 2 commits intomainfrom
fix/grok-video-image-urls

Conversation

@Simplereally
Copy link
Copy Markdown
Owner

@Simplereally Simplereally commented Mar 11, 2026

Summary by CodeRabbit

  • New Features

    • Video reference frames are now automatically limited based on model capabilities.
  • Bug Fixes

    • Fixed FFmpeg binary permission issues to improve video generation stability.
    • Grok-video model now correctly limits to single reference frame with interpolation disabled.
  • Refactor

    • Improved URL construction logic for video models.
    • Centralized timeout configuration for API requests.
  • Chores

    • Updated GitHub Actions to latest versions.

- Update actions/checkout from v4 to v6.0.2
- Update softprops/action-gh-release from v2 to v2.5.0
- Resolves Node.js 20 deprecation warnings

These action versions support Node.js 24 which will become the default
on GitHub Actions runners starting June 2nd, 2026.
…sions

- Change grok-video from interpolation (2 frames) to single reference frame
- Update buildPollinationsUrl to use `image` param only for grok-video
- Add maxVideoReferenceImages enforcement in useGenerationSettings hook
- Normalize videoReferenceImages on load and update to respect frame limits
- Add chmod 0o755 to ffmpeg-static binary in video preview/thumbnail modules
- Add test coverage for grok-video single frame limit
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
bloomstudio Ignored Ignored Open in v0 Mar 11, 2026 2:51pm

@Simplereally Simplereally merged commit 335ea47 into main Mar 11, 2026
3 of 4 checks passed
@Simplereally Simplereally deleted the fix/grok-video-image-urls branch March 11, 2026 14:51
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed200618-3830-4e2b-b30e-8d1e9b90fa88

📥 Commits

Reviewing files that changed from the base of the PR and between 0ebfdfe and c1baefe.

📒 Files selected for processing (14)
  • .github/workflows/release.yml
  • components/studio/features/generation/controls-view.test.tsx
  • components/studio/features/generation/controls-view.tsx
  • convex/batchProcessor.ts
  • convex/lib/index.ts
  • convex/lib/pollinations.test.ts
  • convex/lib/pollinations.ts
  • convex/lib/videoPreview.ts
  • convex/lib/videoThumbnail.ts
  • convex/singleGenerationProcessor.ts
  • hooks/use-generation-settings.test.ts
  • hooks/use-generation-settings.ts
  • lib/config/models.test.ts
  • lib/config/models.ts

📝 Walkthrough

Walkthrough

This PR constrains video reference frames per model capabilities (especially grok-video to 1 frame), refactors timeout configuration across Convex modules, ensures FFmpeg binary executable permissions, and bumps GitHub Actions versions.

Changes

Cohort / File(s) Summary
Video Reference Frame Limiting
components/studio/features/generation/controls-view.tsx, components/studio/features/generation/controls-view.test.tsx
Memoizes a sliced videoReferenceImages array limited to maxReferenceFrames and passes it to VideoFramesSection for display. New test validates frame limiting behavior.
Frame Constraint Logic
hooks/use-generation-settings.ts, hooks/use-generation-settings.test.ts
Introduces normalizedVideoReferenceImages derived by slicing to maxVideoReferenceImages (computed from model config). Adds wrapper for setVideoReferenceImages to enforce limits. New tests verify grok-video frame limiting during initialization and updates.
Model Configuration
lib/config/models.ts, lib/config/models.test.ts
Changes grok-video from supportsInterpolation=true, referenceFrameCount=2 to supportsInterpolation=false, referenceFrameCount=1. Updates test expectations accordingly.
Pollinations Configuration & URL Building
convex/lib/pollinations.ts, convex/lib/pollinations.test.ts, convex/lib/index.ts
Exports new POLLINATIONS_FETCH_TIMEOUT_MS constant (10 minutes). Adds model-specific URL building logic: grok-video uses only image param; other video models use image combined with lastFrameImage. New test validates grok-video URL construction.
Timeout Import Refactoring
convex/batchProcessor.ts, convex/singleGenerationProcessor.ts
Replaces local POLLINATIONS_FETCH_TIMEOUT_MS constants with imports from ./lib module.
FFmpeg Executable Permissions
convex/lib/videoPreview.ts, convex/lib/videoThumbnail.ts
Adds chmod(ffmpegStatic, 0o755) calls after locating/loading ffmpeg-static binary to ensure execute permissions.
GitHub Actions
.github/workflows/release.yml
Bumps actions/checkout from v4 to v6 and softprops/action-gh-release from v2 to v2.5.0.

Sequence Diagram

sequenceDiagram
    participant ModelConfig as Model Config
    participant Hook as useGenerationSettings Hook
    participant Component as ControlsView Component
    
    ModelConfig->>Hook: Provide maxReferenceFrames via modelDef<br/>(supportsInterpolation, referenceFrameCount)
    activate Hook
    Hook->>Hook: Compute maxVideoReferenceImages<br/>(2 if interpolation, else referenceFrameCount)
    Hook->>Hook: Slice videoReferenceImages to max<br/>→ normalizedVideoReferenceImages
    Hook->>Hook: Return constrained list to consumer
    deactivate Hook
    
    Hook->>Component: Pass normalizedVideoReferenceImages<br/>(frame-limited array)
    activate Component
    Component->>Component: Memoize displayedVideoReferenceImages<br/>from normalized frames
    Component->>Component: Render VideoFramesSection<br/>with displayedVideoReferenceImages
    Component->>Component: Calculate videoFrameCount<br/>from memoized array length
    deactivate Component
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • feat: add dirtberry #43: Modifies convex/batchProcessor.ts and convex/singleGenerationProcessor.ts alongside this PR's timeout configuration refactoring.

Poem

🐰 With frame counts capped and permissions set,
Our grok-video knows just one frame yet!
Timeouts shared across the Convex land,
FFmpeg permissions now firmly in hand.
GitHub Actions updated, workflows run free—
A hop toward stability! 🎥✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/grok-video-image-urls

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1baefec32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}, [modelDef])
const normalizedVideoReferenceImages = React.useMemo(() => {
if (maxVideoReferenceImages === undefined) return videoReferenceImages
return videoReferenceImages.slice(0, maxVideoReferenceImages)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drop empty legacy frame placeholders when limiting Grok frames

For users with persisted interpolation state, frame arrays can contain empty placeholders (the existing interpolation setter stores "" for missing slots). This normalization now does slice(0, maxVideoReferenceImages) for grok-video (max=1), which turns values like ["", "https://..."] into [''] instead of preserving a real frame or clearing it. Downstream, the non-interpolation picker treats that as a selected frame (and may render an empty image URL) while generation still sends no reference image via videoReferenceImages[0] || undefined, creating a broken/misleading state on load for returning users.

Useful? React with 👍 / 👎.

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