mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
fix(typecheck): resolve typecheck errors in combo spec and compression modules
This commit is contained in:
@@ -3713,7 +3713,8 @@ export async function handleComboChat({
|
||||
signal?.removeEventListener("abort", onClientAbort);
|
||||
}
|
||||
})().catch((err) => {
|
||||
log.error("COMBO", `Speculative task error for target ${i}`, err);
|
||||
const logError = log.error ?? log.warn;
|
||||
logError("COMBO", `Speculative task error for target ${i}`, err);
|
||||
});
|
||||
|
||||
runningTasks.add(task);
|
||||
|
||||
@@ -129,7 +129,7 @@ export function compressAggressive(
|
||||
|
||||
if (resultStats.savingsPercent < cfg.minSavingsThreshold * 100) {
|
||||
try {
|
||||
const cavemanResult = cavemanCompress({ messages: currentMessages });
|
||||
const cavemanResult = cavemanCompress({ messages: currentMessages as unknown as Parameters<typeof cavemanCompress>[0]["messages"] });
|
||||
if (cavemanResult?.compressed && cavemanResult.stats) {
|
||||
const cavemanSavings = cavemanResult.stats.savingsPercent ?? 0;
|
||||
if (cavemanSavings > resultStats.savingsPercent) {
|
||||
|
||||
@@ -77,8 +77,8 @@ export const rtkFilterPackSchema = z
|
||||
category: rtkFilterCategorySchema,
|
||||
priority: z.number().int().min(0).max(100).default(50),
|
||||
match: rtkFilterMatchSchema,
|
||||
rules: rtkFilterRulesSchema.default({}),
|
||||
preserve: rtkFilterPreserveSchema.default({}),
|
||||
rules: rtkFilterRulesSchema.default({} as unknown as z.infer<typeof rtkFilterRulesSchema>),
|
||||
preserve: rtkFilterPreserveSchema.default({} as unknown as z.infer<typeof rtkFilterPreserveSchema>),
|
||||
tests: z.array(rtkInlineTestSchema).default([]),
|
||||
})
|
||||
.strict();
|
||||
|
||||
@@ -65,7 +65,7 @@ export function applyAging(
|
||||
result.push(msg);
|
||||
}
|
||||
} else if (distanceFromEnd <= t.moderate) {
|
||||
const compressed = cavemanCompress({ messages: [msg] });
|
||||
const compressed = cavemanCompress({ messages: [msg] as unknown as Parameters<typeof cavemanCompress>[0]["messages"] });
|
||||
if (compressed?.body?.messages?.[0]?.content) {
|
||||
const newContent =
|
||||
typeof compressed.body.messages[0].content === "string"
|
||||
|
||||
Reference in New Issue
Block a user