[eric] free-trial: arm gate ignores our own managed Claude node (trial no longer self-clears on relaunch)

This commit is contained in:
ciregenz
2026-06-13 18:09:03 -07:00
parent e4740b74c1
commit 94e17c4b50
+11 -2
View File
@@ -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: