Skip to content

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

TypeScript

test(codex): cover exact discovery bounds and execution witness

Alfredo Lopez47a1379d537f
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 006383322..6849e34da 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.326",
+ "version": "0.1.327",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.326",
+ "version": "0.1.327",
"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 0516d30c4..597b71568 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.326",
+ "version": "0.1.327",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/core/orchestration/__tests__/approvedToolsLifecycle.integration.test.ts b/mcp-host/src/core/orchestration/__tests__/approvedToolsLifecycle.integration.test.ts
index 87d3e5aa4..a8983fb9f 100644
--- a/mcp-host/src/core/orchestration/__tests__/approvedToolsLifecycle.integration.test.ts
+++ b/mcp-host/src/core/orchestration/__tests__/approvedToolsLifecycle.integration.test.ts
@@ -262,6 +262,11 @@ describe('approved catalog across presentation and lifecycle', () => {
const name = 'alpha__record__read_082'
const initial = await registry.get('clerum__tool_describe')!.execute({ name })
expect(initial.content).not.toContain('recordId')
+ const witness = await executeToolCalls([bridgeCall(name, 'before-schema-change')], config, 0)
+ expect(witness.toolResults[0].is_error).toBe(false)
+ expect(witness.toolResults[0].content).toContain('receipt:alpha:record__read_082')
+ expect(remote.calls).toHaveBeenCalledTimes(1)
+ remote.calls.mockClear()
const updated = remote.catalogs.get('alpha')!.map(tool =>
tool.name === 'record__read_082'
? {
diff --git a/mcp-host/src/core/orchestration/__tests__/deferrableToolController.test.ts b/mcp-host/src/core/orchestration/__tests__/deferrableToolController.test.ts
index b7e549074..5e977de42 100644
--- a/mcp-host/src/core/orchestration/__tests__/deferrableToolController.test.ts
+++ b/mcp-host/src/core/orchestration/__tests__/deferrableToolController.test.ts
@@ -237,6 +237,20 @@ describe('Codex presentation without access limits', () => {
}
)
+ it.each([60, 61])('auto changes strategy only above the count threshold: %i', async count => {
+ const all = [...native, ...mcpTools(count)]
+ const result = await controller('auto', makeLatch(), 1_000_000).refreshTools(all)
+ expect(result).toEqual(count === 60 ? all : native)
+ })
+
+ it('auto changes strategy only above the exact UTF-8 byte threshold', async () => {
+ const deferred = [{ ...tool('server__read'), description: 'Información' }]
+ const bytes = Buffer.byteLength(JSON.stringify(deferred), 'utf8')
+ const all = [...native, ...deferred]
+ expect(await controller('auto', makeLatch(), bytes).refreshTools(all)).toEqual(all)
+ expect(await controller('auto', makeLatch(), bytes - 1).refreshTools(all)).toEqual(native)
+ })
+
it('auto detects late connections and ignores a legacy false latch', async () => {
const latch = makeLatch()
latch.set(false)