models: auto-download default model (CD210) when no qcom bundle selected

Mirror upstream first-boot behavior: with nothing selected on qcom, queue
DEFAULT_MODEL_REF so the default model (CD210) is downloaded and activated
automatically, instead of falling back to the stock selfdrive modeld (which
needs a compile-format pkl that is not shipped here).
This commit is contained in:
Comma Device
2026-09-04 19:44:24 +08:00
parent 027d768017
commit 7d7508b968
+11
View File
@@ -334,6 +334,17 @@ class ModelManagerSP:
if DEFAULT_MODEL_REF:
self.params.put("ModelManager_DownloadRef", DEFAULT_MODEL_REF)
# First-boot default: no qcom bundle selected -> auto-use the default
# model (DEFAULT_MODEL_REF, i.e. CD210) instead of falling back to the
# stock selfdrive modeld. Mirrors upstream: the default model runs on
# first boot without any user selection (downloaded once, then active).
if (get_selected_bundle(self.params, "qcom") is None
and self.params.get("ModelManager_DownloadRef") is None
and not self.chestnut_present):
from openpilot.sunnypilot.models.model_name import DEFAULT_MODEL_REF
if DEFAULT_MODEL_REF:
self.params.put("ModelManager_DownloadRef", DEFAULT_MODEL_REF)
self._process_download_requests()
if self.params.get("ModelManager_ClearCache"):