mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-20 16:47:40 +02:00
[eric] free-trial: arm gate ignores our own managed Claude node (trial no longer self-clears on relaunch)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user