refactor(tests): Update test suite and API hooks for AppController architecture

This commit is contained in:
2026-03-04 11:38:36 -05:00
parent 8642277ef4
commit f2b25757eb
6 changed files with 214 additions and 141 deletions

View File

@@ -104,7 +104,7 @@ class App:
# Initialize controller and delegate state
self.controller = AppController()
self.controller.init_state()
self.controller.start_services()
self.controller.start_services(self)
# Aliases for controller-owned locks
self._send_thread_lock = self.controller._send_thread_lock
@@ -177,30 +177,6 @@ class App:
"""UI-level wrapper for approving a pending MMA sub-agent spawn."""
self._handle_mma_respond(approved=True)
def _handle_mma_respond(self, approved: bool, payload: str | None = None, abort: bool = False, prompt: str | None = None, context_md: str | None = None) -> None:
"""Delegates MMA approval response to the controller."""
self.controller._handle_mma_respond(approved, payload, abort, prompt, context_md)
def _handle_approve_ask(self, user_data=None) -> None:
"""Delegates tool approval to the controller."""
self.controller._handle_approve_ask()
def _handle_reject_ask(self, user_data=None) -> None:
"""Delegates tool rejection to the controller."""
self.controller._handle_reject_ask()
def _handle_reset_session(self, user_data=None) -> None:
"""Delegates session reset to the controller."""
self.controller._handle_reset_session()
def _handle_md_only(self, user_data=None) -> None:
"""Delegates 'MD Only' logic to the controller."""
self.controller._handle_md_only()
def _handle_generate_send(self, user_data=None) -> None:
"""Delegates 'Gen + Send' logic to the controller."""
self.controller._handle_generate_send()
def __getattr__(self, name: str) -> Any:
if name != 'controller' and hasattr(self, 'controller') and hasattr(self.controller, name):
return getattr(self.controller, name)
@@ -508,6 +484,7 @@ class App:
self.perf_monitor.start_frame()
# Process GUI task queue
self._process_pending_gui_tasks()
self._process_pending_history_adds()
self._render_track_proposal_modal()
# Auto-save (every 60s)
now = time.time()