From be5801b079bef673f46f1683c6db89a560b2f307 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 9 Oct 2026 21:07:58 -0500 Subject: [PATCH] fix(voice): expose callback secret presence for setup recovery Co-Authored-By: Paperclip --- .../__tests__/voice-session-store.integration.test.ts | 9 +++++++++ server/src/services/chat-channels.ts | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/src/__tests__/voice-session-store.integration.test.ts b/server/src/__tests__/voice-session-store.integration.test.ts index d83264f5b68..5d1638defc5 100644 --- a/server/src/__tests__/voice-session-store.integration.test.ts +++ b/server/src/__tests__/voice-session-store.integration.test.ts @@ -63,6 +63,15 @@ const support = await getEmbeddedPostgresTestSupport(); return { companyId, endpointId, agentId, connectionId, issueId, conversationId, callerId, sessionId, store, request, reserved, accept, toolInput, publication }; } + it("reports signing-secret presence for interrupted setup without returning credential refs", async () => { + const f = await fixture(); + const chat = chatChannelService(db, {heartbeat: {wakeup: vi.fn()}}); + expect((await chat.get(f.endpointId)).setup.webhookSecretConfigured).toBe(false); + await db.update(toolConnections).set({credentialSecretRefs: [{configPath: "credentials.signingSecret", secretId: randomUUID()}]}).where(eq(toolConnections.id, f.connectionId)); + const endpoint = await chat.get(f.endpointId); + expect(endpoint.setup.webhookSecretConfigured).toBe(true); + expect(endpoint).not.toHaveProperty("credentialSecretRefs"); + }); it("deduplicates concurrent session requests before creating a second task", async () => { const f = await fixture(); const results = await Promise.all([f.store.reserve(f.request), f.store.reserve(f.request)]); diff --git a/server/src/services/chat-channels.ts b/server/src/services/chat-channels.ts index 504310c5a6b..4f5cda8716f 100644 --- a/server/src/services/chat-channels.ts +++ b/server/src/services/chat-channels.ts @@ -5886,7 +5886,11 @@ export function chatChannelService(db: Db, options: ChatChannelServiceOptions) { (ref) => ref.configPath === "credentials.webhookSecret", ), } - : {}), + : endpoint.provider === "speko" ? { + webhookSecretConfigured: row.credentialSecretRefs.some( + (ref) => ref.configPath === "credentials.signingSecret", + ), + } : {}), }, healthMessage: endpoint.healthMessage, lastError: endpoint.lastError,