Update flm_workspace.py

This commit is contained in:
firestar5683
2026-08-02 20:26:23 -05:00
parent 428d47c918
commit 6dd4d74ca0
+5 -1
View File
@@ -2895,7 +2895,11 @@ def clear_workspace() -> dict[str, Any]:
params = Params(return_defaults=True)
active_snapshot = _read_json(paths["snapshots"] / "active.json", {})
if params.get_bool("FLMTrialApplied") or (isinstance(active_snapshot, dict) and active_snapshot.get("params")):
raise RuntimeError("Revert or keep the active FLM trial before clearing the workspace.")
params.put_bool("FLMTrialApplied", False)
params.put("FLMActiveProfileId", "")
params.put("FLMActiveOverrides", json.dumps({}, separators=(",", ":")))
_clear_persistent_trial_baseline(params)
Params(memory=True).put_bool("StarPilotTogglesUpdated", True)
removed = []
for key in ("reports", "profiles", "feedback", "snapshots"):