From f95f5a88cf227d213fbdb6d3287bbbba465e613d Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sat, 24 Oct 2026 14:50:30 -0500 Subject: [PATCH] Apply shared host warning policy to inactive AOL source pauses --- .../aol/tests/test_global_source_pause.py | 21 ++++++++++++------- openpilot/starpilot/aol/transport_pause.py | 2 +- prebuilt.json | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/openpilot/starpilot/aol/tests/test_global_source_pause.py b/openpilot/starpilot/aol/tests/test_global_source_pause.py index 85a0406ca6..68a2392b91 100644 --- a/openpilot/starpilot/aol/tests/test_global_source_pause.py +++ b/openpilot/starpilot/aol/tests/test_global_source_pause.py @@ -70,7 +70,7 @@ def state(): return cs -def sample(cp, now, sequence, *, phase='active', withdrawn=False, order='matched'): +def sample(cp, now, sequence, *, phase='active', withdrawn=False, order='matched', warning='commIssue'): longitudinal = bool(cp.openpilotLongitudinalControl) native = bound_state(cp, now=now, session=SESSION) native = replace(native, requestedLongitudinal=longitudinal, longitudinalAllowed=longitudinal) @@ -101,7 +101,7 @@ def sample(cp, now, sequence, *, phase='active', withdrawn=False, order='matched event_stamp = now if matched else now + 1_000_000 if order == 'recovery_first' else NOW events = messaging.new_message('onroadEvents', int(matched), valid=True, logMonoTime=event_stamp) if matched: - events.onroadEvents[0].name, events.onroadEvents[0].softDisable = 'commIssue', True + events.onroadEvents[0].name, events.onroadEvents[0].softDisable = warning, True return Peers([wire.as_reader(), pandas.as_reader(), proof.as_reader(), events.as_reader()]), native @@ -124,10 +124,11 @@ def change(sm, service, update): @pytest.mark.parametrize('identity', PROFILES) @pytest.mark.parametrize('withdrawn', [False, True]) @pytest.mark.parametrize('order', ['matched', 'axis_first', 'recovery_first']) -def test_every_make_retains_source_pause_intent_and_requires_current_output_grant(identity, withdrawn, order): +@pytest.mark.parametrize('warning', ['commIssue', 'commIssueAvgFreq', 'selfdrivedLagging']) +def test_every_make_retains_source_pause_intent_and_requires_current_output_grant(identity, withdrawn, order, warning): cp, cs, feedback = baseline(identity) now = NOW + 42_000_000 - sm, _ = sample(cp, now, 20_000_001, phase='pause', withdrawn=withdrawn, order=order) + sm, _ = sample(cp, now, 20_000_001, phase='pause', withdrawn=withdrawn, order=order, warning=warning) before = dict(vars(feedback)) assert not feedback.observe(sm, cp, cs, now + 2_000_000, latched=True, intent_producer_session=PRODUCER) assert not feedback.failed @@ -150,7 +151,7 @@ def test_every_make_retains_source_pause_intent_and_requires_current_output_gran @pytest.mark.parametrize('identity', PROFILES) @pytest.mark.parametrize('fault', ['source_expired', 'packet_expired', 'native_expired', 'native_denial', 'native_fault', 'can', 'timeout', 'permanent_eps', 'button', 'main_off', 'producer', 'epoch', - 'session', 'cp', 'event_fault', 'event_cancel', 'unarmed']) + 'session', 'cp', 'event_fault', 'event_cancel', 'combined_cancel', 'unarmed']) def test_every_make_keeps_existing_fault_cancel_identity_and_stale_vetoes(identity, fault): cp, cs, feedback = baseline(identity) now = NOW + (210_000_001 if fault == 'source_expired' else 42_000_000) @@ -170,6 +171,11 @@ def test_every_make_keeps_existing_fault_cancel_identity_and_stale_vetoes(identi change(sm, 'aolAxisState', lambda axis: setattr(axis, 'intentIntegrityEpoch' if fault == 'epoch' else 'sessionId', 1 if fault == 'epoch' else 'different')) elif fault == 'cp': cp.flags ^= 1 + elif fault == 'combined_cancel': + event = messaging.new_message('onroadEvents', 2, valid=True, logMonoTime=now) + event.onroadEvents[0] = sm['onroadEvents'][0] + event.onroadEvents[1].name, event.onroadEvents[1].userDisable = 'buttonCancel', True + sm.messages['onroadEvents'] = event.as_reader() elif fault in ('event_fault', 'event_cancel'): def alter(events): events[0].name = 'controlsMismatch' if fault == 'event_fault' else 'buttonCancel' @@ -187,14 +193,15 @@ def test_every_make_keeps_existing_fault_cancel_identity_and_stale_vetoes(identi @pytest.mark.parametrize('identity', ('gm', *VOLTS)) @pytest.mark.parametrize('withdrawn', [False, True]) -def test_gm_and_volt_actual_intent_owner_keeps_main_arm_during_temporary_pause(identity, withdrawn): +@pytest.mark.parametrize('warning', ['commIssue', 'commIssueAvgFreq', 'selfdrivedLagging']) +def test_gm_and_volt_actual_intent_owner_keeps_main_arm_during_temporary_pause(identity, withdrawn, warning): cp, cs, feedback = baseline(identity) settings = AolSettings(True, 0., 0, 0, (0, 0, 0), (0, 0, 0)) owner = vehicle.create_intent(cp, settings, vehicle.policy_for(cp)) owner.update(cs, fault_active=False, now_ns=NOW) assert owner.allowed_latch and not owner._main_cycle_required now = NOW + 42_000_000 - sm, _ = sample(cp, now, 20_000_001, phase='pause', withdrawn=withdrawn) + sm, _ = sample(cp, now, 20_000_001, phase='pause', withdrawn=withdrawn, warning=warning) reset = feedback.observe(sm, cp, cs, now, latched=owner.allowed_latch, intent_producer_session=PRODUCER) owner.update(cs, fault_active=reset, now_ns=now) assert owner.allowed_latch and not owner._main_cycle_required diff --git a/openpilot/starpilot/aol/transport_pause.py b/openpilot/starpilot/aol/transport_pause.py index 72d7eddc32..a9aff99512 100644 --- a/openpilot/starpilot/aol/transport_pause.py +++ b/openpilot/starpilot/aol/transport_pause.py @@ -1284,7 +1284,7 @@ class TransportPauseFeedback: # axis lease; repeated OFF samples cannot renew the accepted source bound. if (not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or not 0 < event_ns <= now_ns or now_ns - event_ns > 1_500_000_000 or - (not availability_only(events) if matched else + (not host_source_availability_only(events) if matched else any(event.immediateDisable or event.softDisable or event.userDisable for event in events))): return False native = _healthy_transport_native(sm, cp, cs, self.session, now_ns) diff --git a/prebuilt.json b/prebuilt.json index 144125d3b0..d3a47af9c6 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "e4c1a4fae7b24654eda9d4719ea7c69175312bcd3f2e2f3abe5f0375eb4593fa", "schema_version": 1} +{"protected_inventory_sha256": "cbcf30c729ec4b3bcd1887af24764d3a49003d0e9eab29b733e29ca4d09a3b30", "schema_version": 1}