RTK Compression
Was this page helpful?
Loading OmniRoute...
or as the first step in a stacked pipeline, usually:
rtk -> caveman
command-output savings. Its README sample session goes from
standard tokens to RTK tokens, which is saved (). OmniRoute uses
that upstream average for the stacked savings calculation with Caveman input compression:
RTK average: 80% saved Caveman input: 46% saved Stacked: 1 - (1 - 0.80) * (1 - 0.46) = 89.2% saved Range: 1 - (1 - 0.60..0.90) * (1 - 0.46) = 78.4-94.6%
, , |
|
, , |
|
, , |
|
| , Docker logs | |
classifies output before filter selection. Filters can also match by command pattern or output regex when a command class is not enough.
.
- is set.
- contains the SHA-256 hash of
.
{
"filtersSha256": "0123456789abcdef..."
}
diagnostics. Invalid built-in filters fail fast.
Compression Rules Format. The runtime applies these stages in order:
stripAnsi -> filterStderr -> replace -> matchOutput -> drop/include lines -> truncateLineAt -> head/tail/maxLines -> onEmpty
samples. Custom filters should include them too, especially when they are shared across projects.
. RTK-specific settings are also
available through .
{
"defaultMode": "stacked",
"autoTriggerMode": "stacked",
"autoTriggerTokens": 32000,
"stackedPipeline": [
{ "engine": "rtk", "intensity": "standard" },
{ "engine": "caveman", "intensity": "full" }
],
"rtkConfig": {
"enabled": true,
"intensity": "standard",
"applyToToolResults": true,
"applyToCodeBlocks": false,
"applyToAssistantMessages": false,
"enabledFilters": [],
"disabledFilters": [],
"maxLinesPerResult": 120,
"maxCharsPerResult": 12000,
"deduplicateThreshold": 3,
"customFiltersEnabled": true,
"trustProjectFilters": false,
"rawOutputRetention": "never",
"rawOutputMaxBytes": 1048576
}
}
and use filter ids, for example or .
{
"command": "npm test",
"text": "FAIL tests/example.test.ts\nAssertionError: expected true\nTest Files 1 failed",
"config": {
"intensity": "standard"
}
}
{
"mode": "stacked",
"messages": [
{
"role": "tool",
"content": "FAIL tests/example.test.ts\nAssertionError: expected true\nTest Files 1 failed"
}
],
"config": {
"rtkConfig": {
"rawOutputRetention": "failures"
}
}
}
can retain redacted raw output:
DATA_DIR/rtk/raw-output/
, , values. Analytics
stores only the pointer id, size, and hash metadata.
node --import tsx/esm --test tests/unit/compression/rtk-verify.test.ts
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
only after review.