From 65a5138bfadd2a78c31b597d0ea9996ea84bb98f Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 12 Jun 2026 14:02:58 -0700 Subject: [PATCH] [eric] free-trial: arm snaps a non-Claude default to Haiku so the free lane actually routes --- backend/apps/subscription/free_trial.py | 6 ++++++ 1 file changed, 6 insertions(+) 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}