Skip to content

Remove UI-triggered ACP warm sessions #162

Description

@mydmdm

Problem

Huabu currently starts an ACP session before the first real Agent interaction to populate slash commands and session metadata. The UI calls POST /api/acp/threads/:threadId/session, which launches or resumes the Profile-backed harness so commands, models, modes, and config options can be observed. Selector set-RPCs may then call agenetes.create() with a transport-minimal WorkloadSpec before the canonical fixed-Agent realization path runs. That prematurely persists an incomplete immutable workload identity and can omit Space Prompt and node-specific launch instructions.

The underlying capability catalogue is primarily harness/Profile-associated observation data, while active selections and session state are thread-specific. UI discovery should not require a pre-realization live thread session.

Desired design

  • Populate slash commands and selector catalogues from a GET-only Profile/Harness capability cache.
  • Treat cached values as last-observed data, not guaranteed current session state.
  • On cache miss, render an empty/default UI and allow ordinary chat to proceed; do not start an Agent solely for metadata discovery.
  • Create the real ACP session only on the first explicit interaction: user input or mode/model/config control.
  • Route both control and message entry points through one canonical workload realization pipeline.
  • For fixed Agent Nodes, resolve binding and launch overrides from canonical server-side Canvas state and snapshot the Space Prompt at first explicit interaction.
  • Reconcile UI state and refresh the Profile/Harness cache when the real session publishes commands, models, modes, or config options.
  • Keep explicit thread selections separate from last-observed Profile/Harness values. Never present unconfirmed permission-expanding values such as full access or auto-approve as active.
  • Do not create, infer, migrate, or repair legacy bootstrap-only records; this behavior has not shipped.

Acceptance criteria

  • Opening an Agent Node, reading cached metadata, or opening slash-command UI does not create/resume an ACP session and does not write a durable WorkloadSpec.
  • Cold cache does not block the first user message; metadata appears when the real session reports it.
  • The first control or user message creates exactly one complete canonical WorkloadSpec.
  • A first control freezes the same Space Prompt, binding, recipe, environment, working directory, and node-specific instructions as a first user message.
  • Control requests do not create Chat-V2 turns and do not consume initialPreamble; the first ordinary prompt delivers it once.
  • Subsequent controls mutate driver state without changing the finalized WorkloadSpec.
  • Concurrent first control/message requests converge on one realization.
  • Existing Profile/Harness cache entries seed the UI and are reconciled from live session updates.

Delivery

Implement together with #160 on PR #161.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions