MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / handleAssistantThreadStarted

Function handleAssistantThreadStarted

server/src/addie/handler.ts:498–518  ·  view source on GitHub ↗
(
  event: AssistantThreadStartedEvent
)

Source from the content-addressed store, hash-verified

496 * Handle Assistant thread started event
497 */
498export async function handleAssistantThreadStarted(
499 event: AssistantThreadStartedEvent
500): Promise<void> {
501 if (!initialized || !claudeClient) {
502 logger.warn('Addie: Not initialized, ignoring assistant_thread_started');
503 return;
504 }
505
506 logger.info(
507 { userId: event.assistant_thread.user_id, channelId: event.channel_id },
508 'Addie: Assistant thread started'
509 );
510
511 // Set dynamic suggested prompts based on user context
512 try {
513 const prompts = await getDynamicSuggestedPrompts(event.assistant_thread.user_id);
514 await setAssistantSuggestedPrompts(event.channel_id, prompts);
515 } catch (error) {
516 logger.error({ error }, 'Addie: Failed to set suggested prompts');
517 }
518}
519
520/**
521 * Handle message in Assistant thread

Callers 1

handleSlackEventFunction · 0.85

Calls 3

warnMethod · 0.80

Tested by

no test coverage detected