From 3660ffecdd24499f2d01f088334691f9675084fc Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Thu, 30 Jul 2026 12:03:22 +0100 Subject: [PATCH] fix: add warn log level to unpriced models message (#27678) When a model is missing from the price table, token usage is still recorded but with a NULL cost, so AI spend for that model goes unattributed. This was logged at debug level, which means it is invisible in a default deployment. Log it at warn level instead so admins can see which provider/model pairs need a price row and act on it. --- coderd/aibridgedserver/cost.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/aibridgedserver/cost.go b/coderd/aibridgedserver/cost.go index 9bd280b53c..0e549d0da2 100644 --- a/coderd/aibridgedserver/cost.go +++ b/coderd/aibridgedserver/cost.go @@ -71,7 +71,7 @@ func (s *Server) resolveTokenUsageCost(ctx context.Context, intc database.AIBrid switch { case errors.Is(err, sql.ErrNoRows): // Model not in the price table: record tokens but leave cost NULL. - s.logger.Debug(ctx, "no price found for model, recording token usage with NULL cost", + s.logger.Warn(ctx, "no price found for model, recording token usage with NULL cost", slog.F("provider", intc.Provider), slog.F("model", intc.Model)) if s.metrics != nil { s.metrics.UnpricedTokenUsageRecords.WithLabelValues(intc.Provider, intc.Model).Inc()