Skip to content

fix: align video generation with current mediaGenInput protocol - #991

Merged
chenyme merged 1 commit into
mainfrom
video
Aug 20, 2026
Merged

fix: align video generation with current mediaGenInput protocol#991
chenyme merged 1 commit into
mainfrom
video

Conversation

@chenyme

@chenyme chenyme commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Align Grok Web text-to-video requests with the current Imagine browser protocol.
  • Send generation parameters through mediaGenInput.textToVideo.
  • Remove the legacy media-post preflight and videoGenModelConfig request path.
  • Include the current browser fields:
    • enableImageStreaming
    • enableSideBySide
    • sendFinalMetadata
    • kind: CONVERSATION_KIND_IMAGINE
  • Exclude Web routes for image/reference video inputs until their current upstream protocol is verified; eligible Build or Console routes remain available.

Why

Grok Web now submits text-to-video requests directly to:

/rest/app-chat/conversations/new

The previous implementation first created a synthetic media post and placed video parameters under:

responseMetadata.modelConfigOverride.modelMap.videoGenModelConfig

That legacy request shape no longer matches the current browser protocol and may enter an upstream compatibility or degraded path, producing unrelated demo videos even though generation completes successfully.

Removed

The following obsolete code was removed:

  • /rest/media/post/create preflight for Web video generation
  • parentPostId
  • videoGenModelConfig
  • temporary: true
  • Legacy media-post response parsing
  • Legacy Web reference-image upload path

These paths were removed instead of retained as fallback because silently using an unverified protocol can consume quota while returning unrelated output.

Compatibility

  • Web text-to-video continues to use grok-imagine-video.
  • Build and Console video generation are unchanged.
  • Web image-to-video and reference-to-video are no longer sent through the obsolete media-post protocol.
  • When compatible Build or Console routes exist, routing can select those providers.
  • Web-only image/reference requests return a clear unsupported-operation error rather than silently ignoring the input.

Validation

  • go test ./... -count=1
  • go vet ./...
  • Added a captured-request payload test for mediaGenInput.textToVideo.
  • Added a regression assertion that fails if text-to-video calls /rest/media/post/create.
  • git diff --check

@chenyme
chenyme merged commit d6f6e9f into main Aug 20, 2026
9 checks passed
mcheiyue added a commit to mcheiyue/grok2api that referenced this pull request Aug 20, 2026
@chenyme
chenyme deleted the video branch August 25, 2026 09:16
gnayhz pushed a commit to gnayhz/grok2api that referenced this pull request Aug 27, 2026
fix: align video generation with current mediaGenInput protocol
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