refactor(cli): finalize event-driven transition and remove interaction bridge (#18569)

This commit is contained in:
Abhi
2026-02-13 11:14:35 +09:00
committed by GitHub
parent b62c6566be
commit 00f73b73bc
16 changed files with 104 additions and 397 deletions
+10 -4
View File
@@ -20,6 +20,7 @@ import {
ApprovalMode,
parseAndFormatApiError,
ToolConfirmationOutcome,
MessageBusType,
promptIdContext,
tokenLimit,
debugLogger,
@@ -1408,10 +1409,15 @@ export const useGeminiStream = (
// Process pending tool calls sequentially to reduce UI chaos
for (const call of awaitingApprovalCalls) {
const details = call.confirmationDetails;
if (details && 'onConfirm' in details) {
if (call.correlationId) {
try {
await details.onConfirm(ToolConfirmationOutcome.ProceedOnce);
await config.getMessageBus().publish({
type: MessageBusType.TOOL_CONFIRMATION_RESPONSE,
correlationId: call.correlationId,
confirmed: true,
requiresUserConfirmation: false,
outcome: ToolConfirmationOutcome.ProceedOnce,
});
} catch (error) {
debugLogger.warn(
`Failed to auto-approve tool call ${call.request.callId}:`,
@@ -1422,7 +1428,7 @@ export const useGeminiStream = (
}
}
},
[toolCalls],
[config, toolCalls],
);
const handleCompletedTools = useCallback(