mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
refactor(cli): finalize event-driven transition and remove interaction bridge (#18569)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user