fix(webui): reconcile running turns on reconnect (#6715)
* fix(webui): reconcile running turns on reconnect * test(webui): verify only the current turn-sync policy
This commit is contained in:
1 parent
b453de9cf6
commit
094bac0dc3
25 files changed
+455
-226
No files matched your search
@@ -71,12 +71,8 @@ async def test_hydration_events_restore_goal_and_running_turn(
|
||||
}
|
||||
}
|
||||
monkeypatch.setattr(
|
||||
"nanobot.webui.session_projection.websocket_turn_wall_started_at",
|
||||
lambda _chat_id: 42.5,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"nanobot.webui.session_projection.websocket_turn_id",
|
||||
lambda _chat_id: "turn-1",
|
||||
"nanobot.webui.session_projection.latest_live_websocket_turn",
|
||||
lambda _chat_id: (42.5, "turn-1"),
|
||||
)
|
||||
|
||||
events = await WebUISessionProjection(sessions).hydration_events(
|
||||
@@ -112,7 +108,7 @@ async def test_hydration_clears_stale_goal_without_an_active_goal(
|
||||
sessions.state.read_metadata = AsyncMock(side_effect=lambda key: sessions.read_session_metadata(key))
|
||||
sessions.read_session_metadata.return_value = {"metadata": {}}
|
||||
monkeypatch.setattr(
|
||||
"nanobot.webui.session_projection.websocket_turn_wall_started_at",
|
||||
"nanobot.webui.session_projection.latest_live_websocket_turn",
|
||||
lambda _chat_id: None,
|
||||
)
|
||||
|
||||
@@ -142,11 +138,11 @@ async def test_hydration_yields_during_metadata_read_and_reads_live_turn_on_loop
|
||||
|
||||
def active_turn(_chat_id):
|
||||
assert threading.get_ident() == loop_thread
|
||||
return 42.5
|
||||
return (42.5, None)
|
||||
|
||||
monkeypatch.setattr(sessions._store, "read_metadata", read_metadata)
|
||||
monkeypatch.setattr(
|
||||
"nanobot.webui.session_projection.websocket_turn_wall_started_at", active_turn,
|
||||
"nanobot.webui.session_projection.latest_live_websocket_turn", active_turn,
|
||||
)
|
||||
projection = WebUISessionProjection(sessions)
|
||||
task = asyncio.create_task(projection.hydration_events("websocket:chat-io", "chat-io"))
|
||||
|
||||
Reference in new issue
Block a user