Skip to content

Allow a configurable Agent Profile to power Huabu functional workflows #203

Description

@mydmdm

Summary

Allow users to choose an Agent Profile in Global Settings as Huabu's functional Agent: the Agent that executes product-level AI workflows such as Make Summary, memory extraction/maintenance, and future Huabu-assisted operations.

The selected Profile may be Huabu's built-in huabu Profile or a Bring Your Own Agent (BYOA) external Profile. The built-in Agent becomes one selectable implementation rather than a hard-coded execution path.

Motivation

Huabu currently has product features whose orchestration is coupled to the built-in Agent/runtime. Users who prefer an external Agent should be able to use it throughout Huabu, not only in explicit Agent Node conversations. A single configured functional-Agent identity provides a coherent default while retaining the built-in experience as a supported option.

User experience

  • Add a Global Setting for the Huabu functional Agent Profile.
  • List all eligible Profiles, including the built-in huabu Profile and supported BYOA Profiles.
  • Use the selected Profile for supported product workflows, initially including at least:
    • Make Summary and related summarization actions.
    • Memory extraction, organization, retrieval-assisted maintenance, or other Agent-backed memory workflows.
    • Additional built-in-Agent features after they are inventoried and explicitly migrated.
  • Clearly distinguish this global functional default from the Profile selected for a specific Agent Node or conversation.
  • Show which Profile will execute an action where cost, privacy, placement, latency, or availability may matter.
  • Provide an explicit way to return to the built-in huabu Profile.

Required design and inventory

Before implementation, inventory every user-visible and background workflow that currently invokes the built-in Huabu Agent or assumes its model/provider/tooling. For each workflow, classify whether it:

  • Can run through the generic Agent Profile contract unchanged.
  • Requires Huabu capabilities/tools to be exposed to external Agents.
  • Requires structured output, deterministic orchestration, privileged server access, or a specialized fallback.
  • Must remain server-owned rather than delegated to an arbitrary Profile.
  • Is interactive, background, scheduled, retryable, or attached to a specific Space/Node.

Define one canonical functional-workflow invocation contract rather than adding per-feature Profile switches.

Behavior and lifecycle

  • Persist the selected stable Profile ID in Global Settings; do not use display names as identity.
  • Define whether the setting is user-, installation-, or deployment-scoped and how it behaves across Web/Desktop clients and remote Servers.
  • Resolve the effective Profile when a workflow starts and persist enough execution identity for audit, retry, and recovery.
  • Existing in-flight work must not silently switch Profiles when the setting changes.
  • Profile rename should preserve selection. Profile deletion, unavailability, disconnected agentlet, unsupported capability, or failed startup must be explicit.
  • Do not silently execute with a different Profile. Any fallback to huabu must be a deliberate, visible user policy rather than an implicit success-shaped fallback.
  • Read-only UI actions must not realize an external workload. Realization begins only when the functional workflow is invoked.
  • Define cancellation, timeout, retry, idempotency, concurrency, and result persistence for background workflows.

Capability and security requirements

  • External Profiles must receive only the tools and Space context required by the invoked workflow.
  • Preserve Space, tenant, user, and Node authorization boundaries.
  • Keep provider credentials and Huabu integration secrets server-side.
  • Apply capability allowlists, validation, audit attribution, cost/resource limits, and safe result handling.
  • Treat Agent output as untrusted. Validate required structured results before applying them to Space content or memory.
  • Make prompt/skill selection explicit and versioned so a Profile change does not bypass workflow-specific instructions or policy.
  • Do not grant a functional Agent broader RFS or filesystem authority merely because it is globally selected.

Dependencies and related issues

Acceptance criteria

  • Global Settings allows selecting the built-in huabu Profile or an eligible external Profile as the functional Agent.
  • The stable selection persists at the documented scope and hydrates consistently across supported clients.
  • Make Summary and the agreed memory workflows execute through the selected Profile using one canonical invocation path.
  • The workflow records the effective Profile/placement identity and does not change it mid-execution.
  • Changing, renaming, deleting, disconnecting, or making the selected Profile unavailable has explicit behavior without silent fallback.
  • External Profiles receive only workflow-scoped context and capabilities; secrets remain server-side and structured outputs are validated before mutation.
  • Unsupported Profile capabilities are detected before or during invocation with actionable errors.
  • Built-in huabu behavior remains available and compatible.
  • Regression coverage includes built-in and external Profiles, reload/settings hydration, remote execution placement, Profile lifecycle changes, unavailable capabilities, cancellation/retry, concurrent workflows, invalid Agent output, and authorization boundaries.
  • Architecture documentation describes the functional-Agent role, settings ownership, invocation contract, capability boundary, lifecycle, fallback policy, and migrated workflow inventory.

