Files
OmniRoute/tests/unit/reactive-context-compaction-policy.test.mjs
Joachim Brindeau d5aa7e318f [codex] Honor disabled compression for reactive compaction (#9200)
Validated in local merge-train (devbox-vm-06-dev002) @ combined-tip (FAST gates green: static + changed tests + vitest — only pre-existing audit.test.ts flake). Evidence: /home/diegosouzapw/dev/proxys/OmniRoute/.claude/worktrees/merge-train-20260805-213228-suite.log
2026-08-05 21:44:44 -03:00

21 lines
685 B
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { readFileSync } from "node:fs";
const source = readFileSync(
new URL("../../open-sse/handlers/chatCore.ts", import.meta.url),
"utf8"
);
test("global compression off gates reactive and last-resort context compaction", () => {
assert.match(
source,
/reactiveContextCompactionEnabled\s*=\s*compressionSettingsResult\.enabled\s*&&\s*!compressionExcluded;/
);
assert.match(source, /reactiveContextCompactionEnabled\s*&&\s*estimatedTokens\s*>\s*threshold/);
assert.match(
source,
/reactiveContextCompactionEnabled\s*&&\s*finalEstimatedInputTokens\s*>=\s*finalContextLimit/
);
});