fix: terminalize Codex compaction on turn end (#3211)

* fix: terminalize Codex compaction on turn end

* fix: ignore stale Codex compaction completions

---------

Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
Edi Hasaj
2026-08-11 19:02:17 +02:00
committed by GitHub
co-authored by Mohamed Boudra
parent a39959219f
commit f24664b882
5 changed files with 237 additions and 4 deletions
+9 -1
View File
@@ -1055,7 +1055,7 @@ describe("stream reducer canonical tool calls", () => {
]);
});
it("preserves compaction trigger when completed update replaces loading marker", () => {
it("terminalizes the loading compaction before a completed turn", () => {
const state = hydrateStreamState([
{
event: compactionTimeline("loading", "auto"),
@@ -1065,6 +1065,10 @@ describe("stream reducer canonical tool calls", () => {
event: compactionTimeline("completed"),
timestamp: new Date("2025-01-01T10:50:01Z"),
},
{
event: { type: "turn_completed", provider: "codex" },
timestamp: new Date("2025-01-01T10:50:02Z"),
},
]);
const compactions = state.filter(
@@ -1074,6 +1078,10 @@ describe("stream reducer canonical tool calls", () => {
assert.strictEqual(compactions.length, 1);
assert.strictEqual(compactions[0].status, "completed");
assert.strictEqual(compactions[0].trigger, "auto");
assert.strictEqual(
state.some((item) => item.kind === "compaction" && item.status === "loading"),
false,
);
});
it("renders Claude TodoWrite as todo_list and suppresses tool call badge", () => {