chore: upgrade pi dependencies to 0.84.1

This commit is contained in:
Erik Kotsiuba
2026-08-12 14:18:59 +02:00
parent bd5f4520a3
commit 0365b6f1ff
17 changed files with 242 additions and 118 deletions
+47 -1
View File
@@ -19,6 +19,7 @@ test("selectExtractionModel uses first configured model with auth", async () =>
const result = await selectExtractionModel(
{
model: model("fallback", "c"),
scopedModels: [],
modelRegistry: {
find(provider: string, _id: string) {
if (provider === "missing") {
@@ -44,11 +45,55 @@ test("selectExtractionModel uses first configured model with auth", async () =>
assert.deepEqual(result, {
model: second,
auth: { ok: true, apiKey: "key" },
usedFallback: false,
});
});
test("selectExtractionModel respects the current session model scope", async () => {
const configured = model("configured", "a");
const fallback = model("fallback", "b");
const result = await selectExtractionModel(
{
model: fallback,
scopedModels: [{ model: fallback }],
modelRegistry: {
find() {
return configured;
},
getApiKeyAndHeaders() {
return Promise.resolve({ ok: true, apiKey: "key" });
},
},
} as never,
[{ provider: "configured", id: "a" }]
);
assert.deepEqual(result, {
model: fallback,
usedFallback: true,
});
});
test("selectExtractionModel rejects a fallback outside the current session scope", async () => {
const fallback = model("fallback", "a");
const result = await selectExtractionModel(
{
model: fallback,
scopedModels: [{ model: model("allowed", "b") }],
modelRegistry: {
find() {
return;
},
},
} as never,
[]
);
assert.deepEqual(result, {
error: "No available extraction model in the current session model scope.",
});
});
test("extraction business rules flag option spam", () => {
const issues = collectExtractionBusinessIssues({
questions: [
@@ -111,6 +156,7 @@ test("selectExtractionModel validates fallback model auth", async () => {
const result = await selectExtractionModel(
{
model: fallback,
scopedModels: [],
modelRegistry: {
find() {
return;