fix(conductor): Apply review suggestions for track 'Add full api/hooks so that gemini cli can test, interact, and manipulate the state of the gui & program backend for automated testing.'
This commit is contained in:
12
gui.py
12
gui.py
@@ -24,8 +24,8 @@ from ai_client import ProviderError
|
||||
import shell_runner
|
||||
import session_logger
|
||||
import project_manager
|
||||
import theme
|
||||
import api_hooks
|
||||
import theme
|
||||
|
||||
CONFIG_PATH = Path("config.toml")
|
||||
PROVIDERS = ["gemini", "anthropic"]
|
||||
@@ -396,8 +396,12 @@ def _parse_history_entries(history: list[str], roles: list[str] | None = None) -
|
||||
class App:
|
||||
def __init__(self):
|
||||
self.config = load_config()
|
||||
self.test_hooks_enabled = '--enable-test-hooks' in sys.argv or os.environ.get('SLOP_TEST_HOOKS') == '1'
|
||||
self.hook_server = api_hooks.HookServer(self)
|
||||
# Controls whether API hooks are enabled, based on CLI arg or env var
|
||||
self.test_hooks_enabled: bool = (
|
||||
'--enable-test-hooks' in sys.argv or
|
||||
os.environ.get('SLOP_TEST_HOOKS') == '1')
|
||||
# The API hook server instance
|
||||
self.hook_server: api_hooks.HookServer = api_hooks.HookServer(self)
|
||||
|
||||
# ---- global settings from config.toml ----
|
||||
ai_cfg = self.config.get("ai", {})
|
||||
@@ -474,7 +478,9 @@ class App:
|
||||
self._pending_history_adds_lock = threading.Lock()
|
||||
|
||||
# API GUI Hooks Queue
|
||||
# Tasks (e.g., set_value, click) to be executed on the main DPG thread
|
||||
self._pending_gui_tasks: list[dict] = []
|
||||
# Lock for _pending_gui_tasks to ensure thread safety
|
||||
self._pending_gui_tasks_lock = threading.Lock()
|
||||
|
||||
# Blink state
|
||||
|
||||
Reference in New Issue
Block a user