refactor(phase5): Comprehensive stabilisation pass. De-duplicated App/Controller state, hardened session reset, and updated integration tests with deterministic polling.

This commit is contained in:
2026-05-09 16:55:45 -04:00
parent d1cc019640
commit b958fa2819
16 changed files with 351 additions and 383 deletions
+5 -8
View File
@@ -1,13 +1,8 @@
import pytest
from src import ai_client
from src.api_hook_client import ApiHookClient
import time
import os
import sys
# Ensure project root is in path for imports
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from src.api_hook_client import ApiHookClient
from src import ai_client
def test_system_prompt_sim(live_gui):
"""
@@ -22,6 +17,8 @@ def test_system_prompt_sim(live_gui):
"""
_, gui_script = live_gui
client = ApiHookClient()
client.click("btn_reset")
time.sleep(2)
# 1. Use client.wait_for_server().
assert client.wait_for_server(timeout=15), "Server failed to start in time"
@@ -71,4 +68,4 @@ def test_system_prompt_sim(live_gui):
# Close it
client.set_value('show_base_prompt_diff_modal', False)
assert client.get_value('show_base_prompt_diff_modal') is False
assert client.get_value('show_base_prompt_diff_modal') is False