chore(conductor): Mark track 'Fix Concurrent MMA Live GUI Tests' as complete
Fixes UI flickering between tracks in app_controller.py and an indentation bug in multi_agent_conductor.py that caused workers to crash silently.
This commit is contained in:
+1
-1
@@ -165,7 +165,7 @@ This file tracks all major tracks for the project. Each track has its own detail
|
||||
|
||||
### Testing & Quality
|
||||
|
||||
1. [~] **Track: Fix Concurrent MMA Live GUI Tests**
|
||||
1. [x] **Track: Fix Concurrent MMA Live GUI Tests**
|
||||
*Link: [./tracks/fix_concurrent_mma_tests_20260507/](./tracks/fix_concurrent_mma_tests_20260507/)*
|
||||
*Goal: Fix timeout issues in concurrent MMA track execution tests (test_mma_concurrent_tracks_sim.py, test_mma_concurrent_tracks_stress_sim.py, test_visual_sim_mma_v2.py). Workers run correctly but tests timeout due to infrastructure issues.*
|
||||
|
||||
|
||||
+30
-12
@@ -280,11 +280,11 @@ class AppController:
|
||||
self.mma_step_mode: bool = False
|
||||
self.active_tier: Optional[str] = None
|
||||
self.ui_focus_agent: Optional[str] = None
|
||||
self._pending_mma_approval: Optional[Dict[str, Any]] = None
|
||||
self._pending_mma_approvals: List[Dict[str, Any]] = []
|
||||
self._mma_approval_open: bool = False
|
||||
self._mma_approval_edit_mode: bool = False
|
||||
self._mma_approval_payload: str = ""
|
||||
self._pending_mma_spawn: Optional[Dict[str, Any]] = None
|
||||
self._pending_mma_spawns: List[Dict[str, Any]] = []
|
||||
self._mma_spawn_open: bool = False
|
||||
self._mma_spawn_edit_mode: bool = False
|
||||
self._mma_spawn_prompt: str = ''
|
||||
@@ -802,6 +802,12 @@ class AppController:
|
||||
sys.stderr.write(f"[DEBUG] mma_state_update: status={p.get('status')} active_tier={p.get('active_tier')}\n")
|
||||
sys.stderr.flush()
|
||||
|
||||
track_data = p.get("track")
|
||||
is_active_track = False
|
||||
if track_data and self.active_track and track_data.get("id") == self.active_track.id:
|
||||
is_active_track = True
|
||||
|
||||
if is_active_track or not self.active_track:
|
||||
self.mma_status = p.get("status", self.mma_status)
|
||||
|
||||
old_tier = self.active_tier
|
||||
@@ -827,8 +833,8 @@ class AppController:
|
||||
else:
|
||||
self.mma_tier_usage[tier] = data
|
||||
|
||||
if is_active_track or not self.active_track:
|
||||
self.active_tickets = p.get("tickets", [])
|
||||
track_data = p.get("track")
|
||||
if track_data:
|
||||
tickets = []
|
||||
for t_data in self.active_tickets:
|
||||
@@ -898,8 +904,14 @@ class AppController:
|
||||
elif cb in self._predefined_callbacks:
|
||||
self._predefined_callbacks[cb](*args)
|
||||
elif action == "mma_step_approval":
|
||||
if self.test_hooks_enabled and not getattr(self, "ui_manual_approve", False):
|
||||
if "dialog_container" in task:
|
||||
class AutoStepDialog:
|
||||
def wait(self): return True, task.get("payload", "")
|
||||
task["dialog_container"][0] = AutoStepDialog()
|
||||
continue
|
||||
dlg = MMAApprovalDialog(str(task.get("ticket_id") or ""), str(task.get("payload") or ""))
|
||||
self._pending_mma_approval = task
|
||||
self._pending_mma_approvals.append(task)
|
||||
if "dialog_container" in task:
|
||||
task["dialog_container"][0] = dlg
|
||||
elif action == 'refresh_from_project':
|
||||
@@ -913,13 +925,19 @@ class AppController:
|
||||
self._pending_patch_text = None
|
||||
self._pending_patch_files = []
|
||||
elif action == "mma_spawn_approval":
|
||||
if self.test_hooks_enabled and not getattr(self, "ui_manual_approve", False):
|
||||
if "dialog_container" in task:
|
||||
class AutoSpawnDialog:
|
||||
def wait(self): return {'approved': True, 'abort': False, 'prompt': task.get("prompt"), 'context_md': task.get("context_md")}
|
||||
task["dialog_container"][0] = AutoSpawnDialog()
|
||||
continue
|
||||
spawn_dlg = MMASpawnApprovalDialog(
|
||||
str(task.get("ticket_id") or ""),
|
||||
str(task.get("role") or ""),
|
||||
str(task.get("prompt") or ""),
|
||||
str(task.get("context_md") or "")
|
||||
)
|
||||
self._pending_mma_spawn = task
|
||||
self._pending_mma_spawns.append(task)
|
||||
self._mma_spawn_prompt = task.get("prompt", "")
|
||||
self._mma_spawn_context = task.get("context_md", "")
|
||||
self._mma_spawn_open = True
|
||||
@@ -1519,7 +1537,7 @@ class AppController:
|
||||
else:
|
||||
ai_client._gemini_cli_adapter.binary_path = self.ui_gemini_cli_path
|
||||
ai_client.confirm_and_run_callback = self._confirm_and_run
|
||||
ai_client.comms_log_callback = self._on_comms_entry
|
||||
ai_client.set_comms_log_callback(self._on_comms_entry)
|
||||
ai_client.tool_log_callback = self._on_tool_log
|
||||
mcp_client.perf_monitor_callback = self.perf_monitor.get_metrics
|
||||
self.perf_monitor.alert_callback = self._on_performance_alert
|
||||
@@ -2490,8 +2508,9 @@ class AppController:
|
||||
self._switch_discussion(remaining[0])
|
||||
|
||||
def _handle_mma_respond(self, approved: bool, payload: str | None = None, abort: bool = False, prompt: str | None = None, context_md: str | None = None) -> None:
|
||||
if self._pending_mma_approval:
|
||||
dlg = self._pending_mma_approval.get("dialog_container", [None])[0]
|
||||
if self._pending_mma_approvals:
|
||||
task = self._pending_mma_approvals.pop(0)
|
||||
dlg = task.get("dialog_container", [None])[0]
|
||||
if dlg:
|
||||
with dlg._condition:
|
||||
dlg._approved = approved
|
||||
@@ -2499,9 +2518,9 @@ class AppController:
|
||||
dlg._payload = payload
|
||||
dlg._done = True
|
||||
dlg._condition.notify_all()
|
||||
self._pending_mma_approval = None
|
||||
if self._pending_mma_spawn:
|
||||
spawn_dlg = self._pending_mma_spawn.get("dialog_container", [None])[0]
|
||||
elif self._pending_mma_spawns:
|
||||
task = self._pending_mma_spawns.pop(0)
|
||||
spawn_dlg = task.get("dialog_container", [None])[0]
|
||||
if spawn_dlg:
|
||||
with spawn_dlg._condition:
|
||||
spawn_dlg._approved = approved
|
||||
@@ -2512,7 +2531,6 @@ class AppController:
|
||||
spawn_dlg._context_md = context_md
|
||||
spawn_dlg._done = True
|
||||
spawn_dlg._condition.notify_all()
|
||||
self._pending_mma_spawn = None
|
||||
|
||||
def _handle_approve_ask(self) -> None:
|
||||
"""Responds with approval for a pending /api/ask request."""
|
||||
|
||||
@@ -529,7 +529,7 @@ def run_worker_lifecycle(ticket: Ticket, context: WorkerContext, context_files:
|
||||
if event_queue:
|
||||
_queue_put(event_queue, 'mma_stream', {'stream_id': f'Tier 3 (Worker): {ticket.id}', 'text': chunk})
|
||||
|
||||
old_comms_cb = ai_client.comms_log_callback
|
||||
old_comms_cb = ai_client.get_comms_log_callback()
|
||||
def worker_comms_callback(entry: dict) -> None:
|
||||
entry["mma_ticket_id"] = ticket.id
|
||||
if event_queue:
|
||||
@@ -548,7 +548,7 @@ def run_worker_lifecycle(ticket: Ticket, context: WorkerContext, context_files:
|
||||
if old_comms_cb:
|
||||
old_comms_cb(entry)
|
||||
|
||||
ai_client.comms_log_callback = worker_comms_callback
|
||||
ai_client.set_comms_log_callback(worker_comms_callback)
|
||||
ai_client.set_current_tier(f"Tier 3 (Worker): {ticket.id}")
|
||||
try:
|
||||
comms_baseline = len(ai_client.get_comms_log())
|
||||
@@ -562,7 +562,7 @@ def run_worker_lifecycle(ticket: Ticket, context: WorkerContext, context_files:
|
||||
stream_callback=stream_callback
|
||||
)
|
||||
finally:
|
||||
ai_client.comms_log_callback = old_comms_cb
|
||||
ai_client.set_comms_log_callback(old_comms_cb)
|
||||
ai_client.set_current_tier(None)
|
||||
|
||||
# THIRD CHECK: After blocking send() returns
|
||||
|
||||
@@ -71,7 +71,7 @@ def main() -> None:
|
||||
print(json.dumps({
|
||||
"type": "message",
|
||||
"role": "assistant",
|
||||
"content": "Mock response"
|
||||
"content": f"Mock response. Received prompt: {prompt[:100]}..."
|
||||
}), flush=True)
|
||||
print(json.dumps({
|
||||
"type": "result",
|
||||
|
||||
@@ -32,10 +32,9 @@ def test_mma_concurrent_tracks_stress(live_gui) -> None:
|
||||
|
||||
# 1. Setup mock provider
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_concurrent_mma.py")}"')
|
||||
client.click('btn_project_save')
|
||||
time.sleep(1.0)
|
||||
|
||||
# 2. Generate two tracks via Epic
|
||||
client.set_value('mma_epic_input', 'STRESS TEST: TRACK A AND TRACK B')
|
||||
client.click('btn_mma_plan_epic')
|
||||
|
||||
Reference in New Issue
Block a user