惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
A
About on SuperTechFans
Vercel News
Vercel News
博客园 - 【当耐特】
爱范儿
爱范儿
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
D
Docker
博客园 - 叶小钗
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
I
InfoQ
博客园 - 三生石上(FineUI控件)
博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: validate deepinfra video seed metadata · openclaw/op...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -151,6 +151,34 @@ describe("deepinfra video generation provider", () => {

151151

expect(Reflect.get(Reflect.get(postRequest ?? {}, "body") ?? {}, "seed")).toBeUndefined();

152152

});

153153
154+

it("drops malformed response seed metadata", async () => {

155+

postJsonRequestMock.mockResolvedValue({

156+

response: {

157+

json: async () => ({

158+

video_url: "/generated/video.mp4",

159+

request_id: "req_bad_seed",

160+

seed: 1.5,

161+

inference_status: { status: "succeeded" },

162+

}),

163+

},

164+

release: vi.fn(async () => {}),

165+

});

166+
167+

const provider = buildDeepInfraVideoGenerationProvider();

168+

const result = await provider.generateVideo({

169+

provider: "deepinfra",

170+

model: "deepinfra/Pixverse/Pixverse-T2V",

171+

prompt: "A bicycle weaving through a rainy neon street",

172+

cfg: {},

173+

});

174+
175+

expect(result.metadata).toEqual({

176+

requestId: "req_bad_seed",

177+

seed: undefined,

178+

status: "succeeded",

179+

});

180+

});

181+
154182

it("reports malformed native video JSON as a provider error", async () => {

155183

const release = vi.fn(async () => {});

156184

postJsonRequestMock.mockResolvedValue({

Original file line numberDiff line numberDiff line change

@@ -8,7 +8,8 @@ import {

88

resolveProviderHttpRequestConfig,

99

} from "openclaw/plugin-sdk/provider-http";

1010

import {

11-

asFiniteNumber as coerceProviderNumber,

11+

asFiniteNumber,

12+

asSafeIntegerInRange,

1213

normalizeOptionalString,

1314

} from "openclaw/plugin-sdk/string-coerce-runtime";

1415

import type {

@@ -94,11 +95,7 @@ function resolveDurationSeconds(value: number | undefined): number | undefined {

9495

}

9596
9697

function resolveSeed(value: unknown): number | undefined {

97-

const seed = coerceProviderNumber(value);

98-

if (seed == null || !Number.isSafeInteger(seed) || seed < 0 || seed > 4_294_967_295) {

99-

return undefined;

100-

}

101-

return seed;

98+

return asSafeIntegerInRange(value, { min: 0, max: 4_294_967_295 });

10299

}

103100
104101

function buildDeepInfraVideoBody(

@@ -132,7 +129,7 @@ function buildDeepInfraVideoBody(

132129

body.style = style;

133130

}

134131

const guidanceScale =

135-

coerceProviderNumber(options.guidance_scale) ?? coerceProviderNumber(options.guidanceScale);

132+

asFiniteNumber(options.guidance_scale) ?? asFiniteNumber(options.guidanceScale);

136133

if (guidanceScale != null && model.startsWith("Wan-AI/")) {

137134

body.guidance_scale = guidanceScale;

138135

}

@@ -288,7 +285,7 @@ export function buildDeepInfraVideoGenerationProvider(options?: {

288285

model,

289286

metadata: {

290287

requestId: normalizeOptionalString(payload.request_id),

291-

seed: payload.seed,

288+

seed: resolveSeed(payload.seed),

292289

status: payload.inference_status?.status ?? payload.status,

293290

},

294291

};