conductor(checkpoint): Checkpoint end of Phase 2
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[ai]
|
[ai]
|
||||||
provider = "gemini_cli"
|
provider = "gemini_cli"
|
||||||
model = "gemini-2.5-flash-lite"
|
model = "gemini-2.0-flash"
|
||||||
temperature = 0.0
|
temperature = 0.0
|
||||||
max_tokens = 8192
|
max_tokens = 8192
|
||||||
history_trunc_limit = 8000
|
history_trunc_limit = 8000
|
||||||
@@ -15,7 +15,7 @@ paths = [
|
|||||||
"C:\\projects\\manual_slop\\tests\\artifacts\\temp_livetoolssim.toml",
|
"C:\\projects\\manual_slop\\tests\\artifacts\\temp_livetoolssim.toml",
|
||||||
"C:\\projects\\manual_slop\\tests\\artifacts\\temp_liveexecutionsim.toml",
|
"C:\\projects\\manual_slop\\tests\\artifacts\\temp_liveexecutionsim.toml",
|
||||||
]
|
]
|
||||||
active = "C:\\projects\\manual_slop\\tests\\artifacts\\temp_livetoolssim.toml"
|
active = "C:\\projects\\manual_slop\\tests\\artifacts\\temp_project.toml"
|
||||||
|
|
||||||
[gui.show_windows]
|
[gui.show_windows]
|
||||||
"Context Hub" = true
|
"Context Hub" = true
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ from gui_2 import App
|
|||||||
from events import UserRequestEvent
|
from events import UserRequestEvent
|
||||||
|
|
||||||
@pytest.mark.timeout(10)
|
@pytest.mark.timeout(10)
|
||||||
def test_user_request_integration_flow(mock_app: App) -> None:
|
@pytest.mark.asyncio
|
||||||
|
async def test_user_request_integration_flow(mock_app: App) -> None:
|
||||||
"""
|
"""
|
||||||
Verifies that pushing a UserRequestEvent to the event_queue:
|
Verifies that pushing a UserRequestEvent to the event_queue:
|
||||||
1. Triggers ai_client.send
|
1. Triggers ai_client.send
|
||||||
@@ -31,14 +32,11 @@ def test_user_request_integration_flow(mock_app: App) -> None:
|
|||||||
base_dir="."
|
base_dir="."
|
||||||
)
|
)
|
||||||
# 2. Push event to the app's internal loop
|
# 2. Push event to the app's internal loop
|
||||||
asyncio.run_coroutine_threadsafe(
|
await app.event_queue.put("user_request", event)
|
||||||
app.event_queue.put("user_request", event),
|
|
||||||
app._loop
|
|
||||||
)
|
|
||||||
# 3. Wait for ai_client.send to be called (polling background thread)
|
# 3. Wait for ai_client.send to be called (polling background thread)
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
while not mock_send.called and time.time() - start_time < 5:
|
while not mock_send.called and time.time() - start_time < 5:
|
||||||
time.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
assert mock_send.called, "ai_client.send was not called within timeout"
|
assert mock_send.called, "ai_client.send was not called within timeout"
|
||||||
mock_send.assert_called_once_with(
|
mock_send.assert_called_once_with(
|
||||||
"Context", "Hello AI", ".", [], "History",
|
"Context", "Hello AI", ".", [], "History",
|
||||||
@@ -54,13 +52,14 @@ def test_user_request_integration_flow(mock_app: App) -> None:
|
|||||||
if app.ai_response == mock_response and app.ai_status == "done":
|
if app.ai_response == mock_response and app.ai_status == "done":
|
||||||
success = True
|
success = True
|
||||||
break
|
break
|
||||||
time.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
assert success, f"UI state was not updated. ai_response: '{app.ai_response}', status: '{app.ai_status}'"
|
assert success, f"UI state was not updated. ai_response: '{app.ai_response}', status: '{app.ai_status}'"
|
||||||
assert app.ai_response == mock_response
|
assert app.ai_response == mock_response
|
||||||
assert app.ai_status == "done"
|
assert app.ai_status == "done"
|
||||||
|
|
||||||
@pytest.mark.timeout(10)
|
@pytest.mark.timeout(10)
|
||||||
def test_user_request_error_handling(mock_app: App) -> None:
|
@pytest.mark.asyncio
|
||||||
|
async def test_user_request_error_handling(mock_app: App) -> None:
|
||||||
"""
|
"""
|
||||||
Verifies that if ai_client.send raises an exception, the UI is updated with the error state.
|
Verifies that if ai_client.send raises an exception, the UI is updated with the error state.
|
||||||
"""
|
"""
|
||||||
@@ -78,10 +77,7 @@ def test_user_request_error_handling(mock_app: App) -> None:
|
|||||||
disc_text="",
|
disc_text="",
|
||||||
base_dir="."
|
base_dir="."
|
||||||
)
|
)
|
||||||
asyncio.run_coroutine_threadsafe(
|
await app.event_queue.put("user_request", event)
|
||||||
app.event_queue.put("user_request", event),
|
|
||||||
app._loop
|
|
||||||
)
|
|
||||||
# Poll for error state by processing GUI tasks
|
# Poll for error state by processing GUI tasks
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
success = False
|
success = False
|
||||||
@@ -90,5 +86,5 @@ def test_user_request_error_handling(mock_app: App) -> None:
|
|||||||
if app.ai_status == "error" and "ERROR: API Failure" in app.ai_response:
|
if app.ai_status == "error" and "ERROR: API Failure" in app.ai_response:
|
||||||
success = True
|
success = True
|
||||||
break
|
break
|
||||||
time.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
assert success, f"Error state was not reflected in UI. status: {app.ai_status}, response: {app.ai_response}"
|
assert success, f"Error state was not reflected in UI. status: {app.ai_status}, response: {app.ai_response}"
|
||||||
|
|||||||
Reference in New Issue
Block a user