mirror of
https://github.com/simstudioai/sim.git
synced 2026-10-31 03:47:12 +08:00
Show 'Waiting for the first of N agents' for mode-any waits
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.
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user