Model Router.Test

loom-buildertesttypescript
Path: loom-builder/src/model-router.test.tsRelative: src/model-router.test.tsSubproject: loom-builderCategory: dispatch-system
Lines: 44Bytes: 1,653Imports: 4Exports: 0has tests

Content Preview

  1. import { describe, expect, test } from "bun:test";
  2. import { PreFlightError } from "./preflight.js";
  3. import { routeModelForSpec, transientProviderErrorRegex, type ModelRoster } from "./model-router.js";
  4. import type { DispatchSpec } from "./types.js";
  5. const baseSpec: DispatchSpec = {
  6. id: "router-test",
  7. promptFile: "/tmp/prompt.md",
  8. targetCwd: "/tmp",
  9. model: { provider: "openrouter", id: "tencent/hy3-preview" },
  10. validation: [],
  11. budget: { maxToolCalls: 1, maxWallclockMs: 1000 },
  12. };
  13. con