feat(mma): add worker status tracking (_worker_status dict)
This commit is contained in:
@@ -137,6 +137,7 @@ class AppController:
|
|||||||
self.active_track: Optional[models.Track] = None
|
self.active_track: Optional[models.Track] = None
|
||||||
self.active_tickets: List[Dict[str, Any]] = []
|
self.active_tickets: List[Dict[str, Any]] = []
|
||||||
self.mma_streams: Dict[str, str] = {}
|
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_text: Optional[str] = None
|
||||||
self._pending_patch_files: List[str] = []
|
self._pending_patch_files: List[str] = []
|
||||||
self._show_patch_modal: bool = False
|
self._show_patch_modal: bool = False
|
||||||
@@ -293,6 +294,7 @@ class AppController:
|
|||||||
'_track_discussion_active': '_track_discussion_active',
|
'_track_discussion_active': '_track_discussion_active',
|
||||||
'proposed_tracks': 'proposed_tracks',
|
'proposed_tracks': 'proposed_tracks',
|
||||||
'mma_streams': 'mma_streams',
|
'mma_streams': 'mma_streams',
|
||||||
|
'_worker_status': '_worker_status',
|
||||||
'active_track': 'active_track',
|
'active_track': 'active_track',
|
||||||
'active_tickets': 'active_tickets',
|
'active_tickets': 'active_tickets',
|
||||||
'tracks': 'tracks',
|
'tracks': 'tracks',
|
||||||
@@ -397,9 +399,12 @@ class AppController:
|
|||||||
if stream_id:
|
if stream_id:
|
||||||
if is_streaming:
|
if is_streaming:
|
||||||
if stream_id not in self.mma_streams: self.mma_streams[stream_id] = ""
|
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
|
self.mma_streams[stream_id] += text
|
||||||
else:
|
else:
|
||||||
self.mma_streams[stream_id] = text
|
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 stream_id == "Tier 1":
|
||||||
if "status" in payload:
|
if "status" in payload:
|
||||||
self.ai_status = payload["status"]
|
self.ai_status = payload["status"]
|
||||||
@@ -1151,6 +1156,7 @@ class AppController:
|
|||||||
"mma_status": self.mma_status,
|
"mma_status": self.mma_status,
|
||||||
"ai_status": self.ai_status,
|
"ai_status": self.ai_status,
|
||||||
"mma_streams": self.mma_streams,
|
"mma_streams": self.mma_streams,
|
||||||
|
"worker_status": self._worker_status,
|
||||||
"active_tier": self.active_tier,
|
"active_tier": self.active_tier,
|
||||||
"active_tickets": self.active_tickets,
|
"active_tickets": self.active_tickets,
|
||||||
"proposed_tracks": self.proposed_tracks
|
"proposed_tracks": self.proposed_tracks
|
||||||
|
|||||||
Reference in New Issue
Block a user