fix(voice-call): avoid duplicate webhook logs · openclaw/openclaw@ecf71da
steipete
·
2026-04-26
·
via Recent Commits to openclaw:main
File tree
extensions/voice-call/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -227,6 +227,33 @@ describe("createVoiceCallRuntime lifecycle", () => {
|
227 | 227 | await runtime.stop(); |
228 | 228 | }); |
229 | 229 | |
| 230 | +it("does not log duplicate webhook and public URLs when they match", async () => { |
| 231 | +const logger = { |
| 232 | +info: vi.fn(), |
| 233 | +warn: vi.fn(), |
| 234 | +error: vi.fn(), |
| 235 | +}; |
| 236 | + |
| 237 | +const runtime = await createVoiceCallRuntime({ |
| 238 | +config: createExternalProviderConfig({ |
| 239 | +provider: "twilio", |
| 240 | +publicUrl: "https://voice.example.com/voice/webhook", |
| 241 | +}), |
| 242 | +coreConfig: {} as CoreConfig, |
| 243 | +agentRuntime: {} as never, |
| 244 | + logger, |
| 245 | +}); |
| 246 | + |
| 247 | +expect(logger.info).toHaveBeenCalledWith( |
| 248 | +"[voice-call] Webhook URL: https://voice.example.com/voice/webhook", |
| 249 | +); |
| 250 | +expect(logger.info).not.toHaveBeenCalledWith( |
| 251 | +"[voice-call] Public URL: https://voice.example.com/voice/webhook", |
| 252 | +); |
| 253 | + |
| 254 | +await runtime.stop(); |
| 255 | +}); |
| 256 | + |
230 | 257 | it("wires the shared realtime agent consult tool and handler", async () => { |
231 | 258 | const config = createBaseConfig(); |
232 | 259 | config.inboundPolicy = "allowlist"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -464,7 +464,7 @@ export async function createVoiceCallRuntime(params: {
|
464 | 464 | |
465 | 465 | log.info("[voice-call] Runtime initialized"); |
466 | 466 | log.info(`[voice-call] Webhook URL: ${webhookUrl}`); |
467 | | -if (publicUrl) { |
| 467 | +if (publicUrl && publicUrl !== webhookUrl) { |
468 | 468 | log.info(`[voice-call] Public URL: ${publicUrl}`); |
469 | 469 | } |
470 | 470 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。