mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-12 18:22:48 +03:00
Model-level targetFormat is provider-scoped endpoint semantics: a catalog entry declares how the DECLARING provider serves the model. getModelTargetFormat() fell back to getGlobalModel() when the provider's own catalog lacked the model id, importing another provider's tag into every provider serving that id. catalog. command-code serves gpt-5.6-luna over its chat-shaped /alpha/generate endpoint but inherited that tag, so chatCore translated the request to Responses format (messages -> input). CommandCodeExecutor.buildCommandCodeBody reads chat-format input.messages -> undefined -> [] -> upstream 502 "Invalid prompt: messages must not be empty" (call log 1786341194167-774a5b). Fix: resolve the provider alias (mirroring getProviderModels), only apply the provider's OWN catalog entry's targetFormat, and skip the global fallback when the provider has a catalog. Catalog-less providers keep the global fallback unchanged; ghe-copilot's Responses routing (#8835) is preserved. Regression test: tests/unit/provider-models-target-format-scoping.test.ts (red before the fix, green after).