diff --git a/starpilot/system/the_galaxy/flm_workspace.py b/starpilot/system/the_galaxy/flm_workspace.py index e15a792a9c..afbc3dcfaa 100644 --- a/starpilot/system/the_galaxy/flm_workspace.py +++ b/starpilot/system/the_galaxy/flm_workspace.py @@ -3417,7 +3417,16 @@ def revert_trial_profile() -> dict[str, Any]: current_profile_id = params.get("FLMActiveProfileId", encoding="utf-8") or "" revert_snapshot = _find_revert_snapshot(paths, snapshot if isinstance(snapshot, dict) else {}, current_profile_id, params) if revert_snapshot is None: - raise FileNotFoundError("active trial snapshot") + params.put_bool("FLMTrialApplied", False) + params.put("FLMActiveProfileId", "") + params.put("FLMActiveOverrides", json.dumps({}, separators=(",", ":"))) + _clear_persistent_trial_baseline(params) + try: + snapshot_path.unlink() + except FileNotFoundError: + pass + Params(memory=True).put_bool("StarPilotTogglesUpdated", True) + return {"message": "Recovered the incomplete FLM trial; no rollback snapshot was available.", "recovered": True} _apply_param_bundle(params, revert_snapshot["params"]) _clear_persistent_trial_baseline(params) try: