Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,19 @@ function formatDuration(ms: number) {

// Selection reasons where the weighted-score formula is bypassed entirely, so
// every provider's score is a hardcoded 0 placeholder rather than a real value.
// "session-sticky" is intentionally excluded: it scores providers with the
// normal weighted algorithm and pins the result for the session, so the logged
// scores are real values worth surfacing. The all-zero fallback below hides
// those scores when they couldn't be computed (no metrics available).
const SCORE_BYPASSED_SELECTION_REASONS = new Set([
"session-sticky",
"random-exploration",
"price-only-no-metrics",
]);

// The per-provider score only carries information when scoring actually ran.
// Sticky/exploration/price-only paths emit 0 for every provider, and
// "stable-preferred" can layer on top of a sticky pick (also all zeros), so
// treat an all-zero set as "scoring did not run" regardless of the reason.
// Exploration/price-only paths emit 0 for every provider, and "stable-preferred"
// can layer on top of a sticky pick, so treat an all-zero set as "scoring did
// not run" regardless of the reason.
function isProviderScoreMeaningful(
selectionReason: string | null | undefined,
providerScores: { score: number }[],
Expand Down
Loading