Address zero-latency combo review feedback

This commit is contained in:
R.D.
2026-05-29 15:51:44 -04:00
committed by diegosouzapw
parent 1ce07aa1ae
commit a7c098e36c
5 changed files with 162 additions and 11 deletions

View File

@@ -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()