Compare commits

..

1 Commits

Author SHA1 Message Date
Probe Test
eb0e92bc88 fix(compression): rank the codex-responses engine in the adaptive ladder maps
#6533 guard: every registered catalog engine must have an aggressivenessOf()
rank above "off" and a non-generic expectedReductionFactor(), or floor-mode
escalation ranking silently treats it as inert.

The `codex-responses` engine (Responses Tool Output, stackPriority 12, added with
the 12-engine catalog) was never added to AGGRESSIVENESS / REDUCTION_FACTOR in
adaptiveCompression/ladder.ts, so aggressivenessOf() returned 0 (== off) and
expectedReductionFactor() fell back to the generic 0.9. Placed it between rtk (20)
and ionizer (25) with a conservative, lossless-first reduction factor of 0.85 — it
stays a single-mode engine, not part of the automatic DEFAULT_LADDER (like ionizer
/ relevance / omniglyph).

Validated: ladder-engine-maps-6533 now 3/3; the compression/adaptive ladder test
files stay green (24/0).
2026-07-23 03:34:23 -03:00
4 changed files with 11 additions and 10 deletions

View File

@@ -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,

View File

@@ -75,7 +75,6 @@ import {
import {
isAntigravityMissingProjectError,
shouldTripProviderBreakerForResult,
PROVIDER_BREAKER_FAILURE_STATUSES,
} from "./chatPredicates";
import { connectionHasExtraKeys } from "@omniroute/open-sse/services/apiKeyRotator.ts";
import {

View File

@@ -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 —

View File

@@ -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");