Activity

  1. mydmdm commented on Sep 22, 2026

    @mydmdm
    ContributorAuthor

    Confirmed permission contract and design clarifications (2026-09-22)

    Recorded at the user's explicit request after the #203 design discussion. This comment supersedes conflicting permission assumptions in the original issue and earlier proposals; it records agreed design, not a claim that all behavior is implemented or authorization to begin the remaining migration.

    Personal-tool trust model

    Huabu is a personal tool whose user trusts the Agents they configure. Do not introduce per-Agent permission matrices, separate background authorization policies, or a fine-grained permission framework as prerequisites for functional-workflow migration.

    1. New automatically discovered Profiles default to allow-all only when the wrapper explicitly supports it. Users can turn it off through Edit. Do not guess flags for Custom commands or treat unknown capability support as supported. This changes defaults for newly created automatic Profiles only: do not automatically rewrite existing Profiles, migrate their permissions, or change already-realized execution snapshots.
    2. Behavior is primarily directed by prompts. Huabu supplies bootstrap, Space instructions where applicable, and task-specific instructions when constructing the execution's WorkloadSpec. These describe the intended tools and scope of work; they are behavioral instructions, not enforced isolation and cannot override the harness's own restrictions.
    3. Profiles do not bind a tool set or Huabu permission policy. A Profile describes the Agent's launch configuration and placement; its wrapper describes and adapts supported harness configuration. Huabu Server owns the execution-specific context, interface instructions, and access credentials. Agenetes transports/delivers the generic preamble and execution configuration rather than interpreting Huabu business permissions.
    4. Credential-injection refinement is deferred until needed. An execution that does not need RFS can eventually omit its RFS credentials as well as the corresponding bootstrap. Today Agentlet injects its daemon token automatically, and child processes inherit environment variables; effective opt-out would have to cover both paths. Do not claim that merely omitting a URL or instruction removes current access. Implement this small execution-time distinction when a concrete workflow requires it, not as a prerequisite or a new Profile permissions framework. This is not a same-user local-process sandbox.
    5. Background execution honors the selected Profile rather than silently escalating. Do not turn allow-all back on when the user has disabled it. Requests requiring authorization must be surfaced through an explicit outcome or existing interaction mechanism, not hang indefinitely or be reported as success. Reuse existing execution/cancellation/timeout mechanisms; exact workflow behavior can be settled when that workflow is migrated.
    6. Existing basic security and result validation remain. Preserve authentication, credential protection, path safety, input validation, execution attribution, and validation of Agent output before host-owned writes. Simplifying the permission model does not remove these controls. If stricter restrictions become necessary later, use the exposed tool set and tool/interface-side enforcement rather than pretending prompt instructions enforce isolation.

    Consequently, the original issue's fine-grained capability/authorization language must not be interpreted as requiring a new scoped-grant system before #203 can proceed. #110 remains an independently scoped capability-enablement workstream; it is not absorbed into this work.

    Existing execution architecture

    Reuse the existing Profile + Agenetes workload/handle/driver execution path. There is already a unified execution layer and an Agent conversation invocation service. The remaining gap is that product functions such as content enrichment and memory still call built-in inference directly; migrate these callers rather than preemptively adding a parallel workflow framework or another generic execution entry point.

    Previously confirmed end goal and remaining decisions

    The user's previously clarified end goal is external-agent-only, agent-agnostic Huabu, without built-in pi-ai inference or a separate Huabu model-provider login. This supersedes the original issue's assumption that built-in huabu must remain a permanent selectable implementation. It does not authorize removing the current implementation before its remaining workflows and historical-session behavior have been addressed.

    The remaining design discussion concerns historical built-in conversation handling, the staged retirement of built-in capabilities/provider settings, and the concrete first production migration slice. The suggested first slice is existing text content enrichment (summary/title/keywords); that migration order is a proposal, not an approved implementation. No production migration, historical-session rewrite, RFS credential opt-out, or built-in retirement is authorized by this comment. The current request authorizes recording these decisions only; existing bounded implementation authorizations remain unchanged.

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