Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(mcp-host): enable compaction pre-prune by default (#731)

Alfredo Lopez6559bc015154
diff --git a/mcp-host/README.md b/mcp-host/README.md
index 14b29d64c..ca09345a8 100644
--- a/mcp-host/README.md
+++ b/mcp-host/README.md
@@ -45,6 +45,7 @@ MCP Host is a Kubernetes-native service that reads Host CRD configuration and pr
| `CLERUM_ENABLE_NUDGE` | Enables the nudge controller that pushes model/tool retry guidance when output is rejected. | `CLERUM_ENABLE_NUDGE=false` |
| `CLERUM_NUDGE_MAX_ITERATIONS` | Maximum number of nudge cycles allowed for a task. | `CLERUM_NUDGE_MAX_ITERATIONS=3` |
| `CLERUM_CONTEXT_MAX_TOKENS` | Token budget used by context compaction logic before pruning/summarization. | `CLERUM_CONTEXT_MAX_TOKENS=100000` |
+| `CLERUM_COMPACTION_PRE_PRUNE` | Master switch for pre-pruning the history before each LLM call (deduplication, one-lining, JSON truncation, media stripping). On by default; set to `false` to disable every pass at once. | `CLERUM_COMPACTION_PRE_PRUNE=true` |
| `CLERUM_WORKSPACE_PATH` | Base workspace path used by native tools and workspace-aware operations. | `CLERUM_WORKSPACE_PATH=/workspace` |
| `CLERUM_SHELL_TIMEOUT` | Maximum execution time in milliseconds for shell native-tool commands. | `CLERUM_SHELL_TIMEOUT=1500000` |
| `CLERUM_TOOL_TIMEOUT` | Maximum execution time in milliseconds for native tool wrapper calls. This is separate from the MCP SDK request timeout controlled by `CLERUM_MCP_TOOL_TIMEOUT_MS`. | `CLERUM_TOOL_TIMEOUT=1500000` |
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 31e677e92..7920f127f 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.369",
+ "version": "0.1.370",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.369",
+ "version": "0.1.370",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index 826596dc8..fbb6fd5d6 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.369",
+ "version": "0.1.370",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/config.ts b/mcp-host/src/config.ts
index 2f66223df..19febf52a 100644
--- a/mcp-host/src/config.ts
+++ b/mcp-host/src/config.ts
@@ -146,7 +146,7 @@ export interface Config {
compactionIneffectiveMaxRun: number
// T1.2 — Pre-pruning before the LLM call. `compactionPrePruneEnabled` is
- // the master flag (default false during rollout); the four per-pass toggles
+ // the master flag (default true since #731); the four per-pass toggles
// exist for granular rollback.
compactionPrePruneEnabled: boolean
compactionPrePruneDedup: boolean
@@ -812,11 +812,14 @@ export const config: Config = {
compactionIneffectiveRatio: parseFloat(getEnv('CLERUM_COMPACTION_INEFFECTIVE_RATIO', '0.9')!),
compactionIneffectiveMaxRun: parseInt(getEnv('CLERUM_COMPACTION_INEFFECTIVE_MAX_RUN', '2')!, 10),
- // T1.2 — Pre-pruning. Master flag defaults OFF; flipped per-Host once
- // staging metrics confirm the savings ratio. Per-pass toggles default ON so
- // operators can flip them all at once with the master. See
+ // T1.2 — Pre-pruning. Master flag defaults ON since #731 (2026-09-22): the
+ // rollout it was waiting on never happened, and no manifest in the repo sets
+ // the variable, so the code default is what every Host actually runs.
+ // `CLERUM_COMPACTION_PRE_PRUNE=false` remains the kill switch, and the
+ // per-pass toggles below still default ON so operators can flip them all at
+ // once with the master. See
// `.specs/mcp-hermes/implementation-plans/T1.2-pre-pruning.md` §9.
- compactionPrePruneEnabled: getEnvBool('CLERUM_COMPACTION_PRE_PRUNE', false),
+ compactionPrePruneEnabled: getEnvBool('CLERUM_COMPACTION_PRE_PRUNE', true),
compactionPrePruneDedup: getEnvBool('CLERUM_COMPACTION_PRE_PRUNE_DEDUP', true),
compactionPrePruneOneLine: getEnvBool('CLERUM_COMPACTION_PRE_PRUNE_ONE_LINE', true),
compactionPrePruneJsonTruncate: getEnvBool('CLERUM_COMPACTION_PRE_PRUNE_JSON_TRUNC', true),