fix: harden conversational mode draft revisions
This commit is contained in:
@@ -770,6 +770,37 @@ class TestCodexAssistantWebApi:
|
||||
assert action["payload"]["hardware_execution_allowed"] is False
|
||||
assert events[0]["engine"] == "n7web-mode-builder"
|
||||
|
||||
def test_become_percentage_update_keeps_movie_draft_route_end_to_end(
|
||||
self,
|
||||
) -> None:
|
||||
reference = {
|
||||
"name": "观影模式",
|
||||
"source_request_id": "req-mode-preview",
|
||||
"vehicle_id": "denza_n7",
|
||||
}
|
||||
message = "把观影模式的遮阳帘变成100%"
|
||||
|
||||
events = self.post_assistant(
|
||||
{
|
||||
"message": message,
|
||||
"conversation_id": "conv-api-movie-shade-become-percent",
|
||||
"execution_mode": "hardware",
|
||||
"mode_profile_draft_context": reference,
|
||||
}
|
||||
)
|
||||
|
||||
assert not FAKE_CODEX.turn_calls
|
||||
call = AssistantApiHandler.service.calls[-1]
|
||||
assert call["utterance"] == message
|
||||
assert call["mode_profile_draft_context"] == reference
|
||||
action = next(event for event in events if event["type"] == "action.completed")
|
||||
assert action["success"] is True
|
||||
assert action["payload"]["execution_mode"] == "dry_run"
|
||||
assert action["payload"]["hardware_execution_allowed"] is False
|
||||
assert action["payload"]["mode_profile_draft"]["draft_revision"] == 2
|
||||
assert events[0]["route"] == "vehicle_control"
|
||||
assert events[0]["engine"] == "n7web-mode-builder"
|
||||
|
||||
def test_active_draft_reference_is_not_forwarded_for_an_unrelated_question(
|
||||
self,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user