Refactor session runtime persistence
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user