mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 05:45:04 +03:00
feat(open-sse): propagate quotaSoftDeprioritize from chatCore to combo candidate (B/G2)
Replace `void quotaSoftDeprioritize` with a live call to setCandidateQuotaSoftPenalty when isCombo && comboStepId are set and enforceQuotaShare returned deprioritize=true. Uses dynamic import so the combo service is only loaded for combo requests. Fail-open: import/call errors log a warn but never block the request (consistent with the existing quota enforcement fail-open policy in B/F7).
This commit is contained in:
@@ -3418,9 +3418,18 @@ export async function handleChatCore({
|
||||
);
|
||||
}
|
||||
}
|
||||
// Suppress unused variable lint warning — quotaSoftDeprioritize is available for
|
||||
// combo.ts to read when candidateBuilder populates quotaSoftPenalty in the future.
|
||||
void quotaSoftDeprioritize;
|
||||
// G2: Propagate soft penalty to the current candidate so combo scoring can deprioritize.
|
||||
if (quotaSoftDeprioritize && isCombo && comboStepId) {
|
||||
try {
|
||||
const { setCandidateQuotaSoftPenalty } = await import("../services/combo");
|
||||
setCandidateQuotaSoftPenalty(comboExecutionKey, comboStepId, true);
|
||||
} catch (err) {
|
||||
log?.warn?.(
|
||||
"QUOTA_SHARE",
|
||||
`[quotaShare] could not set soft penalty on candidate: ${err instanceof Error ? err.message : String(err)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
// === /Quota Share enforcement PRE-hook ===
|
||||
|
||||
// Get executor for this provider (with optional upstream proxy routing)
|
||||
|
||||
Reference in New Issue
Block a user