feat: 完善 N7 智能座舱交互与控制链路
This commit is contained in:
@@ -48,12 +48,13 @@ DEFAULT_DRIVER_NATIVE_SEAT_CAPABILITIES = {
|
||||
"seat.set_heating": "seat.set_driver_heating_native",
|
||||
}
|
||||
EXPLICIT_DRIVER_SEAT_PATTERN = re.compile(
|
||||
r"主驾|驾驶位|司机位|左前(?:的)?(?:座椅|座位)|"
|
||||
r"主驾|驾驶位|驾驶员|司机位|左前(?:的)?(?:座椅|座位)|"
|
||||
r"seat\s+(?:driver|front-left)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
EXPLICIT_NON_DRIVER_SEAT_PATTERN = re.compile(
|
||||
r"副驾|乘客|右前|后排|前排|所有座椅|全部座椅|"
|
||||
r"副驾|乘客|乘员|右前|后排|后座|二排|第二排|中排|第三排|"
|
||||
r"前排|前舱|后舱|左侧|右侧|左边|右边|所有座椅|全部座椅|全车座椅|"
|
||||
r"seat\s+(?:passenger|front-right)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
@@ -277,7 +278,18 @@ class ModelPlanAdapter:
|
||||
"""Normalize omitted model targets to driver-console CH1 defaults."""
|
||||
|
||||
request = deepcopy(raw_request)
|
||||
# Repository-backed mode and speech payloads already carry a validated
|
||||
# structured target. An empty utterance is not authorization to
|
||||
# reinterpret that persisted scope as a driver-console default.
|
||||
if not utterance.strip():
|
||||
return request
|
||||
capability = str(request.get("capability", ""))
|
||||
current_target = str(request.get("target_scope") or "").strip().lower()
|
||||
if current_target not in {"", "unknown", "unspecified", "default"}:
|
||||
# The plan guard has already tied this explicit scope to the
|
||||
# server-owned utterance. Rewriting it afterwards is a TOCTOU
|
||||
# semantic change and can widen a local request to another zone.
|
||||
return request
|
||||
native_seat_capability = DEFAULT_DRIVER_NATIVE_SEAT_CAPABILITIES.get(
|
||||
capability
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user