From d1c0a988d324587123f398c24c24619a2f6d38f2 Mon Sep 17 00:00:00 2001 From: null Date: Fri, 22 May 2026 01:19:14 -0500 Subject: [PATCH] fix(scripts: imports all / stay in provisioning --- backend/app/services/openclaw/provisioning_db.py | 4 ++-- .../components/gateways/GatewayAgentImportDialog.tsx | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/backend/app/services/openclaw/provisioning_db.py b/backend/app/services/openclaw/provisioning_db.py index 15f8e68..4dc4f0f 100644 --- a/backend/app/services/openclaw/provisioning_db.py +++ b/backend/app/services/openclaw/provisioning_db.py @@ -867,7 +867,7 @@ class AgentLifecycleService(OpenClawDBService): @classmethod def with_computed_status(cls, agent: Agent) -> Agent: now = utcnow() - if agent.status in {"deleting", "updating"}: + if agent.status in {"deleting", "updating", "offline"}: return agent if agent.last_seen_at is None: agent.status = "provisioning" @@ -1432,7 +1432,7 @@ class AgentLifecycleService(OpenClawDBService): ) -> AgentRead: if status_value: agent.status = status_value - elif agent.status == "provisioning": + elif agent.status in {"provisioning", "offline"}: agent.status = "online" agent.last_seen_at = utcnow() # Successful check-in ends the current wake escalation cycle. diff --git a/frontend/src/components/gateways/GatewayAgentImportDialog.tsx b/frontend/src/components/gateways/GatewayAgentImportDialog.tsx index cc2946a..29d2e14 100644 --- a/frontend/src/components/gateways/GatewayAgentImportDialog.tsx +++ b/frontend/src/components/gateways/GatewayAgentImportDialog.tsx @@ -77,14 +77,7 @@ export function GatewayAgentImportDialog({ ), [previewQuery.data?.candidates], ); - const defaultSelectedAgentIds = useMemo( - () => - new Set( - importableCandidates.map((candidate) => candidate.gateway_agent_id), - ), - [importableCandidates], - ); - const selectedAgentIds = manualSelectedAgentIds ?? defaultSelectedAgentIds; + const selectedAgentIds = manualSelectedAgentIds ?? new Set(); const importMutation = useMutation< GatewayAgentImportResponse, @@ -122,7 +115,7 @@ export function GatewayAgentImportDialog({ return; } setManualSelectedAgentIds((prev) => { - const next = new Set(prev ?? selectedAgentIds); + const next = new Set(prev ?? new Set()); if (next.has(candidate.gateway_agent_id)) { next.delete(candidate.gateway_agent_id); } else {