[eric] free-trial: arm snaps a non-Claude default to Haiku so the free lane actually routes

This commit is contained in:
ciregenz
2026-06-12 14:02:58 -07:00
parent e47a3dbf35
commit 65a5138bfa
+6
View File
@@ -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}