feat(agent): relax provider http timeouts (#348)

This commit is contained in:
Fodesu
2026-04-15 00:07:41 +08:00
committed by GitHub
parent 38ac907361
commit 8e1ed3683f
10 changed files with 95 additions and 28 deletions
+2 -2
View File
@@ -209,7 +209,7 @@ func (s *Service) Count(ctx context.Context) (int64, error) {
return count, nil
}
const probeTimeout = 5 * time.Second
const probeTimeout = models.DefaultProviderProbeTimeout
// Test probes the provider using the Twilight AI SDK to check
// reachability and authentication.
@@ -326,7 +326,7 @@ func (s *Service) FetchRemoteModels(ctx context.Context, id string) ([]RemoteMod
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
}
resp, err := http.DefaultClient.Do(req) //nolint:gosec // G704: URL is from operator-configured provider base URL
resp, err := models.NewProviderHTTPClient(probeTimeout).Do(req) //nolint:gosec // G704: URL is from operator-configured LLM provider base URL
if err != nil {
return nil, fmt.Errorf("execute request: %w", err)
}