From 58863b1a506fe933d35d552cb3bd686fc89864c6 Mon Sep 17 00:00:00 2001 From: XianYuDaXian Date: Wed, 4 Mar 2026 23:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8C=BAimage=5Furl=20=E4=B8=8E=20parent=5Fp?= =?UTF-8?q?ost=5Fid=20=E5=86=B2=E7=AA=81=20Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/grok/utils/process.py | 10 ++++++++++ app/static/public/js/video.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/services/grok/utils/process.py b/app/services/grok/utils/process.py index 378aefd..4ad7c7a 100644 --- a/app/services/grok/utils/process.py +++ b/app/services/grok/utils/process.py @@ -84,6 +84,16 @@ async def _with_idle_timeout( idle_timeout: 空闲超时时间(秒),0 表示禁用 model: 模型名称(用于日志) """ + try: + idle_timeout = float(idle_timeout or 0) + except (ValueError, TypeError): + idle_timeout = 0.0 + + try: + first_item_timeout = float(first_item_timeout or 0) if first_item_timeout is not None else 0.0 + except (ValueError, TypeError): + first_item_timeout = 0.0 + if idle_timeout <= 0: async for item in iterable: yield item diff --git a/app/static/public/js/video.js b/app/static/public/js/video.js index bdc979a..12dd44e 100644 --- a/app/static/public/js/video.js +++ b/app/static/public/js/video.js @@ -843,7 +843,7 @@ }, body: JSON.stringify({ prompt, - image_url: imageUrl || null, + image_url: parentPostId ? null : (imageUrl || null), parent_post_id: parentPostId || null, source_image_url: parentPostId ? (resolvedRef.sourceUrl || imageUrl || null) : null, reasoning_effort: DEFAULT_REASONING_EFFORT,