Skip to content

Manage multiple Agentlet devices and device-scoped Profiles #267

Description

@mydmdm

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

  • Device metadata survives Huabu restart; online state reflects the live Gateway.
  • Connection and disconnection update status and last-seen metadata.
  • Online devices and devices referenced by Profiles cannot be forgotten.
  • Offline-device Profiles are excluded from runtime selectors but remain accessible in Settings.
  • Add Agent discovers and validates against the selected online device and persists that immutable target.
  • Windows and WSL on one hostname can connect concurrently with stable distinct identities.
  • Existing hostname-bound Profiles have a tested compatibility/migration path.
  • Device and Profile APIs use shared schemas and owner authorization.
  • Agentlet, Agenetes, server, and Settings tests cover the lifecycle.
  • Agent Profile and connection architecture documentation is updated.

Non-goals

Per-device credentials, enrollment approval, remote installation, automatic Profile reassignment, cascade deletion, device renaming, and token rotation/revocation.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions