From fe13fd065c2f9133ab79d0178f3c38c12520672c Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Thu, 2 Apr 2026 11:30:22 +0100 Subject: [PATCH] chore: downgrade log level for unauthenticated HEAD requests (#23923) Some clients (e.g. Claude) send a HEAD request without credentials as a connectivity check before making actual API calls. This was logging at `Warn` level, creating noise. Downgrade to Info for unauthenticated HEAD requests and add the HTTP method to the logger for better observability. Related to internal slack thread: https://codercom.slack.com/archives/C0AEHQGLW22/p1775045200997309 --- enterprise/aibridged/http.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/enterprise/aibridged/http.go b/enterprise/aibridged/http.go index b2ab60fa9e..701396040a 100644 --- a/enterprise/aibridged/http.go +++ b/enterprise/aibridged/http.go @@ -35,7 +35,10 @@ var ( func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() - logger := s.logger.With(slog.F("path", r.URL.Path)) + logger := s.logger.With( + slog.F("method", r.Method), + slog.F("path", r.URL.Path), + ) // Extract and strip proxy request ID for cross-service log // correlation. Absent for direct requests not routed through @@ -55,7 +58,13 @@ func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) { key := strings.TrimSpace(agplaibridge.ExtractAuthToken(r.Header)) if key == "" { - logger.Warn(ctx, "no auth key provided") + // Some clients (e.g. Claude) send a HEAD request + // without credentials to check connectivity. + if r.Method == http.MethodHead { + logger.Info(ctx, "unauthenticated HEAD request") + } else { + logger.Warn(ctx, "no auth key provided") + } http.Error(rw, ErrNoAuthKey.Error(), http.StatusBadRequest) return }