fix(voice-call): avoid duplicate webhook logs

This commit is contained in:
Peter Steinberger
2026-04-26 12:05:31 +01:00
parent 8a63c898c8
commit ecf71da888
2 changed files with 28 additions and 1 deletions

View File

@@ -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";

View File

@@ -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}`);
}