From e68e28ddf31c2f61121d38fb321f57796cc6cfd6 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Fri, 5 Sep 2025 17:02:45 +0100 Subject: [PATCH] fix(agent-task/shared): add `SessionSymbol` func Signed-off-by: Babak K. Shandiz --- pkg/cmd/agent-task/shared/display.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/cmd/agent-task/shared/display.go b/pkg/cmd/agent-task/shared/display.go index dd114b049..54004c9ad 100644 --- a/pkg/cmd/agent-task/shared/display.go +++ b/pkg/cmd/agent-task/shared/display.go @@ -46,3 +46,17 @@ func SessionStateString(state string) string { return state } } + +type ColorFunc func(string) string + +func SessionSymbol(cs *iostreams.ColorScheme, state string) string { + noColor := func(s string) string { return s } + switch state { + case "completed": + return cs.SuccessIconWithColor(noColor) + case "failed", "timed_out", "cancelled": + return cs.FailureIconWithColor(noColor) + default: + return "-" + } +}