From 92e25df271bae4b8d2d3a5bace4963c4fb2befd8 Mon Sep 17 00:00:00 2001 From: mushuiyu886 Date: Tue, 7 Jul 2026 14:31:13 +0800 Subject: [PATCH] fix(agents): avoid repeated item progress snapshots (#101042) * fix(agents): avoid repeated item progress snapshots * chore: align ACP branch with current main * fix(agents): deduplicate ACP parent progress * chore: keep release notes in PR context --------- Co-authored-by: Peter Steinberger Co-authored-by: Peter Steinberger --- src/agents/acp-spawn-parent-stream.test.ts | 4 ++-- src/agents/acp-spawn-parent-stream.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/agents/acp-spawn-parent-stream.test.ts b/src/agents/acp-spawn-parent-stream.test.ts index 62581a275abf..89d1c283232c 100644 --- a/src/agents/acp-spawn-parent-stream.test.ts +++ b/src/agents/acp-spawn-parent-stream.test.ts @@ -756,7 +756,7 @@ describe("startAcpSpawnParentStreamRelay", () => { relay.dispose(); }); - it("emits full preamble item progress after the previous snapshot flushed", () => { + it("omits already flushed preamble item progress from later prefix snapshots", () => { const relay = startAcpSpawnParentStreamRelay({ runId: "run-preamble-item-after-flush", parentSessionKey: "agent:main:main", @@ -790,7 +790,7 @@ describe("startAcpSpawnParentStreamRelay", () => { }); vi.advanceTimersByTime(15); - expect(collectedTexts()).toEqual(["codex: Checking", "codex: Checking the app-server stream"]); + expect(collectedTexts()).toEqual(["codex: Checking", "codex: the app-server stream"]); relay.dispose(); }); diff --git a/src/agents/acp-spawn-parent-stream.ts b/src/agents/acp-spawn-parent-stream.ts index 6595c70aea4d..5ce844f50a13 100644 --- a/src/agents/acp-spawn-parent-stream.ts +++ b/src/agents/acp-spawn-parent-stream.ts @@ -534,8 +534,7 @@ export function startAcpSpawnParentStreamRelay(params: { pendingText = ""; } itemProgressTextById.set(snapshot.itemId, snapshot.text); - const delta = - isPrefixUpdate && hasPendingSnapshot ? snapshot.text.slice(previous.length) : snapshot.text; + const delta = isPrefixUpdate ? snapshot.text.slice(previous.length) : snapshot.text; appendVisibleProgress(delta, kind); };