Merge pull request #206 from pikasTech/fix/203-tool-started-status
[OTel] 归一化 codex inProgress 工具 span 为 started
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user