From 94e17c4b5062fd0915749602709a9f49ba2e8808 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sat, 13 Jun 2026 18:09:03 -0700 Subject: [PATCH] [eric] free-trial: arm gate ignores our own managed Claude node (trial no longer self-clears on relaunch) --- backend/apps/subscription/free_trial.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/apps/subscription/free_trial.py b/backend/apps/subscription/free_trial.py index 79399533..4efb7b77 100644 --- a/backend/apps/subscription/free_trial.py +++ b/backend/apps/subscription/free_trial.py @@ -100,12 +100,21 @@ async def _has_connected_subscription() -> bool: connections live in 9Router, not settings, so the sync check above misses them; this catches a sub connected while the trial was armed.""" try: - from backend.apps.nine_router import is_running as _9r_running, get_providers as _9r_providers + from backend.apps.nine_router import ( + is_running as _9r_running, + get_providers as _9r_providers, + NINE_ROUTER_CLAUDE_PRO_NAME, + ) if not _9r_running(): return False conns = await _9r_providers() + # Exclude our OWN managed node: the free trial registers itself as a `claude` + # connection here, and counting it would make the trial think a real model is + # connected and clear itself on the next boot (works once, dead on relaunch). return any( - c.get("isActive") and c.get("provider") in ("claude", "codex", "gemini-cli") + c.get("isActive") + and c.get("provider") in ("claude", "codex", "gemini-cli") + and c.get("name") != NINE_ROUTER_CLAUDE_PRO_NAME for c in conns ) except Exception: