mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-22 02:48:00 +02:00
Fix missing results for parallel Eino tool calls.
Merge streaming tool outputs by CallID with ConcatMessages, pair same-name historical results, and FIFO-match duplicate IDs so concurrent nmap 1/2 and 2/2 stay distinct. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
temp
co-authored by
Cursor
parent
ac6e04a94c
commit
24d06c5220
@@ -908,10 +908,37 @@ func tryEmitToolCallsOnce(
|
||||
if _, ok := seen[sig]; ok {
|
||||
return
|
||||
}
|
||||
if idSig := toolCallsStableIDSignature(msg); idSig != "" {
|
||||
idKey := agentName + "\x1eids\x1e" + idSig
|
||||
if _, ok := seen[idKey]; ok {
|
||||
return
|
||||
}
|
||||
seen[idKey] = struct{}{}
|
||||
}
|
||||
seen[sig] = struct{}{}
|
||||
emitToolCallsFromMessage(msg, agentName, orchestratorName, conversationID, orchMode, progress, subAgentToolStep, mainAgentToolStep, markPending)
|
||||
}
|
||||
|
||||
func toolCallsStableIDSignature(msg *schema.Message) string {
|
||||
if msg == nil || len(msg.ToolCalls) == 0 {
|
||||
return ""
|
||||
}
|
||||
visible := filterVisibleToolCallsForProgress(msg.ToolCalls)
|
||||
ids := make([]string, 0, len(visible))
|
||||
for _, tc := range visible {
|
||||
id := strings.TrimSpace(tc.ID)
|
||||
if id == "" {
|
||||
continue
|
||||
}
|
||||
ids = append(ids, id)
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
return ""
|
||||
}
|
||||
sort.Strings(ids)
|
||||
return strings.Join(ids, ";")
|
||||
}
|
||||
|
||||
func emitToolCallsFromMessage(
|
||||
msg *schema.Message,
|
||||
agentName, orchestratorName, conversationID, orchMode string,
|
||||
|
||||
Reference in New Issue
Block a user