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:
10
gui_2.py
10
gui_2.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user