Compression Engines
v3.8.1Last updated: 2026-05-13
Was this page helpful?
Loading OmniRoute...
or ) or a deterministic stacked pipeline that executes multiple engines in order.
. Engines expose a shared contract:
or
- : legacy execution path used by stacked pipelines
- : primary execution path returning text + stats
- : returns the JSON-Schema-like shape of valid config
- : returns
(or for advanced cases),
which calls and before accepting.
Use to remove an engine at runtime.
registers the built-in engines before compression runs. This lets preview, runtime compression, stacked mode, tests, and future engines use the same execution path.
and MCP-SERVER.md. It reuses Caveman rules but operates on tool metadata, not request payloads.
, and modes.
fewer output tokens, average output savings in benchmarks
with a range, and a input-compression tool. OmniRoute uses the Caveman input-side
number when documenting stacked prompt/context savings; Caveman output mode remains a separate
response-behavior feature.
, , Vitest/Jest/Pytest,
Cargo/Go tests, TypeScript/Vite/Webpack builds, ESLint, npm audit/installs, Docker logs,
shell /, stack traces, and generic logs
-
- and global filters in
-
-
-
.
.
savings for command-output compression. Its README example shows a
30-minute Claude Code session going from tokens to , or saved.
rtk -> caveman
in compression settings or through compression combos.
combined = 1 - (1 - RTK savings) * (1 - Caveman input savings) average = 1 - (1 - 0.80) * (1 - 0.46) = 89.2% range = 1 - (1 - 0.60..0.90) * (1 - 0.46) = 78.4-94.6%
tool results, not on prompts or context. It targets the verbose accessibility-tree and browser snapshot payloads returned by tools like Playwright, computer-use, and browser-automation MCP servers.
, )
- Sibling collapse — when ≥
(default 30) consecutive lines are structural
repeats, collapses them into the first (default 10) lines + a count summary +
the last (default 5) lines
- Ref preservation —
anchors required by Playwright/computer-use are never touched
- Hard truncation — if the text after collapse still exceeds
(default 50,000),
truncates with a navigation hint so the agent can continue working
open-sse/services/compression/engines/mcpAccessibility/ index.ts ← smartFilterText() entry point collapseRepeated.ts ← sibling-collapse algorithm constants.ts ← DEFAULT_MCP_ACCESSIBILITY_CONFIG
in global settings (migration 056). Default config:
{
"enabled": true,
"maxTextChars": 50000,
"collapseThreshold": 30,
"collapseKeepHead": 10,
"collapseKeepTail": 5,
"minLengthToProcess": 2000
}
is and whose length
exceeds . It does not affect prompt compression or request payloads.
.
| config) | |
node --import tsx/esm --test tests/unit/compression/rtk-*.test.ts tests/unit/compression/pipeline-integration.test.ts tests/unit/compression/context-compression-api.test.ts node --import tsx/esm --test tests/unit/compression/*.test.ts tests/golden-set/*.test.ts tests/integration/compression-pipeline.test.ts tests/unit/api/compression/compression-api.test.ts node --import tsx/esm --test tests/unit/compression/mcpAccessibility*.test.ts npm run typecheck:core