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 <steipete@gmail.com>
Co-authored-by: Peter Steinberger <peter@steipete.me>
This commit is contained in:
mushuiyu886
2026-07-07 14:31:13 +08:00
committed by GitHub
parent 33163d4273
commit 92e25df271
2 changed files with 3 additions and 4 deletions

View File

@@ -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();
});

View File

@@ -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);
};