From 8988002c5a6a66c517703d97ea5e18d2e0a22628 Mon Sep 17 00:00:00 2001 From: DBT Date: Tue, 24 Feb 2026 10:08:22 +0000 Subject: [PATCH] ensure seen call ids only after valid function_call is emitted --- pkg/providers/http_provider.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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,