From 35e38f5fe4cbab410067f05aaf0b3be2ca26c83c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 23 Feb 2026 01:21:40 -0800 Subject: [PATCH 1/7] mici ui: show lock in network panel (#37345) * disable forget for tethering * nets * put in wifiman * batch * revert * draw --- .../mici/layouts/settings/network/__init__.py | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/mici/layouts/settings/network/__init__.py b/selfdrive/ui/mici/layouts/settings/network/__init__.py index ad4e43a1ac83ab2..299df5fea04551c 100644 --- a/selfdrive/ui/mici/layouts/settings/network/__init__.py +++ b/selfdrive/ui/mici/layouts/settings/network/__init__.py @@ -8,7 +8,27 @@ from openpilot.selfdrive.ui.lib.prime_state import PrimeType from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.widgets.nav_widget import NavWidget -from openpilot.system.ui.lib.wifi_manager import WifiManager, Network, MeteredType, ConnectStatus, normalize_ssid +from openpilot.system.ui.lib.wifi_manager import WifiManager, Network, MeteredType, ConnectStatus, SecurityType, normalize_ssid + + +class WifiNetworkButton(BigButton): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._lock_txt = gui_app.texture("icons_mici/settings/network/new/lock.png", 28, 36) + self._draw_lock = False + + def set_draw_lock(self, draw: bool): + self._draw_lock = draw + + def _draw_content(self, btn_y: float): + super()._draw_content(btn_y) + # Render lock icon at lower right of wifi icon if secured + if self._draw_lock: + icon_x = self._rect.x + self._rect.width - 30 - self._txt_icon.width + icon_y = btn_y + 30 + lock_x = icon_x + self._txt_icon.width - self._lock_txt.width + 7 + lock_y = icon_y + self._txt_icon.height - self._lock_txt.height + 8 + rl.draw_texture_ex(self._lock_txt, (lock_x, lock_y), 0.0, 1.0, rl.WHITE) class NetworkLayoutMici(NavWidget): @@ -68,7 +88,7 @@ def network_metered_callback(value: str): self._wifi_medium_txt = gui_app.texture("icons_mici/settings/network/wifi_strength_medium.png", 64, 47) self._wifi_full_txt = gui_app.texture("icons_mici/settings/network/wifi_strength_full.png", 64, 47) - self._wifi_button = BigButton("wi-fi", "not connected", self._wifi_slash_txt, scroll=True) + self._wifi_button = WifiNetworkButton("wi-fi", "not connected", self._wifi_slash_txt, scroll=True) self._wifi_button.set_click_callback(lambda: gui_app.push_widget(self._wifi_ui)) # ******** Advanced settings ******** @@ -131,8 +151,10 @@ def _update_state(self): if display_network is not None: strength = WifiIcon.get_strength_icon_idx(display_network.strength) self._wifi_button.set_icon(self._wifi_full_txt if strength == 2 else self._wifi_medium_txt if strength == 1 else self._wifi_low_txt) + self._wifi_button.set_draw_lock(display_network.security_type not in (SecurityType.OPEN, SecurityType.UNSUPPORTED)) else: self._wifi_button.set_icon(self._wifi_slash_txt) + self._wifi_button.set_draw_lock(False) def show_event(self): super().show_event() From 2ecdd2810c6475dd40f9a981e2e10c67a4645a5d Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 23 Feb 2026 01:22:59 -0800 Subject: [PATCH 2/7] mici ui: disable forget on tethering and show full strength (#37344) * disable forget for tethering * nets * put in wifiman * batch * Revert "batch" This reverts commit 9af20c1c7513c22bf9283b2f02514373fa981f50. * clean up * more * more --- selfdrive/ui/mici/layouts/settings/network/wifi_ui.py | 3 +++ system/ui/lib/wifi_manager.py | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py b/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py index c43a294e40652e2..c9bc54a8b5a081c 100644 --- a/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py +++ b/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py @@ -152,6 +152,9 @@ def network(self) -> Network: @property def _show_forget_btn(self): + if self._network.is_tethering: + return False + return (self._is_saved and not self._wrong_password) or self._is_connecting def _handle_mouse_release(self, mouse_pos: MousePos): diff --git a/system/ui/lib/wifi_manager.py b/system/ui/lib/wifi_manager.py index 4ca0a382d440ebe..4f02b706259ff20 100644 --- a/system/ui/lib/wifi_manager.py +++ b/system/ui/lib/wifi_manager.py @@ -93,17 +93,19 @@ class Network: ssid: str strength: int security_type: SecurityType + is_tethering: bool @classmethod - def from_dbus(cls, ssid: str, aps: list["AccessPoint"]) -> "Network": + def from_dbus(cls, ssid: str, aps: list["AccessPoint"], is_tethering: bool) -> "Network": # we only want to show the strongest AP for each Network/SSID strongest_ap = max(aps, key=lambda ap: ap.strength) security_type = get_security_type(strongest_ap.flags, strongest_ap.wpa_flags, strongest_ap.rsn_flags) return cls( ssid=ssid, - strength=strongest_ap.strength, + strength=100 if is_tethering else strongest_ap.strength, security_type=security_type, + is_tethering=is_tethering, ) @@ -820,7 +822,7 @@ def worker(): # catch all for parsing errors cloudlog.exception(f"Failed to parse AP properties for {ap_path}") - networks = [Network.from_dbus(ssid, ap_list) for ssid, ap_list in aps.items()] + networks = [Network.from_dbus(ssid, ap_list, ssid == self._tethering_ssid) for ssid, ap_list in aps.items()] networks.sort(key=lambda n: (n.ssid != self._wifi_state.ssid, not self.is_connection_saved(n.ssid), -n.strength, n.ssid.lower())) self._networks = networks From 8d0cb9c8cfd9efd03e8b9cd8f851fcfe5d844200 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 23 Feb 2026 01:31:06 -0800 Subject: [PATCH 3/7] Unified label fix scroll fade (#37346) * disable forget for tethering * nets * put in wifiman * batch * revert * clean up --- system/ui/widgets/label.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/ui/widgets/label.py b/system/ui/widgets/label.py index cb0cf66b144e536..865c8b38c3fb3ef 100644 --- a/system/ui/widgets/label.py +++ b/system/ui/widgets/label.py @@ -753,7 +753,12 @@ def _render(self, _): # draw black fade on left and right fade_width = 20 rl.draw_rectangle_gradient_h(int(self._rect.x + self._rect.width - fade_width), int(self._rect.y), fade_width, int(self._rect.height), rl.BLANK, rl.BLACK) - if self._scroll_state != ScrollState.STARTING: + + # stop drawing left fade once text scrolls past + text_width = visible_sizes[0].x if visible_sizes else 0 + first_copy_in_view = self._scroll_offset + text_width > 0 + draw_left_fade = self._scroll_state != ScrollState.STARTING and first_copy_in_view + if draw_left_fade: rl.draw_rectangle_gradient_h(int(self._rect.x), int(self._rect.y), fade_width, int(self._rect.height), rl.BLACK, rl.BLANK) rl.end_scissor_mode() From c16879f2b82178742a3cec8def3ee45faebf833c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 23 Feb 2026 01:40:56 -0800 Subject: [PATCH 4/7] mici ui: fix missing home show event (#37347) fix missing --- selfdrive/ui/mici/layouts/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/ui/mici/layouts/main.py b/selfdrive/ui/mici/layouts/main.py index f6dbad89a143544..dc01aba56f50c71 100644 --- a/selfdrive/ui/mici/layouts/main.py +++ b/selfdrive/ui/mici/layouts/main.py @@ -62,6 +62,12 @@ def _setup_callbacks(self): self._onroad_layout.set_click_callback(lambda: self._scroll_to(self._home_layout)) device.add_interactive_timeout_callback(self._on_interactive_timeout) + def show_event(self): + self._scroller.show_event() + + def hide_event(self): + self._scroller.hide_event() + def _scroll_to(self, layout: Widget): layout_x = int(layout.rect.x) self._scroller.scroll_to(layout_x, smooth=True) From 0a14e198083b00763c3f20702da8655ccb322d66 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 23 Feb 2026 09:45:29 -0800 Subject: [PATCH 5/7] CI: use setup action on macOS (#37352) --- .github/workflows/setup/action.yaml | 14 +++++++++++--- .github/workflows/tests.yaml | 17 ++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/setup/action.yaml b/.github/workflows/setup/action.yaml index 56f0096450ef127..958f60d2ead290c 100644 --- a/.github/workflows/setup/action.yaml +++ b/.github/workflows/setup/action.yaml @@ -38,10 +38,18 @@ runs: uses: ./.github/workflows/auto-cache with: path: /tmp/scons_cache - key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} + key: scons-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} restore-keys: | - scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }} - scons-${{ runner.arch }} + scons-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }} + scons-${{ runner.os }}-${{ runner.arch }} + # venv cache + - id: venv-cache + uses: ./.github/workflows/auto-cache + with: + path: ${{ github.workspace }}/.venv + key: venv-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock') }} + restore-keys: | + venv-${{ runner.os }}-${{ runner.arch }} - shell: bash name: Run setup run: ./tools/op.sh setup diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 92cdd23768aa38b..ff4fc390940c50f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -66,22 +66,9 @@ jobs: - uses: actions/checkout@v6 with: submodules: true - - run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV - - name: Install dependencies - run: ./tools/mac_setup.sh - env: - HOMEBREW_DISPLAY_INSTALL_TIMES: 1 - - run: git lfs pull - - name: Getting scons cache - uses: ./.github/workflows/auto-cache - with: - path: /tmp/scons_cache - key: scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} - restore-keys: | - scons-${{ runner.arch }}-macos-${{ env.CACHE_COMMIT_DATE }} - scons-${{ runner.arch }}-macos + - uses: ./.github/workflows/setup-with-retry - name: Building openpilot - run: . .venv/bin/activate && scons + run: scons static_analysis: name: static analysis From 7fe6a20566c157ee9e813e921bd8b6c7a011a707 Mon Sep 17 00:00:00 2001 From: Solari Systems Date: Mon, 23 Feb 2026 13:32:26 -0500 Subject: [PATCH 6/7] deleter: handle non-directory entries in log root Clean up stray files, broken symlinks, FIFOs, and other non-directory entries that listdir_by_creation skips. Also wrap the lock-file check in try/except to handle race conditions and permission errors. Fixes commaai30102 Signed-off-by: SolariSystems --- system/loggerd/deleter.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/system/loggerd/deleter.py b/system/loggerd/deleter.py index eb8fd35f21813c4..bf6d7f529cfdb73 100755 --- a/system/loggerd/deleter.py +++ b/system/loggerd/deleter.py @@ -51,6 +51,21 @@ def deleter_thread(exit_event: threading.Event): out_of_percent = get_available_percent(default=MIN_PERCENT + 1) < MIN_PERCENT if out_of_percent or out_of_bytes: + # clean up non-directory entries that listdir_by_creation skips + # (e.g. stray .tar.gz files, broken symlinks) + try: + all_entries = os.listdir(Paths.log_root()) + except OSError: + all_entries = [] + for entry in all_entries: + entry_path = os.path.join(Paths.log_root(), entry) + if not os.path.isdir(entry_path): + try: + cloudlog.info(f"deleting non-directory {entry_path}") + os.remove(entry_path) + except OSError: + cloudlog.exception(f"issue deleting non-directory {entry_path}") + dirs = listdir_by_creation(Paths.log_root()) preserved_dirs = get_preserved_segments(dirs) @@ -58,7 +73,11 @@ def deleter_thread(exit_event: threading.Event): for delete_dir in sorted(dirs, key=lambda d: (d in DELETE_LAST, d in preserved_dirs)): delete_path = os.path.join(Paths.log_root(), delete_dir) - if any(name.endswith(".lock") for name in os.listdir(delete_path)): + try: + if any(name.endswith(".lock") for name in os.listdir(delete_path)): + continue + except OSError: + cloudlog.exception(f"issue listing {delete_path}") continue try: From ecad558224eaf5dfb2475fe7ba47274ea7d2825a Mon Sep 17 00:00:00 2001 From: Solari Systems Date: Mon, 23 Feb 2026 13:32:33 -0500 Subject: [PATCH 7/7] deleter: add robustness tests for non-standard entries Tests the deleter with stray files (.tar.gz), broken symlinks, valid symlinks to files, empty files, dotfiles, FIFOs, and mixed combinations of all entry types alongside normal segments. Signed-off-by: SolariSystems --- system/loggerd/tests/test_deleter.py | 117 +++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/system/loggerd/tests/test_deleter.py b/system/loggerd/tests/test_deleter.py index 6222ea253ba0db5..100b3f3b67f7143 100644 --- a/system/loggerd/tests/test_deleter.py +++ b/system/loggerd/tests/test_deleter.py @@ -1,3 +1,4 @@ +import os import time import threading from collections import namedtuple @@ -115,3 +116,119 @@ def test_no_delete_with_lock_file(self): self.join_thread() assert f_path.exists(), "File deleted when locked" + + # -- robustness tests for non-standard entries in the log root -- + + def _wait_for_path_removal(self, path: Path, timeout: float = 3) -> bool: + """Wait for a path to be removed. Returns True if removed. + Uses os.path.lexists to correctly detect broken symlinks.""" + self.start_thread() + try: + start = time.monotonic() + while os.path.lexists(path) and time.monotonic() - start < timeout: + time.sleep(0.01) + return not os.path.lexists(path) + finally: + self.join_thread() + + def test_delete_stray_file(self): + """A regular file (e.g. tar.gz archive) in the log root should be deleted.""" + from openpilot.system.hardware.hw import Paths + stray = Path(Paths.log_root()) / "2023-09-23.tar.gz" + stray.write_bytes(os.urandom(1024)) + + assert self._wait_for_path_removal(stray), "Stray file was not deleted" + + def test_delete_broken_symlink(self): + """A symlink pointing to a non-existent target should be deleted.""" + from openpilot.system.hardware.hw import Paths + link = Path(Paths.log_root()) / "broken-link" + link.symlink_to("/does/not/exist") + + assert self._wait_for_path_removal(link), "Broken symlink was not deleted" + + def test_delete_valid_symlink_to_file(self): + """A symlink pointing to a real file should be removed (unlinked).""" + from openpilot.system.hardware.hw import Paths + target = Path(Paths.log_root()) / "target.txt" + target.write_bytes(b"data") + link = Path(Paths.log_root()) / "link-to-file" + link.symlink_to(target) + + assert self._wait_for_path_removal(link), "Valid file symlink was not deleted" + + def test_delete_empty_file(self): + """A zero-byte file should be deleted.""" + from openpilot.system.hardware.hw import Paths + empty = Path(Paths.log_root()) / "empty_file" + empty.touch() + + assert self._wait_for_path_removal(empty), "Empty file was not deleted" + + def test_delete_hidden_file(self): + """A dotfile should be deleted.""" + from openpilot.system.hardware.hw import Paths + hidden = Path(Paths.log_root()) / ".hidden_temp" + hidden.write_bytes(b"hidden") + + assert self._wait_for_path_removal(hidden), "Hidden file was not deleted" + + def test_delete_fifo(self): + """A named pipe (FIFO) should be deleted.""" + from openpilot.system.hardware.hw import Paths + fifo = Path(Paths.log_root()) / "test.fifo" + os.mkfifo(fifo) + + assert self._wait_for_path_removal(fifo), "FIFO was not deleted" + + def test_stray_files_deleted_before_segments(self): + """Non-directory entries should be cleaned up alongside segment dirs.""" + from openpilot.system.hardware.hw import Paths + + stray = Path(Paths.log_root()) / "stray_backup.tar.gz" + stray.write_bytes(os.urandom(512)) + + seg_path = self.make_file_with_data(self.seg_dir, self.f_type) + + self.start_thread() + try: + with Timeout(3, "Timeout waiting for cleanup"): + while stray.exists() or seg_path.exists(): + time.sleep(0.01) + finally: + self.join_thread() + + def test_mixed_entries_no_crash(self): + """Deleter should handle a mix of normal segments, stray files, symlinks, + and empty directories without crashing.""" + from openpilot.system.hardware.hw import Paths + root = Path(Paths.log_root()) + + # normal segment directory + seg_path = self.make_file_with_data(self.seg_format.format(0), self.f_type) + + # stray regular files + (root / "backup.tar.gz").write_bytes(os.urandom(256)) + (root / "notes.txt").write_bytes(b"test") + (root / ".DS_Store").write_bytes(b"\x00" * 32) + + # broken symlink + (root / "dead-link").symlink_to("/nonexistent/path") + + # empty directory (not a segment) + (root / "tmp_work").mkdir() + + # FIFO + os.mkfifo(root / "pipe") + + self.start_thread() + try: + with Timeout(5, "Timeout waiting for mixed cleanup"): + # wait for all non-directory entries to be cleaned up + while any(os.path.lexists(root / f) for f in ["backup.tar.gz", "notes.txt", ".DS_Store", "dead-link", "pipe"]): + time.sleep(0.01) + # segment should also be deleted eventually + while seg_path.exists(): + time.sleep(0.01) + finally: + self.join_thread()