mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Compare commits
1 Commits
fix/handle
...
fix/comp-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb0e92bc88 |
@@ -36,6 +36,7 @@ const AGGRESSIVENESS: Record<string, number> = {
|
||||
"session-dedup": 10, // stackPriority 3 — lossless cross-turn dedup
|
||||
ccr: 15, // stackPriority 4 — reversible retrieval marker, only if it shrinks
|
||||
rtk: 20, // stackPriority 10 — command-output filtering
|
||||
"codex-responses": 22, // stackPriority 12 — conservative Responses tool-output compaction (single-mode)
|
||||
ionizer: 25, // stackPriority 13 — tabular row sampling (lighter than headroom)
|
||||
headroom: 30, // stackPriority 15 — tabular JSON compaction
|
||||
lite: 40, // pri 5, but cheap prose pass (pre-existing reorder, kept as-is)
|
||||
@@ -64,6 +65,7 @@ const REDUCTION_FACTOR: Record<string, number> = {
|
||||
"session-dedup": 0.95,
|
||||
ccr: 0.9, // conservative: only replaces a block when the marker is shorter than it
|
||||
rtk: 0.85,
|
||||
"codex-responses": 0.85, // conservative, lossless-first tool-output compaction (Responses API)
|
||||
ionizer: 0.83, // row sampling, lighter than headroom's full tabular compaction
|
||||
headroom: 0.8,
|
||||
lite: 0.92,
|
||||
|
||||
@@ -75,7 +75,6 @@ import {
|
||||
import {
|
||||
isAntigravityMissingProjectError,
|
||||
shouldTripProviderBreakerForResult,
|
||||
PROVIDER_BREAKER_FAILURE_STATUSES,
|
||||
} from "./chatPredicates";
|
||||
import { connectionHasExtraKeys } from "@omniroute/open-sse/services/apiKeyRotator.ts";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { isLocalStreamLifecycleError } from "../../shared/utils/circuitBreaker";
|
||||
import { isRequestScopedUpstreamFailure } from "./comboFailureLogging";
|
||||
|
||||
export const PROVIDER_BREAKER_FAILURE_STATUSES = new Set([408, 500, 502, 503, 504]);
|
||||
const PROVIDER_BREAKER_FAILURE_STATUSES = new Set([408, 500, 502, 503, 504]);
|
||||
|
||||
// #7907/#7908: single-model breaker trip bypasses the `isFailure` option (only applies
|
||||
// inside `breaker.execute()`), so it needs its own `isLocalStreamLifecycleError` guard —
|
||||
|
||||
@@ -189,11 +189,7 @@ test("getProviderConcurrencyCap resolves override -> static default -> fallback"
|
||||
);
|
||||
setProviderQuotaOverrides({ nvidia: { concurrency: 3 } });
|
||||
try {
|
||||
assert.equal(
|
||||
getProviderConcurrencyCap("nvidia", 99),
|
||||
3,
|
||||
"override wins over the static default"
|
||||
);
|
||||
assert.equal(getProviderConcurrencyCap("nvidia", 99), 3, "override wins over the static default");
|
||||
} finally {
|
||||
setProviderQuotaOverrides(null);
|
||||
}
|
||||
@@ -222,9 +218,13 @@ test("nvidia 429 does not trip the provider circuit breaker (unchanged 408/500/5
|
||||
// is a documentation-alignment guard proving Phase 1 didn't accidentally widen
|
||||
// PROVIDER_BREAKER_FAILURE_STATUSES to include 429 (which would collapse the
|
||||
// per-model lockout this PR adds into a whole-connection/provider outage).
|
||||
// The PROVIDER_BREAKER_FAILURE_STATUSES declaration was extracted from chat.ts into
|
||||
// the sibling chatPredicates.ts (chat.ts now imports it); read it from its home.
|
||||
const chatHandlerPath = path.join(process.cwd(), "src", "sse", "handlers", "chatPredicates.ts");
|
||||
const chatHandlerPath = path.join(
|
||||
process.cwd(),
|
||||
"src",
|
||||
"sse",
|
||||
"handlers",
|
||||
"chat.ts"
|
||||
);
|
||||
const source = fs.readFileSync(chatHandlerPath, "utf8");
|
||||
const match = source.match(/PROVIDER_BREAKER_FAILURE_STATUSES\s*=\s*new Set\(\[([^\]]+)\]\)/);
|
||||
assert.ok(match, "PROVIDER_BREAKER_FAILURE_STATUSES declaration found");
|
||||
|
||||
Reference in New Issue
Block a user