Files
OmniRoute/open-sse/services/compression/engines/index.ts
Jan Leon fb6ea295bf feat(compression): add Responses tool-output engine (#8010)
* Add Responses tool-output compression engine

* fix: enable Codex Responses stacked steps

* fix(compression): share Codex tokenizer and rebase UI

* fix(compression): sync MCP engine selection

* fix(compression): i18n parity for codex-responses mode + rebaseline

The codex-responses compression engine already imports the shared
countTextTokens/resolveTokenizerEncoding from tiktokenCounter.ts (no
duplicate encoder) and CompressionSettingsTab.tsx already threads the
new mode through the existing useTranslations()/labelKey pattern - both
pre-existing on this branch tip after rebasing onto release/v3.8.49.

What was missing after the rebase: the new compressionModeCodexResponses
/ compressionModeCodexResponsesDesc keys existed only in en.json. Filled
en-fallback into all 42 locales via scripts/i18n/fill-missing-from-en.mjs
and added real pt-BR/vi translations. Also rebaselined the three files
whose own growth (new codex-responses mode wiring) crossed the frozen
file-size caps: open-sse/mcp-server/schemas/tools.ts, open-sse/services/
compression/strategySelector.ts, and src/lib/db/compression.ts.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-22 07:03:02 -03:00

47 lines
2.1 KiB
TypeScript

import { registerCompressionEngine, getCompressionEngine } from "./registry.ts";
import { aggressiveEngine, cavemanEngine, liteEngine, ultraEngine } from "./cavemanAdapter.ts";
import { rtkEngine } from "./rtk/index.ts";
import { sessionDedupEngine } from "./session-dedup/index.ts";
import { headroomEngine } from "./headroom/index.ts";
import { ccrEngine } from "./ccr/index.ts";
import { llmlinguaEngine } from "./llmlingua/index.ts";
import { ionizerEngine } from "./ionizer/index.ts";
import { relevanceEngine } from "./relevance/index.ts";
import { llmCompressorEngine } from "./llm/index.ts";
import { readLifecycleEngine } from "./readLifecycle/index.ts";
import { omniglyphEngine } from "./omniglyphAdapter.ts";
import { codexResponsesEngine } from "./codexResponses/index.ts";
let registered = false;
export function registerBuiltinCompressionEngines(): void {
// The `registered` latch is a fast-path to skip the loop, but it must not block
// re-registration after clearCompressionEngineRegistry() empties the map (tests do this).
// Re-run when the registry was cleared so the builtins are restored.
if (registered && getCompressionEngine(liteEngine.id)) return;
registered = true;
if (!getCompressionEngine(liteEngine.id)) registerCompressionEngine(liteEngine);
const engines: Array<{ id: string; engine: typeof liteEngine }> = [
{ id: "caveman", engine: cavemanEngine },
{ id: "aggressive", engine: aggressiveEngine },
{ id: "ultra", engine: ultraEngine },
{ id: "rtk", engine: rtkEngine },
{ id: "codex-responses", engine: codexResponsesEngine },
{ id: "session-dedup", engine: sessionDedupEngine },
{ id: "headroom", engine: headroomEngine },
{ id: "ccr", engine: ccrEngine },
{ id: "llmlingua", engine: llmlinguaEngine },
{ id: "ionizer", engine: ionizerEngine },
{ id: "relevance", engine: relevanceEngine },
{ id: "llm", engine: llmCompressorEngine },
{ id: "read-lifecycle", engine: readLifecycleEngine },
{ id: "omniglyph", engine: omniglyphEngine },
];
for (const { id, engine } of engines) {
if (!getCompressionEngine(id)) registerCompressionEngine(engine);
}
}