feat: trigger prompt reply after opening confirmation

This commit is contained in:
Xin Wang
2026-08-04 11:49:49 +08:00
parent 775e4058bc
commit 1af1cd7fed
2 changed files with 29 additions and 4 deletions

View File

@@ -353,7 +353,7 @@ class PromptBrainTests(unittest.IsolatedAsyncioTestCase):
["preflight_1", "preflight_2"],
)
async def test_opening_stage_starts_speech_and_releases_on_confirmation(self):
async def test_opening_stage_triggers_reply_after_confirmation(self):
tool = RuntimeTool(
id="opening_data",
name="加载开场数据",
@@ -454,6 +454,10 @@ class PromptBrainTests(unittest.IsolatedAsyncioTestCase):
await opening_task
self.assertEqual(input_states, [False, True])
self.assertEqual(called_tool_ids, ["opening_data"])
self.assertEqual(
sum(isinstance(frame, LLMRunFrame) for frame in queued),
1,
)
self.assertEqual(
len(
[
@@ -469,6 +473,10 @@ class PromptBrainTests(unittest.IsolatedAsyncioTestCase):
# Replayed client-ready must not execute startup actions twice.
await brain.on_client_ready()
self.assertEqual(brain._actions.execute.await_count, 1)
self.assertEqual(
sum(isinstance(frame, LLMRunFrame) for frame in queued),
1,
)
async def test_required_opening_failure_keeps_input_blocked_and_ends_call(self):
cfg = AssistantConfig(