Extract shared HTTP client for search tools

The userAgentTransport and 15s timeout were inconsistently
applied: government_db.go lost its timeout, wayback.go used
a bare http.Client without the pooled transport or user-agent
header. A new httpclient.go centralizes the setup so all
search tools share the same configuration.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-19 10:07:30 +04:00
parent a67ac462d7
commit ef6aca2c93
4 changed files with 42 additions and 20 deletions

View File

@@ -18,7 +18,6 @@ import (
"context"
"fmt"
"go.gearno.de/kit/httpclient"
"go.probo.inc/probo/pkg/agent"
)
@@ -45,8 +44,7 @@ type (
)
func CheckGovernmentDBTool(endpoint, apiKey string) agent.Tool {
client := httpclient.DefaultPooledClient()
client.Transport = &userAgentTransport{next: client.Transport}
client := newHTTPClient()
return agent.FunctionTool(
"check_government_databases",