feat: log auto-reply body and stats for web provider

This commit is contained in:
Peter Steinberger
2025-11-25 04:42:19 +01:00
parent 2aac606979
commit 3aedef4126

View File

@@ -298,6 +298,7 @@ export async function monitorWebProvider(
: new Date().toISOString();
console.log(`\n[${ts}] ${msg.from} -> ${msg.to}: ${msg.body}`);
const replyStarted = Date.now();
const replyText = await replyResolver(
{
Body: msg.body,
@@ -312,8 +313,15 @@ export async function monitorWebProvider(
if (!replyText) return;
try {
await msg.reply(replyText);
const durationMs = Date.now() - replyStarted;
if (isVerbose()) {
console.log(success(`↩️ Auto-replied to ${msg.from} (web)`));
console.log(
success(
`↩️ Auto-replied to ${msg.from} (web, ${replyText.length} chars, ${durationMs}ms)`,
),
);
} else {
console.log(`↩️ ${replyText}`);
}
} catch (err) {
console.error(