fix(scripts: imports all / stay in provisioning
This commit is contained in:
parent
fe7ce20956
commit
d1c0a988d3
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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<string>();
|
||||
|
||||
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<string>());
|
||||
if (next.has(candidate.gateway_agent_id)) {
|
||||
next.delete(candidate.gateway_agent_id);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue