From c6623c2018485e5dd876d6adcd9c91921b671787 Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Khanh Ha <151600257+ngthkhanhha@users.noreply.github.com> Date: Tue, 23 Jun 2026 23:54:49 +0700 Subject: [PATCH] fix(cli): prepend task_id in ray list tasks output Signed-off-by: Nguyen Thanh Khanh Ha <151600257+ngthkhanhha@users.noreply.github.com> --- python/ray/util/state/state_cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/ray/util/state/state_cli.py b/python/ray/util/state/state_cli.py index 658d841ed17c..b76658775976 100644 --- a/python/ray/util/state/state_cli.py +++ b/python/ray/util/state/state_cli.py @@ -192,6 +192,13 @@ class A(StateSchema): for col in cols: if col in keys: headers.append(col.upper()) + + # --- Fix UX Issue #30805: Prepend TASK_ID --- + if "TASK_ID" in headers: + headers.remove("TASK_ID") + headers.insert(0, "TASK_ID") + # --------------------------------------------- + table.append([data[header.lower()] for header in headers]) return f""" {header}