fix: skip model budget rows with null max_budget to avoid silently blocking all traffic

This commit is contained in:
Ishaan Jaffer 2026-04-24 17:47:41 -07:00
parent 39207405d7
commit fe7ca53950
No known key found for this signature in database

View file

@ -200,14 +200,14 @@ const ModelBudgetEditor: React.FC<ModelBudgetEditorProps> = ({ value, onChange,
const notifyChange = (newRows: ModelBudgetRow[]) => {
if (!onChange) return;
const filled = newRows.filter((r) => r.model);
const filled = newRows.filter((r) => r.model && r.max_budget !== null);
if (filled.length === 0) {
onChange(undefined);
return;
}
const obj: ModelBudgetValue = {};
for (const r of filled) {
obj[r.model] = { max_budget: r.max_budget ?? 0 };
obj[r.model] = { max_budget: r.max_budget as number };
}
onChange(obj);
};