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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Jina AI
Jina AI
The Cloudflare Blog
V
Visual Studio Blog
博客园_首页
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园 - Franky

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 music duration option · openclaw/openclaw@3...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1044,6 +1044,43 @@ describe("createMusicGenerateTool", () => {

10441044

});

10451045

});

10461046
1047+

it("rejects fractional duration seconds before generation", async () => {

1048+

const generateMusic = vi.spyOn(musicGenerationRuntime, "generateMusic").mockResolvedValue({

1049+

provider: "minimax",

1050+

model: "music-2.6",

1051+

attempts: [],

1052+

ignoredOverrides: [],

1053+

tracks: [

1054+

{

1055+

buffer: Buffer.from("music-bytes"),

1056+

mimeType: "audio/mpeg",

1057+

fileName: "night-drive.mp3",

1058+

},

1059+

],

1060+

});

1061+
1062+

const tool = createMusicGenerateTool({

1063+

config: asConfig({

1064+

agents: {

1065+

defaults: {

1066+

musicGenerationModel: { primary: "minimax/music-2.6" },

1067+

},

1068+

},

1069+

}),

1070+

});

1071+

if (!tool) {

1072+

throw new Error("expected music_generate tool");

1073+

}

1074+
1075+

await expect(

1076+

tool.execute("call-1", {

1077+

prompt: "night-drive synthwave",

1078+

durationSeconds: 45.5,

1079+

}),

1080+

).rejects.toThrow("durationSeconds must be a positive integer");

1081+

expect(generateMusic).not.toHaveBeenCalled();

1082+

});

1083+
10471084

it("passes web_fetch SSRF policy when loading reference images", async () => {

10481085

vi.spyOn(musicGenerationRuntime, "listRuntimeMusicGenerationProviders").mockReturnValue([

10491086

{

Original file line numberDiff line numberDiff line change

@@ -21,6 +21,7 @@ import type {

2121

MusicGenerationProvider,

2222

MusicGenerationSourceImage,

2323

} from "../../music-generation/types.js";

24+

import { readSnakeCaseParamRaw } from "../../param-key.js";

2425

import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js";

2526

import { resolveUserPath } from "../../utils.js";

2627

import type { DeliveryContext } from "../../utils/delivery-context.js";

@@ -124,7 +125,7 @@ const MusicGenerateToolSchema = Type.Object({

124125

}),

125126

),

126127

durationSeconds: Type.Optional(

127-

Type.Number({

128+

Type.Integer({

128129

description: "Target seconds; provider may clamp.",

129130

minimum: 1,

130131

}),

@@ -651,9 +652,15 @@ export function createMusicGenerateTool(options?: {

651652

const instrumental = readBooleanToolParam(args, "instrumental");

652653

const model = readStringParam(args, "model");

653654

const durationSeconds = readNumberParam(args, "durationSeconds", {

654-

integer: true,

655+

positiveInteger: true,

655656

strict: true,

656657

});

658+

if (

659+

durationSeconds === undefined &&

660+

readSnakeCaseParamRaw(args, "durationSeconds") !== undefined

661+

) {

662+

throw new ToolInputError("durationSeconds must be a positive integer");

663+

}

657664

const format = normalizeOutputFormat(readStringParam(args, "format"));

658665

const filename = readStringParam(args, "filename");

659666

const timeout = normalizeMusicGenerationTimeoutMs(musicGenerationModelConfig.timeoutMs);