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

推荐订阅源

Vercel News
Vercel News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
aimingoo的专栏
aimingoo的专栏
I
InfoQ
IT之家
IT之家
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
博客园_首页
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler

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
feat: add browser realtime talk transports · openclaw/ope...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -20,19 +20,25 @@ type MockGoogleLiveConnectParams = {

2020

};

2121

};

222223-

const { connectMock, session } = vi.hoisted(() => {

23+

const { connectMock, createTokenMock, session } = vi.hoisted(() => {

2424

const session: MockGoogleLiveSession = {

2525

close: vi.fn(),

2626

sendClientContent: vi.fn(),

2727

sendRealtimeInput: vi.fn(),

2828

sendToolResponse: vi.fn(),

2929

};

3030

const connectMock = vi.fn(async (_params: MockGoogleLiveConnectParams) => session);

31-

return { connectMock, session };

31+

const createTokenMock = vi.fn(async (_params: unknown) => ({

32+

name: "auth_tokens/browser-session",

33+

}));

34+

return { connectMock, createTokenMock, session };

3235

});

33363437

vi.mock("./google-genai-runtime.js", () => ({

3538

createGoogleGenAI: vi.fn(() => ({

39+

authTokens: {

40+

create: createTokenMock,

41+

},

3642

live: {

3743

connect: connectMock,

3844

},

@@ -50,6 +56,7 @@ function lastConnectParams(): MockGoogleLiveConnectParams {

5056

describe("buildGoogleRealtimeVoiceProvider", () => {

5157

beforeEach(() => {

5258

connectMock.mockClear();

59+

createTokenMock.mockClear();

5360

session.close.mockClear();

5461

session.sendClientContent.mockClear();

5562

session.sendRealtimeInput.mockClear();

@@ -223,6 +230,88 @@ describe("buildGoogleRealtimeVoiceProvider", () => {

223230

expect(lastConnectParams().config).not.toHaveProperty("temperature");

224231

});

225232233+

it("creates constrained browser sessions for Google Live Talk", async () => {

234+

const provider = buildGoogleRealtimeVoiceProvider();

235+236+

const session = await provider.createBrowserSession?.({

237+

providerConfig: {

238+

apiKey: "gemini-key",

239+

model: "gemini-live-2.5-flash-preview",

240+

voice: "Puck",

241+

temperature: 0.4,

242+

},

243+

instructions: "Speak briefly.",

244+

tools: [

245+

{

246+

type: "function",

247+

name: "openclaw_agent_consult",

248+

description: "Ask OpenClaw",

249+

parameters: {

250+

type: "object",

251+

properties: {

252+

question: { type: "string" },

253+

},

254+

required: ["question"],

255+

},

256+

},

257+

],

258+

});

259+260+

expect(createTokenMock).toHaveBeenCalledTimes(1);

261+

expect(createTokenMock.mock.calls[0]?.[0]).toMatchObject({

262+

config: {

263+

uses: 1,

264+

liveConnectConstraints: {

265+

model: "gemini-live-2.5-flash-preview",

266+

config: {

267+

responseModalities: ["AUDIO"],

268+

temperature: 0.4,

269+

systemInstruction: "Speak briefly.",

270+

speechConfig: {

271+

voiceConfig: {

272+

prebuiltVoiceConfig: {

273+

voiceName: "Puck",

274+

},

275+

},

276+

},

277+

tools: [

278+

{

279+

functionDeclarations: [

280+

{

281+

name: "openclaw_agent_consult",

282+

behavior: "NON_BLOCKING",

283+

},

284+

],

285+

},

286+

],

287+

},

288+

},

289+

},

290+

});

291+

expect(session).toMatchObject({

292+

provider: "google",

293+

transport: "json-pcm-websocket",

294+

protocol: "google-live-bidi",

295+

clientSecret: "auth_tokens/browser-session",

296+

websocketUrl:

297+

"wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentConstrained",

298+

audio: {

299+

inputEncoding: "pcm16",

300+

inputSampleRateHz: 16000,

301+

outputEncoding: "pcm16",

302+

outputSampleRateHz: 24000,

303+

},

304+

initialMessage: {

305+

setup: {

306+

model: "models/gemini-live-2.5-flash-preview",

307+

generationConfig: {

308+

responseModalities: ["AUDIO"],

309+

},

310+

},

311+

},

312+

});

313+

});

314+226315

it("waits for setup completion before draining audio and firing ready", async () => {

227316

const provider = buildGoogleRealtimeVoiceProvider();

228317

const onReady = vi.fn();