Enha: catching tool call id

This commit is contained in:
Grail Finder
2025-12-10 13:07:06 +03:00
parent 0fc70ae441
commit c80ff60668
2 changed files with 28 additions and 8 deletions

7
bot.go
View File

@@ -629,6 +629,13 @@ func findCall(msg, toolCall string, tv *tview.TextView) {
}
lastToolCall.Args = openAIToolMap
fc = lastToolCall
// Ensure lastToolCallID is set if it's available in the tool call
if lastToolCallID == "" && len(openAIToolMap) > 0 {
// Attempt to extract ID from the parsed tool call if not already set
if id, exists := openAIToolMap["id"]; exists {
lastToolCallID = id
}
}
} else {
jsStr := toolCallRE.FindString(msg)
if jsStr == "" {