fix(scripts: imports all / stay in provisioning
This commit is contained in:
parent
fe7ce20956
commit
d1c0a988d3
|
|
@ -867,7 +867,7 @@ class AgentLifecycleService(OpenClawDBService):
|
||||||
@classmethod
|
@classmethod
|
||||||
def with_computed_status(cls, agent: Agent) -> Agent:
|
def with_computed_status(cls, agent: Agent) -> Agent:
|
||||||
now = utcnow()
|
now = utcnow()
|
||||||
if agent.status in {"deleting", "updating"}:
|
if agent.status in {"deleting", "updating", "offline"}:
|
||||||
return agent
|
return agent
|
||||||
if agent.last_seen_at is None:
|
if agent.last_seen_at is None:
|
||||||
agent.status = "provisioning"
|
agent.status = "provisioning"
|
||||||
|
|
@ -1432,7 +1432,7 @@ class AgentLifecycleService(OpenClawDBService):
|
||||||
) -> AgentRead:
|
) -> AgentRead:
|
||||||
if status_value:
|
if status_value:
|
||||||
agent.status = status_value
|
agent.status = status_value
|
||||||
elif agent.status == "provisioning":
|
elif agent.status in {"provisioning", "offline"}:
|
||||||
agent.status = "online"
|
agent.status = "online"
|
||||||
agent.last_seen_at = utcnow()
|
agent.last_seen_at = utcnow()
|
||||||
# Successful check-in ends the current wake escalation cycle.
|
# Successful check-in ends the current wake escalation cycle.
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,7 @@ export function GatewayAgentImportDialog({
|
||||||
),
|
),
|
||||||
[previewQuery.data?.candidates],
|
[previewQuery.data?.candidates],
|
||||||
);
|
);
|
||||||
const defaultSelectedAgentIds = useMemo(
|
const selectedAgentIds = manualSelectedAgentIds ?? new Set<string>();
|
||||||
() =>
|
|
||||||
new Set(
|
|
||||||
importableCandidates.map((candidate) => candidate.gateway_agent_id),
|
|
||||||
),
|
|
||||||
[importableCandidates],
|
|
||||||
);
|
|
||||||
const selectedAgentIds = manualSelectedAgentIds ?? defaultSelectedAgentIds;
|
|
||||||
|
|
||||||
const importMutation = useMutation<
|
const importMutation = useMutation<
|
||||||
GatewayAgentImportResponse,
|
GatewayAgentImportResponse,
|
||||||
|
|
@ -122,7 +115,7 @@ export function GatewayAgentImportDialog({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setManualSelectedAgentIds((prev) => {
|
setManualSelectedAgentIds((prev) => {
|
||||||
const next = new Set(prev ?? selectedAgentIds);
|
const next = new Set(prev ?? new Set<string>());
|
||||||
if (next.has(candidate.gateway_agent_id)) {
|
if (next.has(candidate.gateway_agent_id)) {
|
||||||
next.delete(candidate.gateway_agent_id);
|
next.delete(candidate.gateway_agent_id);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue