From 55a31adae7adb71ccaa62c733dce298b39456e29 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Tue, 3 Feb 2026 17:08:20 -0800 Subject: [PATCH] fix(tui): handle malformed AskUserQuestion by falling through to generic approval (#806) Co-authored-by: paulbettner Co-authored-by: Paul Bettner Co-authored-by: Letta --- src/cli/components/ApprovalSwitch.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/cli/components/ApprovalSwitch.tsx b/src/cli/components/ApprovalSwitch.tsx index 0d87638..ecf5a53 100644 --- a/src/cli/components/ApprovalSwitch.tsx +++ b/src/cli/components/ApprovalSwitch.tsx @@ -289,16 +289,20 @@ export const ApprovalSwitch = memo( } // 5. AskUserQuestion → InlineQuestionApproval + // Guard: only render specialized UI if questions are valid, otherwise fall through + // to InlineGenericApproval (matches pattern for Bash/Task with malformed args) if (toolName === "AskUserQuestion" && onQuestionSubmit) { const questions = getQuestions(approval); - return ( - - ); + if (questions.length > 0) { + return ( + + ); + } } // 6. Task tool → InlineTaskApproval