fix: keep realtime OAuth off custom endpoints · openclaw/openclaw@d5893d9
Solvely-Coli
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -266,6 +266,26 @@ describe("buildOpenAIRealtimeVoiceProvider", () => {
|
266 | 266 | expect(options?.headers).not.toHaveProperty("OpenAI-Beta"); |
267 | 267 | }); |
268 | 268 | |
| 269 | +it("does not fall back to Codex OAuth for custom realtime endpoints", async () => { |
| 270 | +resolveProviderAuthProfileApiKeyMock.mockResolvedValueOnce("oauth-token"); |
| 271 | +const provider = buildOpenAIRealtimeVoiceProvider(); |
| 272 | +const bridge = provider.createBridge({ |
| 273 | +cfg: {} as never, |
| 274 | +providerConfig: { |
| 275 | +azureEndpoint: "https://example.openai.azure.com", |
| 276 | +model: "gpt-realtime-2", |
| 277 | +}, |
| 278 | +onAudio: vi.fn(), |
| 279 | +onClearAudio: vi.fn(), |
| 280 | +}); |
| 281 | + |
| 282 | +await expect(bridge.connect()).rejects.toThrow("OpenAI API key missing"); |
| 283 | + |
| 284 | +expect(resolveProviderAuthProfileApiKeyMock).not.toHaveBeenCalled(); |
| 285 | +expect(fetchWithSsrFGuardMock).not.toHaveBeenCalled(); |
| 286 | +expect(FakeWebSocket.instances).toHaveLength(0); |
| 287 | +}); |
| 288 | + |
269 | 289 | it("does not open a native websocket after slow OAuth resolution times out", async () => { |
270 | 290 | vi.useFakeTimers(); |
271 | 291 | resolveProviderAuthProfileApiKeyMock.mockResolvedValueOnce("oauth-token"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。