From 13d09735287ddf520997af35830ed6df530f2b56 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:53:47 -0500 Subject: [PATCH] Do not moo --- starpilot/common/starpilot_variables.py | 6 --- .../assets/components/tools/sentry.css | 11 +++++ .../assets/components/tools/sentry.js | 42 ++++++++++++++++--- starpilot/system/the_galaxy/the_galaxy.py | 30 +++++++++++++ 4 files changed, 78 insertions(+), 11 deletions(-) diff --git a/starpilot/common/starpilot_variables.py b/starpilot/common/starpilot_variables.py index bf251e142..73f6c68ae 100644 --- a/starpilot/common/starpilot_variables.py +++ b/starpilot/common/starpilot_variables.py @@ -642,12 +642,6 @@ class StarPilotVariables: toggle.stoppingDecelRate = CP.stoppingDecelRate toggle.vEgoStarting = CP.vEgoStarting toggle.vEgoStopping = CP.vEgoStopping - if toggle.openpilot_longitudinal and toggle.car_make == "toyota": - # Preserve StarPilot's established Toyota stop-state behavior without - # coupling it to the removed FrogsGoMoo controller experiment. - toggle.stoppingDecelRate = 0.01 - toggle.vEgoStarting = 0.1 - toggle.vEgoStopping = 0.5 # Keep stock tuning params synchronized for all device UIs. self._migrate_steer_delay_mode(steerActuatorDelay) diff --git a/starpilot/system/the_galaxy/assets/components/tools/sentry.css b/starpilot/system/the_galaxy/assets/components/tools/sentry.css index f6016b604..f947b36c5 100644 --- a/starpilot/system/the_galaxy/assets/components/tools/sentry.css +++ b/starpilot/system/the_galaxy/assets/components/tools/sentry.css @@ -117,6 +117,17 @@ white-space: nowrap; } +.sentry-button-danger { + border-color: var(--danger-bg); + color: var(--danger-fg); + white-space: nowrap; +} + +.sentry-button-danger:hover:not(:disabled) { + background: var(--danger-bg); + color: var(--color-white); +} + .sentry-action-row { display: flex; flex-wrap: wrap; diff --git a/starpilot/system/the_galaxy/assets/components/tools/sentry.js b/starpilot/system/the_galaxy/assets/components/tools/sentry.js index 91f73a770..4c311cea1 100644 --- a/starpilot/system/the_galaxy/assets/components/tools/sentry.js +++ b/starpilot/system/the_galaxy/assets/components/tools/sentry.js @@ -14,6 +14,7 @@ const state = reactive({ liveCapture: {}, testBusy: false, liveBusy: false, + deleteBusy: false, pushBusy: false, }) @@ -145,6 +146,30 @@ async function sendTestPush() { } } +async function deleteEvent() { + const eventId = String(state.event?.eventId || "") + if (!eventId || state.deleteBusy) return + if (!window.confirm("Delete this Sentry event and its camera images? This cannot be undone.")) return + + state.deleteBusy = true + try { + const response = await fetch(galaxyPath(`/api/sentry/events/${encodeURIComponent(eventId)}`), { + method: "DELETE", + }) + const payload = await readJsonResponse(response) + if (!response.ok) { + showSnackbar(payload.error || "Sentry event deletion failed.") + return + } + state.event = {} + showSnackbar("Sentry event deleted.") + } catch (error) { + showSnackbar(error.message || "Network error — is the device reachable?") + } finally { + state.deleteBusy = false + } +} + function renderEvent() { const event = state.event || {} if (!event.eventId) return html`

No Sentry events recorded yet.

` @@ -271,11 +296,18 @@ export function SentryMode() {

Latest Event

Events refresh automatically every five seconds.

- ${remote ? "" : html` - - `} +
+ ${remote ? "" : html` + + `} + ${() => state.event?.eventId ? html` + + ` : ""} +
${() => renderEvent()} diff --git a/starpilot/system/the_galaxy/the_galaxy.py b/starpilot/system/the_galaxy/the_galaxy.py index 02afc5f5d..a278b9cc0 100644 --- a/starpilot/system/the_galaxy/the_galaxy.py +++ b/starpilot/system/the_galaxy/the_galaxy.py @@ -7031,6 +7031,36 @@ def setup(app): "lastEvent": _public_sentry_event(last_event) if isinstance(last_event, dict) else {}, }) + @app.route("/api/sentry/events/", methods=["DELETE"]) + def delete_sentry_event(event_id): + if not params.get_bool("IsOffroad"): + return jsonify({"error": "Sentry events can only be deleted while parked."}), 409 + if not event_id or event_id in {".", ".."} or Path(event_id).name != event_id: + return jsonify({"error": "Invalid Sentry event ID."}), 400 + + deleted_storage = False + for root in _sentry_event_roots(): + directory = (root / event_id).resolve() + if root not in directory.parents or not directory.is_dir(): + continue + shutil.rmtree(directory) + deleted_storage = True + + raw_event = params.get("SentryModeLastEvent", encoding="utf-8") or "{}" + try: + current_event = raw_event if isinstance(raw_event, dict) else json.loads(raw_event) + except (TypeError, ValueError, json.JSONDecodeError): + current_event = {} + + cleared_latest = isinstance(current_event, dict) and str(current_event.get("eventId") or "") == event_id + if cleared_latest: + params.remove("SentryModeLastEvent") + + if not deleted_storage and not cleared_latest: + return jsonify({"error": "Sentry event not found."}), 404 + + return jsonify({"deleted": True, "eventId": event_id}) + @app.route("/api/sentry/images//", methods=["GET"]) def sentry_image(event_id, filename): image_path = _sentry_image_path(event_id, filename)