fix: address assistant review feedback

This commit is contained in:
ajnart committed 2026-08-14 11:32:10 +02:00
1 parent 33695753dd
commit 5ceef06b4b
26 files changed
+340 -49

No files matched your search

+2 -1
View File
@@ -237,8 +237,9 @@ const fetchModelsAsync = async (configuration: AssistantConfiguration) => {
.flatMap((model) => {
const id = typeof model.id === "string" ? model.id : typeof model.model === "string" ? model.model : null;
if (!id || id.length > 256) return [];
const name =
const rawName =
typeof model.name === "string" ? model.name : typeof model.display_name === "string" ? model.display_name : id;
const name = rawName.trim() || id;
const contextLength =
typeof model.context_length === "number" &&
Number.isSafeInteger(model.context_length) &&
@@ -170,6 +170,12 @@ describe("assistant conversation features", () => {
supported_parameters: [],
architecture: { output_modalities: ["text"] },
},
{
id: "example/unnamed",
name: "",
supported_parameters: ["tools"],
architecture: { output_modalities: ["text"] },
},
],
}),
),
@@ -187,6 +193,10 @@ describe("assistant conversation features", () => {
name: "Example Model",
inputModalities: ["text", "image"],
}),
expect.objectContaining({
id: "example/unnamed",
name: "example/unnamed",
}),
],
});
expect(JSON.stringify(options)).not.toContain("encrypted");