feat: improve mode and peripheral orchestration
This commit is contained in:
@@ -523,6 +523,56 @@ def test_registered_mode_execution_uses_fast_local_route_without_codex(
|
||||
assert "模拟编排" in result["answer"]
|
||||
|
||||
|
||||
def test_partially_supported_imported_mode_uses_submitted_not_partial_wording() -> None:
|
||||
client = FakeCodexClient(available=False)
|
||||
assistant = CodexAssistantService(client)
|
||||
catalog = {
|
||||
"modes": [
|
||||
{
|
||||
"id": "cinema",
|
||||
"name": "影院模式",
|
||||
"aliases": [],
|
||||
"assistant_callable": True,
|
||||
}
|
||||
],
|
||||
"source_status": {"modes": "ready"},
|
||||
}
|
||||
|
||||
def execute(instruction: str, progress: Callable[[dict[str, object]], None]):
|
||||
result = {
|
||||
"request_id": "req-imported-cinema-partial",
|
||||
"utterance": instruction,
|
||||
"status": "partially_succeeded",
|
||||
"execution_mode": "hardware",
|
||||
"execution_outcome": "submitted_unverified",
|
||||
"deferred_requests": [
|
||||
{
|
||||
"execution_backend": "n7_vehicle_transfer",
|
||||
"capability": "android.launch_app",
|
||||
}
|
||||
],
|
||||
}
|
||||
progress(result)
|
||||
return result
|
||||
|
||||
result, events = _stream(
|
||||
assistant,
|
||||
"进入影院模式",
|
||||
execute_control=execute,
|
||||
capability_snapshot=catalog,
|
||||
)
|
||||
|
||||
assert result["route"] == "mode_profile_execute"
|
||||
assert result["success"] is True
|
||||
assert "已提交" in result["answer"]
|
||||
assert "部分完成" not in result["answer"]
|
||||
assert "未能完成" not in result["answer"]
|
||||
assert any(
|
||||
event.get("display_text") == "功能模式已提交,等待车辆状态确认"
|
||||
for event in events
|
||||
)
|
||||
|
||||
|
||||
def test_registered_name_only_mode_keeps_the_fast_local_route_without_codex() -> None:
|
||||
client = FakeCodexClient(available=False)
|
||||
assistant = CodexAssistantService(client)
|
||||
|
||||
Reference in New Issue
Block a user