fix: guard openai tts fetch · openclaw/openclaw@cc92699
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,6 +108,10 @@ export async function openaiTTS(params: {
|
108 | 108 | ...(effectiveInstructions != null && { instructions: effectiveInstructions }), |
109 | 109 | }); |
110 | 110 | const requestUrl = `${baseUrl}/audio/speech`; |
| 111 | +const isGlobalFetchPatchInstalled = isDebugProxyGlobalFetchPatchInstalled(); |
| 112 | +const guardedFetchImpl = isGlobalFetchPatchInstalled |
| 113 | + ? globalThis.fetch.bind(globalThis) |
| 114 | + : undefined; |
111 | 115 | const { response, release } = await fetchWithSsrFGuard({ |
112 | 116 | url: requestUrl, |
113 | 117 | init: { |
@@ -116,10 +120,12 @@ export async function openaiTTS(params: {
|
116 | 120 | body: requestBody, |
117 | 121 | signal: controller.signal, |
118 | 122 | }, |
| 123 | + ...(guardedFetchImpl ? { fetchImpl: guardedFetchImpl } : {}), |
| 124 | +capture: false, |
119 | 125 | auditContext: "openai-tts", |
120 | 126 | }); |
121 | 127 | try { |
122 | | -if (!isDebugProxyGlobalFetchPatchInstalled()) { |
| 128 | +if (!isGlobalFetchPatchInstalled) { |
123 | 129 | captureHttpExchange({ |
124 | 130 | url: requestUrl, |
125 | 131 | method: "POST", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。