From 084657868fff96d207789d88c1a212833d0b51b6 Mon Sep 17 00:00:00 2001 From: Jiayuan Zhang Date: Sun, 15 Feb 2026 20:43:37 +0800 Subject: [PATCH] revert(agent): remove parallel tool execution patch, keep serial Co-Authored-By: Claude Opus 4.6 --- package.json | 3 --- packages/core/src/agent/runner.ts | 8 +++----- pnpm-lock.yaml | 15 +++++---------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index d39e6145..80b868f4 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,6 @@ "overrides": { "@types/react": "catalog:", "@types/react-dom": "catalog:" - }, - "patchedDependencies": { - "@mariozechner/pi-agent-core@0.52.9": "patches/@mariozechner__pi-agent-core@0.52.9.patch" } }, "devDependencies": { diff --git a/packages/core/src/agent/runner.ts b/packages/core/src/agent/runner.ts index 48bc355d..da3112a1 100644 --- a/packages/core/src/agent/runner.ts +++ b/packages/core/src/agent/runner.ts @@ -783,19 +783,17 @@ export class Agent { private handleRunLogEvent(event: AgentEvent) { if (event.type === "tool_execution_start") { - const toolCallId = (event as any).toolCallId ?? "unknown"; const toolName = (event as any).toolName ?? "unknown"; - this.toolStartTimes.set(toolCallId, Date.now()); + this.toolStartTimes.set(toolName, Date.now()); this.runLog.log("tool_start", { tool: toolName, args: JSON.stringify((event as any).args ?? {}).slice(0, 500), }); } else if (event.type === "tool_execution_end") { - const toolCallId = (event as any).toolCallId ?? "unknown"; const toolName = (event as any).toolName ?? "unknown"; - const startTime = this.toolStartTimes.get(toolCallId); + const startTime = this.toolStartTimes.get(toolName); const duration_ms = startTime ? Date.now() - startTime : undefined; - this.toolStartTimes.delete(toolCallId); + this.toolStartTimes.delete(toolName); // Extract result metadata for run-log persistence (survives session compaction) const result = (event as any).result; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18c13e8b..cc765ee9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,18 +68,13 @@ overrides: '@types/react': ^19.2.0 '@types/react-dom': ^19.2.0 -patchedDependencies: - '@mariozechner/pi-agent-core@0.52.9': - hash: befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00 - path: patches/@mariozechner__pi-agent-core@0.52.9.patch - importers: .: dependencies: '@mariozechner/pi-agent-core': specifier: 'catalog:' - version: 0.52.9(patch_hash=befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00)(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) + version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-ai': specifier: 'catalog:' version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) @@ -596,7 +591,7 @@ importers: dependencies: '@mariozechner/pi-agent-core': specifier: 'catalog:' - version: 0.52.9(patch_hash=befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00)(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) + version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-ai': specifier: 'catalog:' version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) @@ -695,7 +690,7 @@ importers: devDependencies: '@mariozechner/pi-agent-core': specifier: 'catalog:' - version: 0.52.9(patch_hash=befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00)(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) + version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-ai': specifier: 'catalog:' version: 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) @@ -12503,7 +12498,7 @@ snapshots: std-env: 3.10.0 yoctocolors: 2.1.2 - '@mariozechner/pi-agent-core@0.52.9(patch_hash=befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00)(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6)': + '@mariozechner/pi-agent-core@0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6)': dependencies: '@mariozechner/pi-ai': 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) transitivePeerDependencies: @@ -12542,7 +12537,7 @@ snapshots: '@mariozechner/pi-coding-agent@0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6)': dependencies: '@mariozechner/jiti': 2.6.5 - '@mariozechner/pi-agent-core': 0.52.9(patch_hash=befbe3b9fd1a6d3e13dfa4927d9f0addd2f3b3454bd9d407c16dacb9a71c0f00)(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-agent-core': 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-ai': 0.52.9(@modelcontextprotocol/sdk@1.26.0(zod@4.3.6))(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-tui': 0.52.9 '@silvia-odwyer/photon-node': 0.3.4