mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Combo dispatch and the combo test button used to crash with 'TypeError: e.startsWith is not a function' when a step's modelStr failed to resolve (regression after #2338 added per-account LKGP routing for local/Docker providers). The TypeScript annotation says the field is always a string, but malformed combo rows leaked through to the dispatch path. Two defensive boundary guards: 1. open-sse/services/combo.ts LKGP fallback findIndex — type-check target.modelStr before calling startsWith. 2. src/app/api/combos/test/route.ts testComboTarget — coerce target.modelStr at the entry, surface a clean 'Combo step is missing a model id' error instead of crashing. Regression test parses the source and asserts no unguarded target.modelStr.<string-method> usages remain in combo.ts, so a future refactor that reintroduces the pattern fails loudly.