From 63bc10816a3e27b2873d40e2c2f3a46a5b377218 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Fri, 14 Aug 2026 11:05:45 -0700 Subject: [PATCH] Show 'Waiting for the first of N agents' for mode-any waits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wait_agents title ignored the mode argument, so an any-mode wait over three agents read 'Waiting for 3 agents' while the model narrated waiting for the first — contradicting the transcript. --- apps/sim/lib/copilot/tools/tool-display.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/sim/lib/copilot/tools/tool-display.ts b/apps/sim/lib/copilot/tools/tool-display.ts index 4059797c33..ad08842187 100644 --- a/apps/sim/lib/copilot/tools/tool-display.ts +++ b/apps/sim/lib/copilot/tools/tool-display.ts @@ -610,12 +610,17 @@ function waitTitle(args: ToolArgs): string { return formatWaitTitle(requestedWaitSeconds(args), stringArg(args, 'reason')) } -/** Title for a wait_agents sleep, naming the agent(s) being collected. */ +/** Title for a wait_agents sleep, naming the agent(s) being collected and honoring mode "any". */ function waitAgentsTitle(args: ToolArgs): string { const raw = args?.agent_ids const ids = Array.isArray(raw) ? raw.filter((id): id is string => typeof id === 'string') : [] + const anyMode = stringArg(args, 'mode') === 'any' if (ids.length === 1) return `Waiting for ${ids[0]}` - if (ids.length > 1) return `Waiting for ${ids.length} agents` + if (ids.length > 1) { + return anyMode + ? `Waiting for the first of ${ids.length} agents` + : `Waiting for ${ids.length} agents` + } return 'Waiting for agents' }