fix(task): reject sparse model fallback arrays

This commit is contained in:
panosAthDBX
2026-07-23 09:53:54 +01:00
parent 10e1ba911c
commit bfef3f7eea
4 changed files with 27 additions and 18 deletions
@@ -215,17 +215,20 @@ describe("task.batch validation", () => {
expect(text).toContain("Missing `context`");
});
it("rejects an empty per-item model selector", async () => {
const text = await executeText(
{
context: "Background.",
tasks: [{ name: "Alpha", task: "Work.", model: [","] }],
},
{ "task.batch": true },
);
expect(text).toContain("Task 1 (`Alpha`) has an invalid `model`");
expect(text).toContain("non-empty array");
});
it.each([{ model: [","] }, { model: Array<string>(1) }])(
"rejects an empty per-item model selector",
async ({ model }) => {
const text = await executeText(
{
context: "Background.",
tasks: [{ name: "Alpha", task: "Work.", model }],
},
{ "task.batch": true },
);
expect(text).toContain("Task 1 (`Alpha`) has an invalid `model`");
expect(text).toContain("non-empty array");
},
);
it("rejects duplicate provided names case-insensitively", async () => {
const text = await executeText(