From 523d79ef6cbc6b7384763feb23f4f16d5ae4130d Mon Sep 17 00:00:00 2001 From: danielpolimac Date: Sat, 22 Aug 2026 15:43:16 +0200 Subject: [PATCH 1/2] selfdrived: prioritize process failure alerts --- openpilot/selfdrive/selfdrived/events.py | 2 +- openpilot/selfdrive/selfdrived/tests/test_alerts.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/openpilot/selfdrive/selfdrived/events.py b/openpilot/selfdrive/selfdrived/events.py index 69fa900be44442..cdc27dd0a14b42 100755 --- a/openpilot/selfdrive/selfdrived/events.py +++ b/openpilot/selfdrive/selfdrived/events.py @@ -287,7 +287,7 @@ def posenet_invalid_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.Sub def process_not_running_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert: not_running = [p.name for p in sm['managerState'].processes if not p.running and p.shouldBeRunning] msg = ', '.join(not_running) - return NoEntryAlert(msg, alert_text_1="Process Not Running") + return NoEntryAlert(msg, alert_text_1="Process Not Running", priority=Priority.HIGH) def comm_issue_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert: diff --git a/openpilot/selfdrive/selfdrived/tests/test_alerts.py b/openpilot/selfdrive/selfdrived/tests/test_alerts.py index f4ff093bd83109..9b4ea208c94e6f 100644 --- a/openpilot/selfdrive/selfdrived/tests/test_alerts.py +++ b/openpilot/selfdrive/selfdrived/tests/test_alerts.py @@ -70,6 +70,14 @@ def test_alert_sanity_check(self): if event_type not in (ET.WARNING, ET.PERMANENT, ET.PRE_ENABLE): assert a.creation_delay == 0. + def test_process_not_running_alert_has_priority(self): + process_alert = EVENTS[log.OnroadEvent.EventName.processNotRunning][ET.NO_ENTRY]( + self.CP, self.CS, self.sm, False, 0, None, + ) + steer_alert = EVENTS[log.OnroadEvent.EventName.steerUnavailable][ET.NO_ENTRY] + + assert process_alert.priority > steer_alert.priority + def test_offroad_alerts(self): params = Params() for a in self.offroad_alerts: From ef945f26516bab1536f62e1709f7595c551d04c0 Mon Sep 17 00:00:00 2001 From: danielpolimac Date: Sat, 22 Aug 2026 16:46:01 +0200 Subject: [PATCH 2/2] test: satisfy alert callback type checking --- openpilot/selfdrive/selfdrived/tests/test_alerts.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openpilot/selfdrive/selfdrived/tests/test_alerts.py b/openpilot/selfdrive/selfdrived/tests/test_alerts.py index 9b4ea208c94e6f..09b74f81619f29 100644 --- a/openpilot/selfdrive/selfdrived/tests/test_alerts.py +++ b/openpilot/selfdrive/selfdrived/tests/test_alerts.py @@ -9,7 +9,7 @@ from openpilot.cereal.messaging import SubMaster from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params -from openpilot.selfdrive.selfdrived.events import Alert, EVENTS, ET +from openpilot.selfdrive.selfdrived.events import Alert, EVENTS, ET, process_not_running_alert from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS @@ -71,9 +71,7 @@ def test_alert_sanity_check(self): assert a.creation_delay == 0. def test_process_not_running_alert_has_priority(self): - process_alert = EVENTS[log.OnroadEvent.EventName.processNotRunning][ET.NO_ENTRY]( - self.CP, self.CS, self.sm, False, 0, None, - ) + process_alert = process_not_running_alert(self.CP, self.CS, self.sm, False, 0, None) steer_alert = EVENTS[log.OnroadEvent.EventName.steerUnavailable][ET.NO_ENTRY] assert process_alert.priority > steer_alert.priority