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

@ -139,7 +139,10 @@ export function parseArgs(args: string[]): Args {
} else if (arg === "--session-dir" && i + 1 < args.length) {
result.sessionDir = args[++i];
} else if (arg === "--models" && i + 1 < args.length) {
result.models = args[++i].split(",").map((s) => s.trim());
result.models = args[++i]
.split(",")
.map((s) => s.trim())
.filter((pattern) => pattern.length > 0);
} else if (arg === "--no-tools" || arg === "-nt") {
result.noTools = true;
} else if (arg === "--no-builtin-tools" || arg === "-nbt") {