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

推荐订阅源

G
Google Developers Blog
D
Docker
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
H
Help Net Security
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
博客园 - 司徒正美
C
Check Point Blog
B
Blog
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
F
Fortinet All Blogs
美团技术团队
D
DataBreaches.Net

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
test: tighten google music assertions · openclaw/openclaw...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -20,6 +20,32 @@ import * as providerAuthRuntime from "openclaw/plugin-sdk/provider-auth-runtime"

2020

import { expectExplicitMusicGenerationCapabilities } from "openclaw/plugin-sdk/provider-test-contracts";

2121

import { buildGoogleMusicGenerationProvider } from "./music-generation-provider.js";

222223+

type GoogleGenAIConfig = {

24+

apiKey?: string;

25+

httpOptions?: {

26+

baseUrl?: string;

27+

};

28+

};

29+30+

type GenerateContentRequest = {

31+

model?: string;

32+

config?: unknown;

33+

};

34+35+

function lastGoogleGenAIConfig(): GoogleGenAIConfig {

36+

const calls = createGoogleGenAIMock.mock.calls as unknown[][];

37+

const config = calls.at(-1)?.[0];

38+

expect(config).toBeDefined();

39+

return config as GoogleGenAIConfig;

40+

}

41+42+

function firstGenerateContentRequest(): GenerateContentRequest {

43+

const calls = generateContentMock.mock.calls as unknown[][];

44+

const request = calls[0]?.[0];

45+

expect(request).toBeDefined();

46+

return request as GenerateContentRequest;

47+

}

48+2349

describe("google music generation provider", () => {

2450

afterEach(() => {

2551

vi.restoreAllMocks();

@@ -69,22 +95,15 @@ describe("google music generation provider", () => {

6995

instrumental: true,

7096

});

719772-

expect(generateContentMock).toHaveBeenCalledWith(

73-

expect.objectContaining({

74-

model: "lyria-3-clip-preview",

75-

config: {

76-

responseModalities: ["AUDIO", "TEXT"],

77-

},

78-

}),

79-

);

98+

const generateRequest = firstGenerateContentRequest();

99+

expect(generateRequest.model).toBe("lyria-3-clip-preview");

100+

expect(generateRequest.config).toEqual({

101+

responseModalities: ["AUDIO", "TEXT"],

102+

});

80103

expect(result.tracks).toHaveLength(1);

81104

expect(result.tracks[0]?.mimeType).toBe("audio/mpeg");

82105

expect(result.lyrics).toEqual(["wake the city up"]);

83-

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

84-

expect.objectContaining({

85-

apiKey: "google-key",

86-

}),

87-

);

106+

expect(lastGoogleGenAIConfig().apiKey).toBe("google-key");

88107

});

8910890109

it("strips /v1beta suffix from configured baseUrl before passing to GoogleGenAI SDK", async () => {

@@ -125,12 +144,8 @@ describe("google music generation provider", () => {

125144

instrumental: true,

126145

});

127146128-

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

129-

expect.objectContaining({

130-

httpOptions: expect.objectContaining({

131-

baseUrl: "https://generativelanguage.googleapis.com",

132-

}),

133-

}),

147+

expect(lastGoogleGenAIConfig().httpOptions?.baseUrl).toBe(

148+

"https://generativelanguage.googleapis.com",

134149

);

135150

});

136151

@@ -165,12 +180,8 @@ describe("google music generation provider", () => {

165180

instrumental: true,

166181

});

167182168-

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

169-

expect.objectContaining({

170-

httpOptions: expect.objectContaining({

171-

baseUrl: "https://proxy.example.com/v1beta/route",

172-

}),

173-

}),

183+

expect(lastGoogleGenAIConfig().httpOptions?.baseUrl).toBe(

184+

"https://proxy.example.com/v1beta/route",

174185

);

175186

});

176187

@@ -207,12 +218,8 @@ describe("google music generation provider", () => {

207218

instrumental: true,

208219

});

209220210-

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

211-

expect.objectContaining({

212-

httpOptions: expect.objectContaining({

213-

baseUrl: "https://generativelanguage.googleapis.com",

214-

}),

215-

}),

221+

expect(lastGoogleGenAIConfig().httpOptions?.baseUrl).toBe(

222+

"https://generativelanguage.googleapis.com",

216223

);

217224

});

218225

@@ -243,13 +250,7 @@ describe("google music generation provider", () => {

243250

instrumental: true,

244251

});

245252246-

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

247-

expect.objectContaining({

248-

httpOptions: expect.not.objectContaining({

249-

baseUrl: expect.anything(),

250-

}),

251-

}),

252-

);

253+

expect(lastGoogleGenAIConfig().httpOptions?.baseUrl).toBeUndefined();

253254

});

254255255256

it("rejects unsupported wav output on clip model", async () => {