mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
fix(types): preserve request rule contracts (#9135)
Validated in local merge-train (devbox-vm-06-dev002) @ combined-tip (FAST gates: typecheck/complexity/cognitive/changelog/vitest — only pre-existing audit.test.ts flake). Evidence: /home/diegosouzapw/dev/proxys/OmniRoute/.claude/worktrees/merge-train-20260805-222248-suite.log
This commit is contained in:
@@ -85,7 +85,7 @@ function clonePayloadRulesConfig(config: PayloadRulesConfig): PayloadRulesConfig
|
||||
|
||||
function normalizeModelSpecs(value: unknown): PayloadRuleModelSpec[] {
|
||||
return toArray<JsonRecord>(value)
|
||||
.map((item) => {
|
||||
.map((item): PayloadRuleModelSpec | null => {
|
||||
const name = typeof item?.name === "string" ? item.name.trim() : "";
|
||||
const protocol = typeof item?.protocol === "string" ? item.protocol.trim() : "";
|
||||
if (!name) return null;
|
||||
|
||||
@@ -30,6 +30,7 @@ export interface RuleInput {
|
||||
messages: Array<{ role?: string; content?: string | unknown }>;
|
||||
systemPrompt?: string;
|
||||
tools?: Array<{
|
||||
type?: string;
|
||||
function?: { name: string; description?: string; parameters?: unknown };
|
||||
}>;
|
||||
model?: string;
|
||||
|
||||
Reference in New Issue
Block a user