feat: unify debug runtime timelines

This commit is contained in:
Xin Wang
2026-08-13 09:30:43 +08:00
parent 7c18cea16d
commit eb111a3890
21 changed files with 1380 additions and 533 deletions
@@ -144,6 +144,22 @@ class ConversationRecorderTest(unittest.IsolatedAsyncioTestCase):
self.assertEqual(saved["sessionId"], "conv_test")
self.assertEqual(saved["sequence"], 1)
async def test_internal_message_stage_transport_trace_is_not_persisted_twice(self):
recorder = ConversationRecorder("conv_test")
event = {
"type": "workflow-event",
"eventId": "wfe_internal",
"event": "client_tool_completed",
"functionName": "show_message",
"internalStage": True,
}
with patch("services.conversation_history.SessionLocal") as session_local:
await recorder.record_transport_message(event)
session_local.assert_not_called()
self.assertEqual(recorder._trace_sequence, 0)
async def test_image_is_persisted_as_message_with_artifact(self):
conversation = SimpleNamespace(message_count=0)