feat(client): add experiment runner context #795
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
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`.
Loading