From e8277729942b00dfc4fd3f7ca3e839d6a8bf1cc4 Mon Sep 17 00:00:00 2001 From: TrueAlpha-spiral <199723968+TrueAlpha-spiral@users.noreply.github.com> Date: Sat, 25 Apr 2026 19:04:06 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Optimize=20acpPeer=20tool=20call=20?= =?UTF-8?q?execution=20using=20Promise.all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- packages/cli/src/acp/acpPeer.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/acp/acpPeer.ts b/packages/cli/src/acp/acpPeer.ts index 40d8753fb60..0409762280f 100644 --- a/packages/cli/src/acp/acpPeer.ts +++ b/packages/cli/src/acp/acpPeer.ts @@ -169,13 +169,13 @@ class GeminiAgent implements Agent { if (functionCalls.length > 0) { const toolResponseParts: Part[] = []; - for (const fc of functionCalls) { - const response = await this.#runTool( - pendingSend.signal, - promptId, - fc, - ); + const responses = await Promise.all( + functionCalls.map((fc) => + this.#runTool(pendingSend.signal, promptId, fc), + ), + ); + for (const response of responses) { const parts = Array.isArray(response) ? response : [response]; for (const part of parts) {