Skip to content

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

TypeScript

fix(mcp-host): reject a malformed CLERUM_CONTEXT_MAX_TOKENS at load (#739)

Alfredo Lopez15f37d130bb0
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index f71610145..1fafbca65 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.423",
+ "version": "0.1.424",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.423",
+ "version": "0.1.424",
"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 09dc463d7..f738305ba 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.423",
+ "version": "0.1.424",
"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 19febf52a..6b7a07e74 100644
--- a/mcp-host/src/config.ts
+++ b/mcp-host/src/config.ts
@@ -782,7 +782,11 @@ export const config: Config = {
// snapshot is gone. The user clicked Approve in time — the underlying
// data simply no longer exists. T1.5 will add CLERUM_SPILLOVER_TTL_HOURS
// to govern that lifetime.
- contextMaxTokens: parseInt(getEnv('CLERUM_CONTEXT_MAX_TOKENS', '100000')!, 10),
+ //
+ // The budget divides every pressure ratio: a NaN or 0 would make every
+ // threshold check meaningless, so anything but a positive integer stops
+ // the Host here (R9-15).
+ contextMaxTokens: getExecutionLimit('CLERUM_CONTEXT_MAX_TOKENS', 100000),
// P.2 — Tokenizer dry-run. When true (default during the bake-week), the
// PressureContextManager computes both the heuristic and the real counter