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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
I
InfoQ
P
Proofpoint News Feed
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Help Net Security
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog

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(google): avoid doubled media generation API version ·...
Hybirdss · 2026-04-25 · via Recent Commits to openclaw:main

@@ -82,6 +82,171 @@ describe("google music generation provider", () => {

8282

);

8383

});

848485+

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

86+

vi.spyOn(providerAuthRuntime, "resolveApiKeyForProvider").mockResolvedValue({

87+

apiKey: "google-key",

88+

source: "env",

89+

mode: "api-key",

90+

});

91+

generateContentMock.mockResolvedValue({

92+

candidates: [

93+

{

94+

content: {

95+

parts: [

96+

{

97+

inlineData: {

98+

data: Buffer.from("mp3-bytes").toString("base64"),

99+

mimeType: "audio/mpeg",

100+

},

101+

},

102+

],

103+

},

104+

},

105+

],

106+

});

107+108+

const provider = buildGoogleMusicGenerationProvider();

109+

await provider.generateMusic({

110+

provider: "google",

111+

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

112+

prompt: "ambient ocean",

113+

cfg: {

114+

models: {

115+

providers: {

116+

google: { baseUrl: "https://generativelanguage.googleapis.com/v1beta", models: [] },

117+

},

118+

},

119+

},

120+

instrumental: true,

121+

});

122+123+

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

124+

expect.objectContaining({

125+

httpOptions: expect.objectContaining({

126+

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

127+

}),

128+

}),

129+

);

130+

});

131+132+

it("does NOT strip /v1beta when it appears mid-path (end-anchor proof)", async () => {

133+

vi.spyOn(providerAuthRuntime, "resolveApiKeyForProvider").mockResolvedValue({

134+

apiKey: "google-key",

135+

source: "env",

136+

mode: "api-key",

137+

});

138+

generateContentMock.mockResolvedValue({

139+

candidates: [

140+

{

141+

content: {

142+

parts: [

143+

{ inlineData: { data: Buffer.from("x").toString("base64"), mimeType: "audio/mpeg" } },

144+

],

145+

},

146+

},

147+

],

148+

});

149+150+

const provider = buildGoogleMusicGenerationProvider();

151+

await provider.generateMusic({

152+

provider: "google",

153+

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

154+

prompt: "test",

155+

cfg: {

156+

models: {

157+

providers: { google: { baseUrl: "https://proxy.example.com/v1beta/route", models: [] } },

158+

},

159+

},

160+

instrumental: true,

161+

});

162+163+

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

164+

expect.objectContaining({

165+

httpOptions: expect.objectContaining({

166+

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

167+

}),

168+

}),

169+

);

170+

});

171+172+

it("passes baseUrl unchanged when no /v1beta suffix is present", async () => {

173+

vi.spyOn(providerAuthRuntime, "resolveApiKeyForProvider").mockResolvedValue({

174+

apiKey: "google-key",

175+

source: "env",

176+

mode: "api-key",

177+

});

178+

generateContentMock.mockResolvedValue({

179+

candidates: [

180+

{

181+

content: {

182+

parts: [

183+

{ inlineData: { data: Buffer.from("x").toString("base64"), mimeType: "audio/mpeg" } },

184+

],

185+

},

186+

},

187+

],

188+

});

189+190+

const provider = buildGoogleMusicGenerationProvider();

191+

await provider.generateMusic({

192+

provider: "google",

193+

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

194+

prompt: "test",

195+

cfg: {

196+

models: {

197+

providers: {

198+

google: { baseUrl: "https://generativelanguage.googleapis.com", models: [] },

199+

},

200+

},

201+

},

202+

instrumental: true,

203+

});

204+205+

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

206+

expect.objectContaining({

207+

httpOptions: expect.objectContaining({

208+

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

209+

}),

210+

}),

211+

);

212+

});

213+214+

it("does not set baseUrl when none is configured", async () => {

215+

vi.spyOn(providerAuthRuntime, "resolveApiKeyForProvider").mockResolvedValue({

216+

apiKey: "google-key",

217+

source: "env",

218+

mode: "api-key",

219+

});

220+

generateContentMock.mockResolvedValue({

221+

candidates: [

222+

{

223+

content: {

224+

parts: [

225+

{ inlineData: { data: Buffer.from("x").toString("base64"), mimeType: "audio/mpeg" } },

226+

],

227+

},

228+

},

229+

],

230+

});

231+232+

const provider = buildGoogleMusicGenerationProvider();

233+

await provider.generateMusic({

234+

provider: "google",

235+

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

236+

prompt: "test",

237+

cfg: {},

238+

instrumental: true,

239+

});

240+241+

expect(createGoogleGenAIMock).toHaveBeenCalledWith(

242+

expect.objectContaining({

243+

httpOptions: expect.not.objectContaining({

244+

baseUrl: expect.anything(),

245+

}),

246+

}),

247+

);

248+

});

249+85250

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

86251

vi.spyOn(providerAuthRuntime, "resolveApiKeyForProvider").mockResolvedValue({

87252

apiKey: "google-key",