fix(cli): combo create cannot accept models — add --models option (#10954) - #11011
Merged
Merged
Conversation
diegosouzapw
force-pushed
the
fix/10954-combo-create-models
branch
from
August 21, 2026 16:51
f3d412f to
519cec9
Compare
Sa3id23
pushed a commit
to Sa3id23/OmniRoute
that referenced
this pull request
Aug 21, 2026
…egosouzapw#10954) (diegosouzapw#11011) ⭐5 — Fix(diegosouzapw#10954): `combo create` via CLI sempre criava combos vazios (models: [] hardcoded, sem flag). Adiciona --models/--model com parser próprio (CLI .mjs sem alias @/). TDD RED→GREEN, 22/22 testes verdes. UNSTABLE é o base-red inherited diegosouzapw#9985.
5 tasks done
maxmad64bis
pushed a commit
to maxmad64bis/OmniRoute
that referenced
this pull request
Aug 22, 2026
Third-party report diegosouzapw#10954 framed always-empty creation as a bug and diegosouzapw#11011 made populated creation the normal CLI path (--models/--model), so an empty draft has no remaining legitimate route. This closes the remaining hole on both transports: POST /api/combos now returns 400 for a missing or empty models list, and omniroute combo create requires --models/--model instead of silently writing models: []. Consistent with the existing fail-closed behavior for empty pools (diegosouzapw#8494, diegosouzapw#6546): the dashboard already refused empty combos client-side, six downstream consumers reject the empty object, and /api/combos/duplicate already returns 400 for it. JSON migration is unaffected (it validates through the combo invariants, not this schema).
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…egosouzapw#10954) (diegosouzapw#11011) ⭐5 — Fix(diegosouzapw#10954): `combo create` via CLI sempre criava combos vazios (models: [] hardcoded, sem flag). Adiciona --models/--model com parser próprio (CLI .mjs sem alias @/). TDD RED→GREEN, 22/22 testes verdes. UNSTABLE é o base-red inherited diegosouzapw#9985.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10954
Root cause
bin/cli/commands/combo.mjs:combo createsubcommand only ever registered--strategy;POST /api/combos, line ~292) and the local-db fallback(
db.combos.createCombo, line ~308) both hardcodedmodels: [].Every combo created via
omniroute combo createcame out empty regardlessof operator intent — there was no CLI flag to specify models at all.
Fix
--models <spec>(comma-separatedprovider/modelentries, or aJSON array of structured
ComboStep-shaped entries) and a repeatable--model <spec>option tocombo create.bin/cli/commands/comboModels.mjsmodule parses and validates theseoptions. The CLI ships as plain
.mjswith relative-only imports (no@/path aliases, no TS transpilation at runtime), so importing the realZod schema from
src/shared/validation/schemas/combo.tsdirectly is notviable — this module instead validates the same minimal shape by hand
(string entries,
{ kind?: "model", model, providerId?, provider? }, or{ kind: "combo-ref", comboName }), matchingcomboModelEntry/createComboSchema.models.runComboCreateCommandnow propagates the parsedmodelsarray intoboth the HTTP body and the local-db fallback instead of the hardcoded
[].Tests (TDD, Hard Rule #18)
tests/unit/cli-combo-create-models-10954.test.ts:--models/--modelare unrecognized options— Commander (
exitOverride) throwsunknown option '--models'.comboModelsparser unit tests (CSV, JSON array, invalid-shape rejection, merge of
--models+ repeated--model); end-to-end throughrunComboCreateCommandfor both the local-db fallback (models land ingetComboByName(...).models, normalized by the repository layer) andthe HTTP path (the
POST /api/combosbody carries the parsed models).Sibling suites re-run clean:
cli-combo-command.test.ts,cli-combo-suggest-commands.test.ts,cli-route-unavailable-fallback-10081.test.ts.Gates run locally
node --import tsx/esm --test tests/unit/cli-combo-create-models-10954.test.ts tests/unit/cli-combo-command.test.ts tests/unit/cli-combo-suggest-commands.test.ts tests/unit/cli-route-unavailable-fallback-10081.test.ts— 22/22 greennode scripts/check/check-file-size.mjs— OKnode scripts/check/check-complexity.mjs— OK (2615 violations vs baseline 2774)node scripts/check/check-cognitive-complexity.mjs— OK (1175 violations vs baseline 1223)npm run typecheck:core— cleannpx eslint bin/cli/commands/combo.mjs bin/cli/commands/comboModels.mjs tests/unit/cli-combo-create-models-10954.test.ts --suppressions-location config/quality/eslint-suppressions.json— clean (no newany)node scripts/check/check-changelog-integrity.mjs— OK