Refactor session runtime persistence

This commit is contained in:
wuyang6
2026-06-12 16:17:58 +08:00
parent 77d360c1e8
commit 953126e1d3
15 changed files with 717 additions and 253 deletions
+19
View File
@@ -483,6 +483,21 @@ class GuiServerTests(unittest.TestCase):
},
{'role': 'user', 'content': 'continue'},
),
display_messages=(
{'role': 'user', 'content': 'hello'},
{
'role': 'assistant',
'content': '上一次任务已中断,后台没有正在执行的进程。',
'state': 'final',
'stop_reason': 'interrupted',
'metadata': {'kind': 'run_status', 'status': 'interrupted'},
},
{
'role': 'user',
'content': 'pending',
'metadata': {'status': 'running', 'placeholder': True},
},
),
turns=1,
tool_calls=0,
usage={},
@@ -498,6 +513,10 @@ class GuiServerTests(unittest.TestCase):
[message['content'] for message in sanitized.messages],
['hello', 'continue'],
)
self.assertEqual(
[message['content'] for message in sanitized.display_messages],
['hello'],
)
def test_runtime_event_stage_names_long_running_work(self) -> None:
self.assertEqual(