diff --git a/backend/apps/subscription/free_trial.py b/backend/apps/subscription/free_trial.py index 8ae35069..91047875 100644 --- a/backend/apps/subscription/free_trial.py +++ b/backend/apps/subscription/free_trial.py @@ -177,6 +177,12 @@ async def arm_free_trial(settings_obj) -> dict: settings_obj.connection_mode = "free-trial" settings_obj.free_trial_token = data.get("trial_token") settings_obj.openswarm_proxy_url = base + # The free lane only routes Claude-family ids (dispatch needs api_type=anthropic). + # A leftover non-Claude pick (e.g. gemini) would skip the proxy and fail, so snap + # to Haiku, which is the tier the cloud serves the free run as anyway. + cur = getattr(settings_obj, "default_model", "") or "" + if not cur.startswith(("sonnet", "haiku", "opus")): + settings_obj.default_model = "haiku" await save_settings_async(settings_obj) await _sync_routing(settings_obj) return {"armed": True, "runs_remaining": remaining, "runs_limit": settings_obj.free_trial_runs_limit}