Skip to content

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

TypeScript

fix(mcp-host): remove dead usageEmitted store in connect-suspend branch (codeql #1213)

Diego Zacariascda3f56aa569
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index f2fa74fc4..79c2c67d1 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.302",
+ "version": "0.1.303",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.302",
+ "version": "0.1.303",
"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 986372386..5384b9af6 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.302",
+ "version": "0.1.303",
"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/toolUseLoopToolBatch.ts b/mcp-host/src/core/orchestration/toolUseLoopToolBatch.ts
index bba81bb71..c85cedad5 100644
--- a/mcp-host/src/core/orchestration/toolUseLoopToolBatch.ts
+++ b/mcp-host/src/core/orchestration/toolUseLoopToolBatch.ts
@@ -444,7 +444,9 @@ export async function executeToolCalls(
calls.length,
usageEmitted ? undefined : usage
)
- usageEmitted = true
+ // NOTE: no `usageEmitted = true` here — this branch returns immediately
+ // below (pendingApproval), so the write would be dead. `usage` was already
+ // consumed by the reportToolComplete call above.
const approval = buildConnectRequiredApproval(call, connectMarker)
approval.intent_summary =
extractToolIntent(llmTextContent ?? null, call.name) ??