689
690
/** Whether the chat is genuinely blocked on user input (an open input request, an auth-required tool, or a non-auto-approved confirmation gate). */
691
>
function chatAwaitsUserInput(state: ChatState): boolean {
sessionState.ts
692
>
return !!state.activeTurn?.responseParts.some(part => {
693
>
// An open elicitation always awaits the user until it is answered.
694
>
if (part.kind === ResponsePartKind.InputRequest) {
695
return part.response === undefined;
696
}
698
return false;
699
}
701
>
// Result-confirmation and auth-required gates always require the user; a
702
>
// parameter-confirmation gate only when it was not auto-approved.
703
>
if (status === ToolCallStatus.PendingResultConfirmation || status === ToolCallStatus.AuthRequired) {
704
return true;
705
}
707
>
&& readToolCallMeta(part.toolCall).autoApproveBySetting !== true;
708
>
});
709
>
}
710
711
/**