mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 20:46:57 +02:00
fix(voice-call): avoid duplicate webhook logs
This commit is contained in:
@@ -227,6 +227,33 @@ describe("createVoiceCallRuntime lifecycle", () => {
|
||||
await runtime.stop();
|
||||
});
|
||||
|
||||
it("does not log duplicate webhook and public URLs when they match", async () => {
|
||||
const logger = {
|
||||
info: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
error: vi.fn(),
|
||||
};
|
||||
|
||||
const runtime = await createVoiceCallRuntime({
|
||||
config: createExternalProviderConfig({
|
||||
provider: "twilio",
|
||||
publicUrl: "https://voice.example.com/voice/webhook",
|
||||
}),
|
||||
coreConfig: {} as CoreConfig,
|
||||
agentRuntime: {} as never,
|
||||
logger,
|
||||
});
|
||||
|
||||
expect(logger.info).toHaveBeenCalledWith(
|
||||
"[voice-call] Webhook URL: https://voice.example.com/voice/webhook",
|
||||
);
|
||||
expect(logger.info).not.toHaveBeenCalledWith(
|
||||
"[voice-call] Public URL: https://voice.example.com/voice/webhook",
|
||||
);
|
||||
|
||||
await runtime.stop();
|
||||
});
|
||||
|
||||
it("wires the shared realtime agent consult tool and handler", async () => {
|
||||
const config = createBaseConfig();
|
||||
config.inboundPolicy = "allowlist";
|
||||
|
||||
@@ -464,7 +464,7 @@ export async function createVoiceCallRuntime(params: {
|
||||
|
||||
log.info("[voice-call] Runtime initialized");
|
||||
log.info(`[voice-call] Webhook URL: ${webhookUrl}`);
|
||||
if (publicUrl) {
|
||||
if (publicUrl && publicUrl !== webhookUrl) {
|
||||
log.info(`[voice-call] Public URL: ${publicUrl}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user