diff --git a/apps/bot/src/discord-bot.ts b/apps/bot/src/discord-bot.ts index 7e8294d..4fdfcda 100644 --- a/apps/bot/src/discord-bot.ts +++ b/apps/bot/src/discord-bot.ts @@ -335,7 +335,7 @@ export async function startBot(): Promise { const isDirectMessage = !message.inGuild(); - await ingestIfIndexed( + await safelyIngestIfIndexed("message-create", message, config.channelIndexing, ragPipeline, @@ -502,7 +502,7 @@ export async function startBot(): Promise { return; } - await ingestIfIndexed( + await safelyIngestIfIndexed("message-update", materializedMessage, config.channelIndexing, ragPipeline, @@ -713,6 +713,17 @@ export async function startBot(): Promise { await client.login(config.botToken); } +async function safelyIngestIfIndexed( + context: string, + ...args: Parameters +): Promise { + try { + await ingestIfIndexed(...args); + } catch (error) { + console.error(`[${context}] Discord archive ingest failed; continuing without indexing.`, error); + } +} + async function resolveRepliedRepoIdentity( message: Message, registry: { identities: RepoDiscordIdentity[] }, diff --git a/scripts/render-voidbot-swarm-dashboard.mjs b/scripts/render-voidbot-swarm-dashboard.mjs index cffd1e0..78c057b 100644 --- a/scripts/render-voidbot-swarm-dashboard.mjs +++ b/scripts/render-voidbot-swarm-dashboard.mjs @@ -685,10 +685,10 @@ function renderValueDetail(value) { function projectPendingMention(mention) { return { identityId: stringOrNull(mention?.identityId), - sourceChannelId: stringOrNull(mention?.sourceChannelId), - sourceMessageId: stringOrNull(mention?.sourceMessageId), - createdAt: stringOrNull(mention?.createdAt), - prompt: truncate(String(mention?.prompt ?? mention?.content ?? ""), 220), + sourceChannelId: stringOrNull(mention?.sourceChannelId ?? mention?.channelId), + sourceMessageId: stringOrNull(mention?.sourceMessageId ?? mention?.messageId), + createdAt: stringOrNull(mention?.createdAt ?? mention?.queuedAt), + prompt: truncate(String(mention?.prompt ?? mention?.visiblePrompt ?? mention?.content ?? ""), 220), }; }