feat(gui2): Integrate core event system

Integrates the ai_client.events emitter into the gui_2.py App class. Adds a new test file to verify that the App subscribes to API lifecycle events upon initialization. This is the first step in aligning gui_2.py with the project's event-driven architecture.
This commit is contained in:
2026-02-23 20:22:36 -05:00
parent bf873dc110
commit 24b831c712
2 changed files with 58 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import session_logger
import project_manager
import theme_2 as theme
import tomllib
import events
from imgui_bundle import imgui, hello_imgui, immapp
@@ -187,6 +188,15 @@ class App:
ai_client.comms_log_callback = self._on_comms_entry
ai_client.tool_log_callback = self._on_tool_log
# Subscribe to API lifecycle events
ai_client.events.on("request_start", self._on_api_event)
ai_client.events.on("response_received", self._on_api_event)
ai_client.events.on("tool_execution", self._on_api_event)
def _on_api_event(self, *args, **kwargs):
"""Callback for ai_client events. For now, a placeholder."""
pass
# ---------------------------------------------------------------- project loading
def _load_active_project(self):