mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 00:02:20 +03:00
Address zero-latency combo review feedback
This commit is contained in:
@@ -660,7 +660,29 @@ const comboRuntimeConfigSchema = z
|
||||
shadowRouting: shadowRoutingSchema.optional(),
|
||||
evalRouting: evalRoutingSchema.optional(),
|
||||
})
|
||||
.strict();
|
||||
.strict()
|
||||
.superRefine((config, ctx) => {
|
||||
if (config.zeroLatencyOptimizationsEnabled === true) return;
|
||||
|
||||
const addZeroLatencyIssue = (path: string[]) => {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message:
|
||||
"zeroLatencyOptimizationsEnabled must be true to enable zero-latency combo features",
|
||||
path,
|
||||
});
|
||||
};
|
||||
|
||||
if (config.hedging === true) {
|
||||
addZeroLatencyIssue(["hedging"]);
|
||||
}
|
||||
if (typeof config.predictiveTtftMs === "number" && config.predictiveTtftMs > 0) {
|
||||
addZeroLatencyIssue(["predictiveTtftMs"]);
|
||||
}
|
||||
if (config.fallbackCompressionMode && config.fallbackCompressionMode !== "off") {
|
||||
addZeroLatencyIssue(["fallbackCompressionMode"]);
|
||||
}
|
||||
});
|
||||
|
||||
const comboNameSchema = z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user