Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(mcp-host): size J1's context window so it detects a word-count regression (#731)
Alfredo Lopezb0a78e114ab3
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 08edaafaf..0c86f97a4 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.403",+ "version": "0.1.404","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.403",+ "version": "0.1.404","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex 4f32a9e72..a7d89d34e 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.403",+ "version": "0.1.404","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/llm/__tests__/contextOverrunJourney.test.ts b/mcp-host/src/llm/__tests__/contextOverrunJourney.test.tsindex 1b7ecdc62..0474716d8 100644--- a/mcp-host/src/llm/__tests__/contextOverrunJourney.test.ts+++ b/mcp-host/src/llm/__tests__/contextOverrunJourney.test.ts@@ -133,6 +133,13 @@ function unshrinkableHistory(finalResultBytes: number): ChatMessage[] {*/const J1_RESULT_BYTES = 35_000const J1_TURNS = Math.ceil((LIMITS.maxRequestBodyBytes * 1.1) / J1_RESULT_BYTES)+/**+ * J1's window sits between the two estimates of that history: the byte-based+ * count fills it about 2.3 times, the word-based count #731 replaced about 0.55+ * times. With a 100K window both overrun it and pre-prune runs either way, so+ * J1 could not tell a regressed tokenizer from the fixed one.+ */+const J1_CONTEXT_WINDOW_TOKENS = 1_000_000function mcpHeavyHistory(turns: number, bytesPerResult: number): ChatMessage[] {const msgs: ChatMessage[] = [{ role: 'system', content: 'You are a helpful assistant.' }]@@ -175,18 +182,24 @@ describe('#731 context-overrun journey', () => {// Built the way `taskExecutor` builds it: pre-prune on or off, and its// options, come from the deployed configuration.- const manager = new PressureContextManager(100000, undefined, undefined, undefined, {- prePruneEnabled: appConfig.compactionPrePruneEnabled,- prePruneOptions: {- protectedTailTurns: appConfig.compactionPrePruneProtectedTailTurns,- summaryThresholdTokens: appConfig.compactionPrePruneSummaryTokens,- maxArgsBytes: appConfig.compactionPrePruneMaxArgsBytes,- dedupEnabled: appConfig.compactionPrePruneDedup,- oneLineSummariesEnabled: appConfig.compactionPrePruneOneLine,- jsonSafeTruncateEnabled: appConfig.compactionPrePruneJsonTruncate,- stripMediaEnabled: appConfig.compactionPrePruneStripMedia,- },- })+ const manager = new PressureContextManager(+ J1_CONTEXT_WINDOW_TOKENS,+ undefined,+ undefined,+ undefined,+ {+ prePruneEnabled: appConfig.compactionPrePruneEnabled,+ prePruneOptions: {+ protectedTailTurns: appConfig.compactionPrePruneProtectedTailTurns,+ summaryThresholdTokens: appConfig.compactionPrePruneSummaryTokens,+ maxArgsBytes: appConfig.compactionPrePruneMaxArgsBytes,+ dedupEnabled: appConfig.compactionPrePruneDedup,+ oneLineSummariesEnabled: appConfig.compactionPrePruneOneLine,+ jsonSafeTruncateEnabled: appConfig.compactionPrePruneJsonTruncate,+ stripMediaEnabled: appConfig.compactionPrePruneStripMedia,+ },+ }+ )const wired = deps()const provider = new CodexSubscriptionProvider('gpt-5.3-codex', wired as never)