Skip to content

fix(client): tighten regression error overloads

9196a0b
Select commit
Loading
Failed to load commit list.
Open

feat(client): add experiment runner context #795

fix(client): tighten regression error overloads
9196a0b
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 29, 2026 in 5m 51s

Code review found 1 important issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important packages/client/src/experiment/RunnerContext.ts:153-158 RegressionError renders literal (threshold undefined)

Annotations

Check failure on line 158 in packages/client/src/experiment/RunnerContext.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

RegressionError renders literal (threshold undefined)

When a caller omits the optional `threshold` (valid per `RegressionErrorMetricOptions` where `threshold?: number`), the structured-message branch still interpolates it, producing `Regression on `avg_accuracy`: 0.78 (threshold undefined)` because JS coerces `undefined` to the literal string. Fix by either making `threshold` required in the metric form, or only appending the `(threshold ...)` suffix when `threshold !== undefined`.