Skip to content

Commit ead2e67

Browse files
Xuwznlncursoragent
andcommitted
fix(ws): stop reporting actions in host ready
Use action lock reports as the source of callable actions so host readiness does not publish mismatched action sets. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 82ac5af commit ead2e67

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

unilabos/app/ws_client.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,32 +1799,22 @@ def publish_host_ready(self) -> None:
17991799
machine_name = BasicConfig.machine_name
18001800

18011801
try:
1802-
# 获取设备信息
1802+
# host_node_ready 不再上报 actions:设备可调用动作以 report_action_lock 为准
1803+
# (来源 _action_value_mappings,覆盖 auto-/UniLabJsonCommand 等全量动作,且借 FIFO
1804+
# 在本消息之前先行发送)。host_ready 仅声明设备在线与归属,避免与锁口径不一致。
18031805
for device_id, namespace in host_node.devices_names.items():
18041806
device_key = (
18051807
f"{namespace}/{device_id}" if namespace.startswith("/") else f"/{namespace}/{device_id}"
18061808
)
18071809
is_online = device_key in host_node._online_devices
18081810

1809-
# 获取设备的动作信息
1810-
actions = {}
1811-
for action_id, client in host_node._action_clients.items():
1812-
# action_id 格式: /namespace/device_id/action_name
1813-
if device_id in action_id:
1814-
action_name = action_id.split("/")[-1]
1815-
actions[action_name] = {
1816-
"action_path": action_id,
1817-
"action_type": str(type(client).__name__),
1818-
}
1819-
18201811
devices.append(
18211812
{
18221813
"device_id": device_id,
18231814
"namespace": namespace,
18241815
"device_key": device_key,
18251816
"is_online": is_online,
18261817
"machine_name": host_node.device_machine_names.get(device_id, machine_name),
1827-
"actions": actions,
18281818
}
18291819
)
18301820

0 commit comments

Comments
 (0)