mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 21:02:12 +03:00
Release v3.8.42 — full CHANGELOG in CHANGELOG.md. CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards, coverage, Node 24 compat, and integration tests. Full unit suite validated locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate main (no required status checks): SonarCloud/SonarQube new-code coverage gate, and PR Test Policy (test-masking detector flagging the legitimate dead-Phind provider removal in #5530 — reviewed, correct). Includes cycle-close reconciliation + repair of inherited base-red tests from #5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
33 lines
893 B
TypeScript
33 lines
893 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { logRoutingDecision } from "../../src/lib/a2a/routingLogger.ts";
|
|
|
|
test("logRoutingDecision records a routing decision with generated metadata", () => {
|
|
const decision = logRoutingDecision({
|
|
taskType: "chat",
|
|
comboId: "combo-1",
|
|
providerSelected: "openai",
|
|
modelUsed: "gpt-4o-mini",
|
|
score: 0.91,
|
|
factors: [
|
|
{
|
|
name: "health",
|
|
value: 1,
|
|
weight: 0.5,
|
|
contribution: 0.5,
|
|
},
|
|
],
|
|
fallbacksTriggered: [],
|
|
success: true,
|
|
latencyMs: 123,
|
|
cost: 0.001,
|
|
});
|
|
|
|
assert.equal(typeof decision.requestId, "string");
|
|
assert.match(decision.requestId, /^[0-9a-f-]{36}$/);
|
|
assert.match(decision.timestamp, /^\d{4}-\d{2}-\d{2}T/);
|
|
assert.equal(decision.providerSelected, "openai");
|
|
assert.equal(decision.factors[0].name, "health");
|
|
});
|