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:
+3
-2
@@ -301,12 +301,13 @@ class CloudStore:
|
||||
connection.execute(
|
||||
"""
|
||||
create table if not exists pooled_devices (
|
||||
device_id text primary key,
|
||||
device_id text not null,
|
||||
host_id text not null,
|
||||
driver_type text not null,
|
||||
status text not null,
|
||||
capability_tags_json text not null,
|
||||
synced_at text
|
||||
synced_at text,
|
||||
primary key (host_id, device_id)
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user