context.running to identify chat process

frdel committed Jan 30, 2026 at 09:54 UTC 1581d7d12f7d00d258f8f27569152c5b85f5f62c
5 files changed +11 -2
agent.py
+4
@@ -187,6 +187,7 @@ class AgentContext:
187 else Localization.get().serialize_datetime(datetime.fromtimestamp(0))
188 ),
189 "type": self.type.value,
190 + "running": self.is_running(),
191 **self.output_data,
192 }
193
@@ -230,6 +231,9 @@ class AgentContext:
231 def get_agent(self):
232 return self.streaming_agent or self.agent0
233
234 + def is_running(self):
235 + return self.task and self.task.is_alive()
236 +
237 def communicate(self, msg: "UserMessage", broadcast_level: int = 1):
238 self.paused = False # unpause if paused
239
python/api/poll.py
+1
@@ -123,4 +123,5 @@ class Poll(ApiHandler):
123 "notifications_guid": notification_manager.guid,
124 "notifications_version": len(notification_manager.updates),
125 "message_queue": context.output_data.get("message_queue", []) if context else [],
126 + "running": context.is_running() if context else False,
127 }
webui/components/sidebar/chats/chats-list.html
+1 -1
@@ -26,7 +26,7 @@
26 <div :class="{'chat-container': true, 'chat-selected': context.id === $store.chats.selected}"
27 @click="$store.chats.selectChat(context.id)">
28 <div class="chat-list-button">
29 - <span class="project-color-ball"
29 + <span :class="{'project-color-ball': true, 'heartbeat': context.running}"
30 :style="context.project?.color ? { backgroundColor: context.project.color } : { border: '1px solid var(--color-border)' }"></span>
31 <span class="chat-name"
32 x-text="context.name ? context.name : 'Chat #' + context.no"></span>
webui/components/sidebar/tasks/tasks-list.html
+1 -1
@@ -28,7 +28,7 @@
28 <div class="chat-list-button" @click="$store.tasks.selectTask(task.id)">
29 <div class="task-container-vertical">
30 <div class="task-title-line">
31 - <span class="project-color-ball" :style="task.project?.color ? { backgroundColor: task.project.color } : { border: '1px solid var(--color-border)' }"></span>
31 + <span :class="{'project-color-ball': true, 'heartbeat': task.running}" :style="task.project?.color ? { backgroundColor: task.project.color } : { border: '1px solid var(--color-border)' }"></span>
32 <span class="task-name"
33 x-text="(task.task_name || `Task #${task.no}`)"
34 :data-task-id="task.id"></span>
webui/index.css
+4
@@ -993,6 +993,10 @@ input:checked + .slider:before {
993 color: #e40138;
994 }
995
996 +.heartbeat {
997 + animation: heartbeat 1.5s ease-in-out infinite;
998 +}
999 +
1000 .font-bold {
1001 font-weight: bold;
1002 }