Skip to content

ACP: let clients select the session agent #4475

Description

@Chi-teck

Overview

ACP sessions always start with the default agent (root, or the first agent). Please let clients pick the agent, e.g. via an agent config option next to mode, model, and thought_level from #4445.

Motivation

Today the only ways to reach another agent over ACP are agent-switch commands (#4391), one per target agent, or a separate config file per entry agent. Neither shows the agents in the client UI, and a command switch is lost on cold session/load/session/resume.

Proposed solution

  • Advertise an agent select option (team agents with their descriptions) in session/new/load/resume.
  • Handle it in session/set_config_option via the agent-switch code path, and persist it like the model and safety selections.
  • Optionally, add --agent <name> to docker agent serve acp.

Related issues

#4445, #4391, #2576

docker-agent v1.144.0.

Activity

  1. added
    area/sessionsFor features/issues/fixes related to session lifecycle (resume, persistence, export)
    on Sep 25, 2026
  2. gargsajal9 commented on Oct 8, 2026

    @gargsajal9
    Contributor

    I traced the ACP lifecycle and confirmed the current behavior with a focused SQLite/fake-provider test: after switching from root to worker, both cold session/load and cold session/resume reconstruct root. Active resume retains the process-local selection.

    Before implementing, can maintainers confirm this first-slice contract?

    • agent represents the ACP session current conversational/entry agent.
    • Advertise team agents in team order, using stable names as values and configured descriptions in the choices.
    • Persist the selection as ACP-owned session metadata (for example, a namespaced acp.agent attribute), rather than reusing transient Session.AgentName or routing/handoff fields.
    • Restore it before returning cold load/resume configuration or accepting a prompt.
    • Treat a removed or renamed persisted agent as an explicit cold-load error, consistent with stale persisted model overrides, rather than silently falling back.
    • Route config-option and agent-switch command changes through the same persistence helper, with active-work rejection and runtime rollback if persistence fails.
    • Hide the agent selector while work is active, matching the existing volatile model/thought selectors.

    I would keep serve acp --agent, other protocol/UI surfaces, team-default changes, and handoff/background/hook-routing semantics out of the first PR. If the metadata representation or stale-agent policy should differ, I can adapt the implementation plan before changing production code.

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

    area/acparea/sessionsFor features/issues/fixes related to session lifecycle (resume, persistence, export)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions