MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / fetchBenchmarkUserToken

Function fetchBenchmarkUserToken

services/auto-routing-benchmark/src/run.ts:778–804  ·  view source on GitHub ↗
(
  env: Env,
  userId: string,
  organizationId: string | null = null
)

Source from the content-addressed store, hash-verified

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(

Callers 2

registerAdminRoutesFunction · 0.90
processDeciderJobFunction · 0.85

Calls 4

getMethod · 0.65
textMethod · 0.65
jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected