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

推荐订阅源

H
Help Net Security
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
Vercel News
Vercel News
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
小众软件
小众软件
月光博客
月光博客
A
About on SuperTechFans

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(openai): use GA realtime bridge for gpt-realtime-2 · ...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -87,6 +87,19 @@ type SentRealtimeEvent = {

8787

turn_detection?: {

8888

create_response?: boolean;

8989

};

90+

output_modalities?: string[];

91+

audio?: {

92+

input?: {

93+

format?: Record<string, unknown>;

94+

turn_detection?: {

95+

create_response?: boolean;

96+

interrupt_response?: boolean;

97+

};

98+

};

99+

output?: {

100+

format?: Record<string, unknown>;

101+

};

102+

};

90103

};

91104

};

92105

@@ -117,6 +130,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

117130

it("declares realtime Talk capabilities for catalog selection", () => {

118131

const provider = buildOpenAIRealtimeVoiceProvider();

119132133+

expect(provider.defaultModel).toBe("gpt-realtime-2");

120134

expect(provider.capabilities).toEqual({

121135

transports: ["webrtc", "gateway-relay"],

122136

inputAudioFormats: [

@@ -152,6 +166,35 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

152166

version: "2026.3.22",

153167

"User-Agent": "openclaw/2026.3.22",

154168

});

169+

expect(options?.headers).not.toHaveProperty("OpenAI-Beta");

170+

});

171+172+

it("keeps Azure deployment realtime bridge requests on the deployment-compatible session shape", () => {

173+

const provider = buildOpenAIRealtimeVoiceProvider();

174+

const bridge = provider.createBridge({

175+

providerConfig: {

176+

apiKey: "sk-test", // pragma: allowlist secret

177+

azureEndpoint: "https://example.openai.azure.com",

178+

azureDeployment: "realtime-prod",

179+

},

180+

onAudio: vi.fn(),

181+

onClearAudio: vi.fn(),

182+

});

183+184+

void bridge.connect();

185+

const socket = FakeWebSocket.instances[0];

186+

if (!socket) {

187+

throw new Error("expected bridge to create a websocket");

188+

}

189+

socket.readyState = FakeWebSocket.OPEN;

190+

socket.emit("open");

191+

bridge.close();

192+193+

expect(parseSent(socket)[0]?.session).toMatchObject({

194+

modalities: ["text", "audio"],

195+

input_audio_format: "g711_ulaw",

196+

output_audio_format: "g711_ulaw",

197+

});

155198

});

156199157200

it("returns browser-safe OpenClaw attribution headers for native WebRTC offers", async () => {

@@ -193,6 +236,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

193236

| undefined;

194237

const body = JSON.parse(request?.init?.body ?? "{}") as {

195238

session?: {

239+

model?: string;

196240

audio?: {

197241

input?: {

198242

turn_detection?: Record<string, unknown>;

@@ -201,6 +245,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

201245

};

202246

};

203247

};

248+

expect(body.session?.model).toBe("gpt-realtime-2");

204249

expect(body.session?.audio?.input).toEqual({

205250

turn_detection: {

206251

type: "server_vad",

@@ -214,6 +259,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

214259

transport: "webrtc",

215260

clientSecret: "client-secret-123",

216261

offerUrl: "https://api.openai.com/v1/realtime/calls",

262+

model: "gpt-realtime-2",

217263

});

218264

// originator, version, and User-Agent are server-side attribution headers; they

219265

// must not be forwarded to the browser so that the browser's direct SDP POST to

@@ -320,7 +366,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

320366

rawConfig: {

321367

providers: {

322368

openai: {

323-

model: "gpt-realtime-1.5",

369+

model: "gpt-realtime-2",

324370

voice: "verse",

325371

temperature: 0.6,

326372

silenceDurationMs: 850,

@@ -331,7 +377,7 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

331377

});

332378333379

expect(resolved).toEqual({

334-

model: "gpt-realtime-1.5",

380+

model: "gpt-realtime-2",

335381

voice: "verse",

336382

temperature: 0.6,

337383

silenceDurationMs: 850,

@@ -370,9 +416,20 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

370416

expect(onReady).not.toHaveBeenCalled();

371417

expect(parseSent(socket).map((event) => event.type)).toEqual(["session.update"]);

372418

expect(parseSent(socket)[0]?.session).toMatchObject({

373-

input_audio_format: "g711_ulaw",

374-

output_audio_format: "g711_ulaw",

419+

type: "realtime",

420+

model: "gpt-realtime-2",

421+

output_modalities: ["audio"],

422+

audio: {

423+

input: {

424+

format: { type: "audio/pcmu" },

425+

transcription: { model: "whisper-1" },

426+

},

427+

output: {

428+

format: { type: "audio/pcmu" },

429+

},

430+

},

375431

});

432+

expect(parseSent(socket)[0]?.session).not.toHaveProperty("temperature");

376433

expect(bridge.isConnected()).toBe(false);

377434378435

socket.emit("message", Buffer.from(JSON.stringify({ type: "session.updated" })));

@@ -457,9 +514,14 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

457514

await connecting;

458515459516

expect(parseSent(socket)[0]?.session).toMatchObject({

460-

turn_detection: expect.objectContaining({

461-

create_response: false,

462-

}),

517+

audio: {

518+

input: {

519+

turn_detection: expect.objectContaining({

520+

create_response: false,

521+

interrupt_response: false,

522+

}),

523+

},

524+

},

463525

});

464526

});

465527

@@ -532,8 +594,14 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {

532594

await connecting;

533595534596

expect(parseSent(socket)[0]?.session).toMatchObject({

535-

input_audio_format: "pcm16",

536-

output_audio_format: "pcm16",

597+

audio: {

598+

input: {

599+

format: { type: "audio/pcm", rate: 24000 },

600+

},

601+

output: {

602+

format: { type: "audio/pcm", rate: 24000 },

603+

},

604+

},

537605

});

538606

});

539607