diff --git a/pkg/providers/http_provider.go b/pkg/providers/http_provider.go index e0f7471..8719d3e 100644 --- a/pkg/providers/http_provider.go +++ b/pkg/providers/http_provider.go @@ -233,9 +233,6 @@ func toResponsesInputItemsWithState(msg Message, seenCalls map[string]struct{}) if callID == "" { continue } - if seenCalls != nil { - seenCalls[callID] = struct{}{} - } name := strings.TrimSpace(tc.Name) argsRaw := "" if tc.Function != nil { @@ -255,6 +252,9 @@ func toResponsesInputItemsWithState(msg Message, seenCalls map[string]struct{}) argsRaw = string(argsJSON) } } + if seenCalls != nil { + seenCalls[callID] = struct{}{} + } items = append(items, map[string]interface{}{ "type": "function_call", "call_id": callID,