fix(config): reject object router model refs#187
Conversation
|
Validation note: This PR closes a concrete router config serialization drift. The runtime-supported router model reference contract is a provider/model string, for example: "main/gpt-test"Before this change, UI/server validation did not reject object-shaped router refs. In addition, syncAgentModelWithRouter preserved the object-shaped form when the existing default router scenario was already an object, producing a value like: { id: "main/gpt-test", provider: "main", model: "gpt-test" }That object shape is not the runtime contract for router scenario model refs. The regression test covers both sides of the fix: object-shaped router.scenarios.default is rejected by validatePilotDeckConfig; npm --workspace ui exec vitest run server/services/pilotdeckConfig.router-model-ref.test.js
npm exec -- tsc --noEmit -p tsconfig.jsonThis is a good contract-level fix because it prevents invalid input and also prevents the UI sync path from generating the invalid shape again. |
Summary
Verification
Notes
This is a real UI/runtime contract mismatch: the runtime accepts provider/model strings, while the previous UI validator silently ignored object-shaped refs.