fix(v2/approvals): render correct title + selected label after click

Approval cards bypass the deliverMessage path that populates
pending_questions, so the post-click lookup found nothing and the
card edit fell back to " Question" + the raw option value
("approve"/"reject"). Store title and normalized options on
pending_approvals as well, and look up either table via a shared
getAskQuestionRender helper so the chat-sdk post-click edit and the
Discord interaction callback render the per-card title and the
selectedLabel (e.g. " Approved").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Koshkoshinsk
2026-04-14 15:30:42 +00:00
parent 42467d796d
commit 2df81e0b32
6 changed files with 50 additions and 17 deletions

View File

@@ -106,6 +106,8 @@ export interface PendingApproval {
platform_message_id: string | null;
expires_at: string | null;
status: 'pending' | 'approved' | 'rejected' | 'expired';
title: string;
options_json: string;
}
// ── Pending credentials (central DB) ──