Skip to content

Commit b2025c7

Browse files
committed
fix(budgets): latency shouldBlock uses mode only, not severity
The latency budget should block (throw) in strict mode and warn in permissive mode, regardless of severity. The previous OR logic caused permissive mode with error severity to throw, breaking the integration test expectation that permissive mode always warns.
1 parent 8d0f845 commit b2025c7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

packages/2-sql/5-runtime/src/plugins/budgets.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export function budgets<TContract = unknown, TAdapter = unknown, TDriver = unkno
194194
const tableRows = options?.tableRows ?? {};
195195
const maxLatencyMs = options?.maxLatencyMs ?? 1_000;
196196
const rowSeverity = options?.severities?.rowCount ?? 'error';
197-
const latencySeverity = options?.severities?.latency ?? 'warn';
198197

199198
const observedRowsByPlan = new WeakMap<ExecutionPlan, { count: number }>();
200199

@@ -238,7 +237,7 @@ export function budgets<TContract = unknown, TAdapter = unknown, TDriver = unkno
238237
) {
239238
const latencyMs = result.latencyMs;
240239
if (latencyMs > maxLatencyMs) {
241-
const shouldBlock = latencySeverity === 'error' || ctx.mode === 'strict';
240+
const shouldBlock = ctx.mode === 'strict';
242241
emitBudgetViolation(
243242
budgetError('BUDGET.TIME_EXCEEDED', 'Query latency exceeds budget', {
244243
latencyMs,

0 commit comments

Comments
 (0)