-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[Feature]: Gateway — bridge DeviceRegistry ↔ NodeRegistry by device_id #6497
Copy link
Copy link
Closed
Labels
desktopDesktop app (Tauri) — menu bar, dashboard parity, macOS integrationsDesktop app (Tauri) — menu bar, dashboard parity, macOS integrationsenhancementNew feature or requestNew feature or requestgatewayAuto scope: src/gateway/** changed.Auto scope: src/gateway/** changed.priority:p1High priorityHigh priorityrisk: highAuto risk: security/runtime/gateway/tools/workflows.Auto risk: security/runtime/gateway/tools/workflows.runtimeAuto scope: src/runtime/** changed.Auto scope: src/runtime/** changed.securityAuto scope: src/security/** changed.Auto scope: src/security/** changed.status:acceptedRFC or work item accepted and ratified by the team.RFC or work item accepted and ratified by the team.status:no-staleExempt from the 60-day stale auto-close policy.Exempt from the 60-day stale auto-close policy.tauriTauri shell, native bindings, build/packagingTauri shell, native bindings, build/packaging
Milestone
Metadata
Metadata
Assignees
Labels
desktopDesktop app (Tauri) — menu bar, dashboard parity, macOS integrationsDesktop app (Tauri) — menu bar, dashboard parity, macOS integrationsenhancementNew feature or requestNew feature or requestgatewayAuto scope: src/gateway/** changed.Auto scope: src/gateway/** changed.priority:p1High priorityHigh priorityrisk: highAuto risk: security/runtime/gateway/tools/workflows.Auto risk: security/runtime/gateway/tools/workflows.runtimeAuto scope: src/runtime/** changed.Auto scope: src/runtime/** changed.securityAuto scope: src/security/** changed.Auto scope: src/security/** changed.status:acceptedRFC or work item accepted and ratified by the team.RFC or work item accepted and ratified by the team.status:no-staleExempt from the 60-day stale auto-close policy.Exempt from the 60-day stale auto-close policy.tauriTauri shell, native bindings, build/packagingTauri shell, native bindings, build/packaging
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Backlog
Summary
Bridge the two existing registries so the gateway can answer one query: "Is the Mac with device_id X online and does it have capability Y?" Currently
DeviceRegistry(SQLite, persistent identity) andNodeRegistry(in-memory, WS capability dispatch) don't talk to each other.Problem
DeviceRegistrypersists pairing identity but has no concept of online/offline beyondlast_seen(which only updates on HTTP requests).NodeRegistryhas live WS-based capability dispatch but is ephemeral — no persistence, and uses a separatenode_idfrom thedevice_id.Proposal
/ws/nodesWebSocket authenticates with a device's bearer token, treat the device_id == node_id.devicestable:online_since TEXT(RFC3339) — non-null when the device has an active WS connectionnode_id TEXT— populated from the device's UUID on first WS connection/ws/nodesregister: look up device by token_hash, setonline_since = now(), store advertised capabilities.online_since, keep the row.device_registry::is_online(device_id) -> boolanddevice_registry::find_online_with_capability(cap) -> Option<DeviceInfo>for the agent dispatcher to use.Files
crates/zeroclaw-gateway/src/api_pairing.rs— schema migration, new fields, helperscrates/zeroclaw-gateway/src/nodes.rs— bridge logic in the WS handlercrates/zeroclaw-gateway/src/lib.rs— AppState wiringAcceptance
/ws/nodeswith bearer token → its device row getsonline_sincepopulated andcapabilitiessynced.online_sinceclears within ~5s; row persists.device_registryregression tests prove migration + bridge logic.Related
feat/desktop-onboarding.