We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6c31f9f + b2fbe83 commit 9929118Copy full SHA for 9929118
1 file changed
pkg/tools/integration/web.go
@@ -350,6 +350,19 @@ func (p *BraveSearchProvider) Search(
350
351
results := searchResp.Web.Results
352
if len(results) == 0 {
353
+ // Log a warning when the API returned 200 but no results.
354
+ // This helps diagnose API format changes or silent errors
355
+ // where the response body does not match the expected structure.
356
+ bodyPreview := string(body)
357
+ if len(bodyPreview) > 300 {
358
+ bodyPreview = bodyPreview[:300]
359
+ }
360
+ logger.WarnCF("web_search", "Brave API returned empty results",
361
+ map[string]any{
362
+ "query": query,
363
+ "status": resp.StatusCode,
364
+ "body_preview": bodyPreview,
365
+ })
366
return fmt.Sprintf("No results for: %s", query), nil
367
}
368
0 commit comments