Problem
After #254 enabled remote Agentlets sharing one connection token, Huabu still models the supervised local Agentlet as the only configurable machine:
- there is no durable, owner-visible directory of connected or previously connected Agentlet devices;
- Profile runtime availability is not derived from device connectivity (
selectableProfileIds currently contains every persisted Profile);
- Settings always displays every Profile without distinguishing connected and disconnected target devices;
- Add Agent always binds a new Profile to the supervised local Agentlet and cannot target another connected device;
- the default Agentlet identity is hostname-only, so Windows and WSL on the same host collide.
Desired behavior
Add a small multi-Agentlet device-management layer while preserving Profiles as durable templates and Gateway as the live-connection authority.
Devices
- Persist authenticated Agentlet device metadata in Huabu across server restarts.
- Show a Devices section first in Settings > Agent with online/offline state, hostname, environment/platform, last-seen time, and Profile count.
- Support forgetting a device only when it is offline and has zero Profiles. Do not cascade-delete Profiles or conversation bindings.
- Treat Gateway state as authoritative for whether a device is currently online; the durable registry stores historical display metadata only.
Profiles
- Compute
selectableProfileIds from Profiles whose target device is currently connected.
- Runtime Agent selectors show only selectable Profiles.
- Settings shows connected-device Profiles by default and provides an explicit Show disconnected affordance so stale Profiles remain manageable and deletable.
- Add Agent requires selecting a currently connected device before choosing a harness. Discovery, launch preview, and creation target that selected device.
- The Profile device is immutable after creation and remains read-only while editing.
Device identity
- Replace hostname-only implicit identity with a stable Agentlet installation/device identity persisted locally by Agentlet.
- Carry hostname and a useful environment label (
windows, macos, linux, or wsl, including WSL distribution where available) as display metadata rather than using mutable display information as the primary key.
- Preserve explicit
--agentlet-id as an override.
- Define a deterministic, non-destructive compatibility path for existing hostname-bound Profiles before changing the default identity.
Acceptance criteria
Non-goals
Per-device credentials, enrollment approval, remote installation, automatic Profile reassignment, cascade deletion, device renaming, and token rotation/revocation.
Related
Problem
After #254 enabled remote Agentlets sharing one connection token, Huabu still models the supervised local Agentlet as the only configurable machine:
selectableProfileIdscurrently contains every persisted Profile);Desired behavior
Add a small multi-Agentlet device-management layer while preserving Profiles as durable templates and Gateway as the live-connection authority.
Devices
Profiles
selectableProfileIdsfrom Profiles whose target device is currently connected.Device identity
windows,macos,linux, orwsl, including WSL distribution where available) as display metadata rather than using mutable display information as the primary key.--agentlet-idas an override.Acceptance criteria
Non-goals
Per-device credentials, enrollment approval, remote installation, automatic Profile reassignment, cascade deletion, device renaming, and token rotation/revocation.
Related