From 540f81ff9e7e6e769c09c8576f0d6b339a072459 Mon Sep 17 00:00:00 2001
From: Alix-007
Date: Wed, 24 Jun 2026 18:30:44 +0800
Subject: [PATCH] fix(openai_compat): use structured logger for native_search
warning
---
pkg/providers/openai_compat/provider.go | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/pkg/providers/openai_compat/provider.go b/pkg/providers/openai_compat/provider.go
index c12a8348f..317a49308 100644
--- a/pkg/providers/openai_compat/provider.go
+++ b/pkg/providers/openai_compat/provider.go
@@ -160,9 +160,12 @@ func (p *Provider) buildRequestBody(
// treat it as false — web_search_preview must not be injected
// when the caller cannot express a well-typed intent.
if _, present := options["native_search"]; present {
- log.Printf(
- "[openai_compat] native_search option has unexpected type %T, ignoring",
- options["native_search"],
+ logger.WarnCF(
+ "provider.openai_compat",
+ "native_search option has unexpected type, ignoring",
+ map[string]any{
+ "type": fmt.Sprintf("%T", options["native_search"]),
+ },
)
}
}