diff --git a/integrations/paradiz-web/paradiz-web-agent-server.mjs b/integrations/paradiz-web/paradiz-web-agent-server.mjs index 330c109..d5ea755 100644 --- a/integrations/paradiz-web/paradiz-web-agent-server.mjs +++ b/integrations/paradiz-web/paradiz-web-agent-server.mjs @@ -126,6 +126,8 @@ async function sendTelegramBookingLead(userText) { headers: { 'content-type': 'application/x-www-form-urlencoded' }, body }); + if (res.ok) console.log('[paradizweb] booking lead sent'); + else console.log(`[paradizweb] booking lead send failed status=${res.status}`); return res.ok; } @@ -188,7 +190,9 @@ const server = http.createServer(async (req, res) => { try { const parsed = JSON.parse(body || '{}'); const question = String(parsed.question || '').trim(); - const clientId = String(parsed.client_id || '').trim(); + const rawClientId = String(parsed.client_id || '').trim(); + const fallbackClientId = `${req.socket?.remoteAddress || 'unknown'}|${String(req.headers['user-agent'] || '').slice(0,120)}`; + const clientId = rawClientId || fallbackClientId; if (!question) return json(res, 400, { ok: false, error: 'question_required' }); if (HUMAN_RE.test(question)) {