v2 phase 5: pending questions with interactive cards
End-to-end ask_user_question flow: - Agent MCP tool writes question card to messages_out - Host delivery creates pending_questions row, delivers as Discord Card with buttons - Local webhook server receives Gateway INTERACTION_CREATE events - Acknowledges interaction + updates card to show selected answer - Routes response back to session DB as system message - MCP tool poll picks up response and returns to agent Key fixes: - Poll loop now skips system messages (reserved for MCP tool responses) - Gateway listener uses webhookUrl forwarding mode for interaction support - Button custom_id encodes questionId + option text for self-contained routing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,9 @@ export interface ChannelSetup {
|
||||
|
||||
/** Called when the adapter discovers metadata about a conversation. */
|
||||
onMetadata(platformId: string, name?: string, isGroup?: boolean): void;
|
||||
|
||||
/** Called when a user clicks a button/action in a card (e.g., ask_user_question response). */
|
||||
onAction(questionId: string, selectedOption: string, userId: string): void;
|
||||
}
|
||||
|
||||
/** Inbound message from adapter to host. */
|
||||
|
||||
Reference in New Issue
Block a user