fix(device-pool): scope primary key by host and thread through capability_tags
- pooled_devices primary key changed from device_id alone to (host_id, device_id), so two hosts reporting the same local device_id no longer crash sync_host_devices() with an uncaught sqlite3.IntegrityError. - Device gained a capability_tags field so DevicePool.sync_host_devices() can actually populate PooledDevice.capability_tags from a real host sync instead of always falling back to an empty list. openspec: device-pool capability, archived change cloud-runtime
This commit is contained in:
+1
-1
@@ -106,7 +106,7 @@ class DevicePool:
|
||||
synced_at: datetime,
|
||||
) -> PooledDevice:
|
||||
raw_status = device.status if device.status in _HOST_REPORTED_STATUSES else "idle"
|
||||
tags = list(getattr(device, "capability_tags", []) or [])
|
||||
tags = list(device.capability_tags or [])
|
||||
return PooledDevice(
|
||||
device_id=device.id,
|
||||
host_id=host_id,
|
||||
|
||||
Reference in New Issue
Block a user