( env: Env, userId: string, organizationId: string | null = null )
| 776 | reasoning_effort: entry.variant, |
| 777 | })); |
| 778 | |
| 779 | try { |
| 780 | await insertRun( |
| 781 | env.BENCH_DB, |
| 782 | { |
| 783 | id: runId, |
| 784 | kind, |
| 785 | startedAt, |
| 786 | min_accuracy: config.minAccuracy, |
| 787 | switch_cost_factor: config.switchCostFactor, |
| 788 | best_accuracy_switch_threshold: config.bestAccuracySwitchThreshold, |
| 789 | max_concurrency: laneBudget, |
| 790 | benchmark_user_id: benchmarkIdentity.benchmarkUserId, |
| 791 | benchmark_org_id: benchmarkIdentity.benchmarkOrgId, |
| 792 | repetitions, |
| 793 | classifier_max_p95_latency_ms: |
| 794 | kind === 'classifier' ? config.classifierMaxP95LatencyMs : null, |
| 795 | engine_identity: engineIdentity, |
| 796 | purpose, |
| 797 | }, |
| 798 | runModelRows, |
| 799 | carriedSummaries |
| 800 | ); |
| 801 | } catch (error) { |
| 802 | // The claim is already made, so hand the rows back to the queue — otherwise |
| 803 | // they sit `running` under a run that was never written and nothing can |
| 804 | // reach them. |
| 805 | if (kind === 'decider') { |
| 806 | await releaseProfileClaims(env.BENCH_DB, runId).catch((releaseError: unknown) => { |
| 807 | console.warn( |
no test coverage detected