From b557016473a28d34f995cd651c4524dffb967df1 Mon Sep 17 00:00:00 2001 From: lyon Date: Sat, 20 Jun 2026 15:52:58 +0800 Subject: [PATCH] fix: normalize codex tool in-progress spans --- src/backend/codex-stdio.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/codex-stdio.ts b/src/backend/codex-stdio.ts index 11e2a21..8f4eca0 100644 --- a/src/backend/codex-stdio.ts +++ b/src/backend/codex-stdio.ts @@ -1120,7 +1120,10 @@ function toolCallPayload(method: string, item: JsonRecord): JsonRecord { } function toolCallStatus(method: string, item: JsonRecord): string | null { - if (typeof item.status === "string" && item.status.trim().length > 0) return item.status; + const status = typeof item.status === "string" ? item.status.trim().toLowerCase() : ""; + if (status === "inprogress" || status === "in_progress" || status === "running" || status === "pending") return "started"; + if (status === "completed" || status === "succeeded" || status === "success") return "completed"; + if (status === "failed" || status === "error" || status === "cancelled" || status === "canceled") return "failed"; if (method === "item/started") return "started"; if (method === "item/completed") return "completed"; return null;