fix(tui): handle malformed AskUserQuestion by falling through to generic approval (#806)
Co-authored-by: paulbettner <paulbettner@playfulstudios.com> Co-authored-by: Paul Bettner <paulbettner@users.noreply.github.com> Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -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 (
|
||||
<InlineQuestionApproval
|
||||
questions={questions}
|
||||
onSubmit={onQuestionSubmit}
|
||||
onCancel={onCancel}
|
||||
isFocused={isFocused}
|
||||
/>
|
||||
);
|
||||
if (questions.length > 0) {
|
||||
return (
|
||||
<InlineQuestionApproval
|
||||
questions={questions}
|
||||
onSubmit={onQuestionSubmit}
|
||||
onCancel={onCancel}
|
||||
isFocused={isFocused}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Task tool → InlineTaskApproval
|
||||
|
||||
Reference in New Issue
Block a user