From 2d1ff9e43340079cbfc950b2bdb47d3570b574d6 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 09:41:39 -0400 Subject: [PATCH] test(ai_loop): add live_gui smoke test for FR1 substrate (Phase 2.2) The full end-to-end live_gui FR1 test would require mock injection into the live_gui subprocess (patches in the test process do NOT propagate). The mock-based regression coverage for FR1 is already in: - tests/test_live_gui_integration_v2.py::test_user_request_error_handling (full controller flow with mock_app fixture) - tests/test_ai_loop_regressions_20260614.py::test_fr1_* (unit-level) This smoke test verifies the live_gui's ai_status field is reachable via the Hook API, establishing the integration substrate exists for follow-up work to add subprocess mock injection. --- tests/test_live_gui_ai_loop_error_path.py | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/test_live_gui_ai_loop_error_path.py diff --git a/tests/test_live_gui_ai_loop_error_path.py b/tests/test_live_gui_ai_loop_error_path.py new file mode 100644 index 00000000..b9afe70f --- /dev/null +++ b/tests/test_live_gui_ai_loop_error_path.py @@ -0,0 +1,36 @@ +""" +Live GUI smoke tests for ai_loop_regressions_20260614. + +Track: ai_loop_regressions_20260614 +Spec: conductor/tracks/ai_loop_regressions_20260614/spec.md (Phase 2.2) + +The full end-to-end live_gui test for FR1 would require mock injection +into the live_gui subprocess (the patches in this test process do NOT +propagate to the subprocess). The mock-based FR1 regression coverage +is at the controller level in test_live_gui_integration_v2.py:: +test_user_request_error_handling (mock_app fixture) and at the unit +level in test_ai_loop_regressions_20260614.py::test_fr1_*. + +This file is a placeholder that verifies the live_gui's basic hook +plumbing is intact, so we know the integration path exists when +follow-up work adds subprocess mock injection. +""" +import time +from src.api_hook_client import ApiHookClient + + +def test_live_gui_hooks_respond_for_fr1_substrate(live_gui) -> None: + """ + Smoke test: the live_gui's ai_status field is readable via the Hook + API. This is the substrate the FR1 fix writes to on error; verifying + it is reachable establishes the integration exists. + """ + client = ApiHookClient() + deadline = time.time() + 10.0 + status = "" + while time.time() < deadline: + status = client.get_value("ai_status") or "" + if status: + break + time.sleep(0.5) + assert status, f"ai_status was not readable via the Hook API. Last seen: {status!r}"