File tree Expand file tree Collapse file tree
src/uipath/_cli/_dev/_terminal/_components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,13 +73,33 @@ def clear_runs(self):
7373 self .refresh_list ()
7474
7575 def _refresh_running_items (self ) -> None :
76+ """Refresh display names for running items only."""
7677 if not any (run .status == "running" for run in self .runs ):
77- return None # No running items, skip update
78+ return None
7879
79- run_list = self .query_one ("#run-list" , ListView )
80+ try :
81+ run_list = self .query_one ("#run-list" , ListView )
82+ except Exception :
83+ return None
84+
85+ # Take a snapshot of items to avoid mid-iteration changes
86+ items_snapshot = list (run_list .children )
87+
88+ for item in items_snapshot :
89+ if not hasattr (item , "run_id" ):
90+ continue
8091
81- for item in run_list .children :
8292 run = self .get_run_by_id (item .run_id ) # type: ignore[attr-defined]
83- if run and run .status == "running" :
93+ if not run or run .status != "running" :
94+ continue
95+
96+ # Check if item still exists in the list (wasn't removed)
97+ if item not in run_list .children :
98+ continue
99+
100+ try :
84101 static = item .query_one (Static )
85102 static .update (run .display_name )
103+ except Exception :
104+ # Item structure changed or was removed
105+ continue
You can’t perform that action at this time.
0 commit comments