feat: integrate production cockpit AI assistant

This commit is contained in:
vee
2026-09-08 17:46:07 +08:00
parent 5e228e12ae
commit 93103c2579
66 changed files with 11046 additions and 374 deletions
@@ -876,6 +876,41 @@ def test_question_shaped_mode_turns_never_modify_a_draft_or_touch_hardware(
assert not list(user_root.rglob("*.yaml"))
@pytest.mark.parametrize(
"message",
(
"能否创建一个观影模式?",
"构建一个观影模式,空调温度是25度还是26度?",
),
)
def test_create_shaped_questions_never_reach_hardware_or_scene_composer(
mode_service: tuple[SeatDemoService, Path],
message: str,
) -> None:
service, user_root = mode_service
with patch.object(
service.hardware_execution,
"reserve",
side_effect=AssertionError("mode-create question reached a hardware lease"),
):
result = service.preview_native_can(
message,
provider="local",
conversation_id="conv-create-question-" + str(abs(hash(message)))[:12],
execution_mode="hardware",
vehicle_id="denza_n7",
)
assert result["status"] == "needs_confirmation"
assert result["orchestration_route"] == "mode_profile_query"
assert result["execution_mode"] == "dry_run"
assert result["hardware_execution_allowed"] is False
assert result.get("mode_profile_draft") is None
assert _intent_actions(result) == []
assert not list(user_root.rglob("*.yaml"))
INVALID_PARAMETER_CASES = (
SceneCase("temperature-low", "非法低温模式", "climate.set_temperature", "vehicle", {"temperature_c": 17}),
SceneCase("temperature-high", "非法高温模式", "climate.set_temperature", "vehicle", {"temperature_c": 33}),