diff --git a/src/app_controller.py b/src/app_controller.py index 5694a67..61b8dde 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -137,6 +137,7 @@ class AppController: self.active_track: Optional[models.Track] = None self.active_tickets: List[Dict[str, Any]] = [] self.mma_streams: Dict[str, str] = {} + self._worker_status: Dict[str, str] = {} # stream_id -> "running" | "completed" | "failed" | "killed" self._pending_patch_text: Optional[str] = None self._pending_patch_files: List[str] = [] self._show_patch_modal: bool = False @@ -293,6 +294,7 @@ class AppController: '_track_discussion_active': '_track_discussion_active', 'proposed_tracks': 'proposed_tracks', 'mma_streams': 'mma_streams', + '_worker_status': '_worker_status', 'active_track': 'active_track', 'active_tickets': 'active_tickets', 'tracks': 'tracks', @@ -397,9 +399,12 @@ class AppController: if stream_id: if is_streaming: if stream_id not in self.mma_streams: self.mma_streams[stream_id] = "" + if stream_id not in self._worker_status: self._worker_status[stream_id] = "running" self.mma_streams[stream_id] += text else: self.mma_streams[stream_id] = text + if stream_id in self._worker_status and self._worker_status[stream_id] == "running": + self._worker_status[stream_id] = "completed" if stream_id == "Tier 1": if "status" in payload: self.ai_status = payload["status"] @@ -1151,6 +1156,7 @@ class AppController: "mma_status": self.mma_status, "ai_status": self.ai_status, "mma_streams": self.mma_streams, + "worker_status": self._worker_status, "active_tier": self.active_tier, "active_tickets": self.active_tickets, "proposed_tracks": self.proposed_tracks