Skip to content

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

TypeScript

refactor(host): drop the dead attachment read ledger reset

Alfredo Lopezf534120b0283
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 173cbea9d..c06fc7ee3 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.507",
+ "version": "0.1.508",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.507",
+ "version": "0.1.508",
"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 b6b73c3b7..bbaf43977 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.507",
+ "version": "0.1.508",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/agent/taskExecutor.ts b/mcp-host/src/agent/taskExecutor.ts
index ac31c6456..8b846fc90 100644
--- a/mcp-host/src/agent/taskExecutor.ts
+++ b/mcp-host/src/agent/taskExecutor.ts
@@ -316,11 +316,12 @@ export class TaskExecutor {
/** #731 — the task's context window, resolved and logged once. */
private contextWindow: number | null = null
/**
- * C15/C16 — one turn-owned attachment read ledger per executor. The native
- * tool registry is memoized for the life of this executor, so the tool holds
- * THIS instance by reference and the ledger mutates in place: `reset()` only
- * after a successful `startTurn`, `restore()` on an approval resume that
- * continues the same turn.
+ * C15/C16 — one turn-owned attachment read ledger per executor. An executor
+ * runs one task, and a task is one turn, so the ledger starts zeroed and is
+ * never reset. The native tool registry is memoized for the life of this
+ * executor, so the tool holds THIS instance by reference and the ledger
+ * mutates in place; `restore()` loads the persisted snapshot on an approval
+ * resume that continues the same turn.
*/
private readonly attachmentReadLedger = new AttachmentReadLedger()
/**
@@ -524,10 +525,6 @@ export class TaskExecutor {
this.task.traceContext ?? null,
autoTitle
)
- // C15/C16 — a fresh turn starts with a zeroed attachment read ledger. The
- // reset runs only after `startTurn` resolved: a rejected write throws
- // above and must not hand the retried turn a fresh budget.
- this.attachmentReadLedger.reset()
this.turnTiming?.addSessionLoadMs(Date.now() - sessionLoadStart)
// P2 token budgets (§5.2) — capture the per-task brake baseline NOW, before