From 6e10038d0efde2a5367aefb73a56fd7cfc6e936a Mon Sep 17 00:00:00 2001 From: Ziyu Huang Date: Tue, 7 Jul 2026 07:31:33 +0800 Subject: [PATCH] fix(grok_video): set quality_score=0.9 to stop under-ranking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every premium video provider sets quality_score (seedance 0.95, runway / higgsfield 0.9) so the scorer ranks them above stock/local options. grok_video had none, so it was scored only on supports/stability flags despite shipping native synchronized audio (lip-sync + dialogue + SFX in a single generation pass) — likely under-ranked. Set quality_score=0.9, on par with the other native-audio premium providers. Add a regression pinning the field and its get_info() surface. Refs: docs/REVIEW-image-to-video-voice.md §8 #6 Co-Authored-By: Claude --- tests/tools/test_grok_video_quality_score.py | 23 ++++++++++++++++++++ tools/video/grok_video.py | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 tests/tools/test_grok_video_quality_score.py diff --git a/tests/tools/test_grok_video_quality_score.py b/tests/tools/test_grok_video_quality_score.py new file mode 100644 index 00000000..e2561f69 --- /dev/null +++ b/tests/tools/test_grok_video_quality_score.py @@ -0,0 +1,23 @@ +"""Regression for grok_video quality_score (REVIEW §8 #6). + +Every premium video provider sets a quality_score (seedance 0.95, runway / +higgsfield 0.9) so the scorer ranks them above stock/local options. grok_video +— which ships native synchronized audio (lip-sync + dialogue + SFX in a single +pass) — had none, so it was ranked only on supports/stability flags and +under-ranked. This pins the field and confirms it surfaces in get_info(). +""" + +from __future__ import annotations + +from tools.video.grok_video import GrokVideo + + +def test_grok_video_has_quality_score(): + assert GrokVideo.quality_score is not None + # On par with the other native-audio/premium providers (0.9–0.95). + assert GrokVideo.quality_score >= 0.9 + + +def test_quality_score_surfaces_in_tool_info(): + info = GrokVideo().get_info() + assert info["quality_score"] == GrokVideo.quality_score diff --git a/tools/video/grok_video.py b/tools/video/grok_video.py index 202af148..d4b3295b 100644 --- a/tools/video/grok_video.py +++ b/tools/video/grok_video.py @@ -83,6 +83,11 @@ class GrokVideo(BaseTool): ] not_good_for = ["offline generation"] fallback_tools = ["veo_video", "runway_video", "kling_video", "minimax_video"] + # Native synchronized audio (lip-sync + dialogue + SFX in one pass) puts + # Grok on par with the other premium providers; without a quality_score the + # scorer only counted supports/stability flags, under-ranking it relative to + # seedance (0.95) / runway / higgsfield (0.9). See lib/scoring.py. + quality_score = 0.9 input_schema = { "type": "object",