fix(coding-agent): ignore empty entries in --models

A trailing comma in --models produced an empty pattern, which
matched every model by substring and added an extra model to
the model cycle.

fixes #10334
This commit is contained in:
David Brailovsky 2026-10-02 13:42:14 +02:00
parent b271b0a524
commit 9b3c19da5c
3 changed files with 11 additions and 1 deletions

View file

@ -145,6 +145,12 @@ describe("parseArgs", () => {
const result = parseArgs(["--models", "gpt-4o,claude-sonnet,gemini-pro"]);
expect(result.models).toEqual(["gpt-4o", "claude-sonnet", "gemini-pro"]);
});
// Issue #10334
test("ignores empty entries in --models", () => {
const result = parseArgs(["--models", "gpt-4o, ,claude-sonnet,"]);
expect(result.models).toEqual(["gpt-4o", "claude-sonnet"]);
});
});
// Issue #9045