Skip to content

Allow caller-defined display names for spawned subagents #26112

Open

Description

@schulle01

Summary

Please allow callers to set a stable, user-visible display name when spawning a subagent.

Today, a parent agent can instruct a subagent in the prompt to act under a semantic role name such as Auditor or Librarius, but the platform still assigns an unrelated visible nickname such as Lagrange or Ampere. That makes structured multi-agent workflows harder to audit and explain.

Problem

In structured agent runtimes, subagents often have durable semantic roles, for example:

  • Auditor for review work
  • Librarius for low-effort context/log/research work
  • project-specific workbench agents for bounded browser or document checks

The current behavior separates the semantic role in the prompt from the platform-visible nickname. Users then see a name that does not match the role they asked for, and the parent agent has to explain that e.g. Lagrange is actually acting as Auditor.

This affects:

  • transparency for users supervising multiple agents
  • scanability of agent notifications and audit trails
  • role clarity in long-running or governed multi-agent workflows

Observed behavior

A subagent was spawned with an explicit prompt role Auditor.

The tool response returned a platform nickname Lagrange.

The subagent reported that it received the role name Auditor, but could not see the platform nickname and that the dedicated name was only prompt-instructed, not technically set.

Requested capability

Add a caller-controlled display-name field to subagent creation, for example:

{
  "agent_type": "explorer",
  "model": "gpt-5.4-mini",
  "display_name": "Auditor",
  "message": "Review the assigned runtime change..."
}

Returned metadata could include both the caller-defined display name and the platform nickname:

{
  "agent_id": "...",
  "display_name": "Auditor",
  "platform_nickname": "Lagrange"
}

If uniqueness is required, Codex could render a combined label such as Auditor (Lagrange).

Acceptance criteria

  • spawn_agent or the equivalent subagent API supports a caller-provided display_name field.
  • The chosen display name is visible in tool results, notifications, and agent status surfaces.
  • The spawned subagent can identify its assigned display name without relying only on prompt text.
  • Platform-generated nicknames may still exist internally, but they do not replace the caller-defined role name.
  • If the requested display name is invalid or unavailable, the API returns a clear validation error or deterministic fallback.

Why this matters

The missing capability does not block delegation, but it reduces transparency, auditability, and user trust in structured subagent workflows where names encode responsibilities.

Activity

  1. added
    enhancement
    subagent
    on Jun 3, 2026
  2. github-actions commented on Jun 3, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. schulle01 commented on Jun 3, 2026

    @schulle01
    Author

    Thanks for the duplicate suggestions.

    I think this issue is related but not a duplicate of #24745 / #24863 / #23588.

    Those issues appear to cover rendering bugs where the UI shows raw UUIDs/thread IDs instead of an already available generated nickname or readable label.

    This issue asks for a different capability: allowing the caller of spawn_agent to provide a stable, semantic display_name, such as Auditor or Librarius, and having that name appear in tool results, notifications, and agent status surfaces.

    So #23588 would improve display of existing nicknames, while this request is about caller-controlled naming as part of the subagent API/metadata contract.

  4. iqdoctor commented on Jun 9, 2026

    @iqdoctor

    Cross-linking with #23588 after checking current behavior there: I do not think #23588 fully closes this request.

    #23588 is about a bug in metadata propagation/rendering: Codex already has some friendly nickname/role metadata for spawned subagents, but some live/replayed UI paths still fall back to the raw UUID/thread id. Fixing #23588 should make existing metadata consistently render as something like Ampere [architect] instead of 019e....

    This issue asks for a different API capability: the caller should be able to provide a stable semantic display name such as Auditor or Librarius at spawn time, and have that caller-defined name become part of the subagent metadata contract.

    So the relationship looks like:

    A complete implementation of #26112 would likely depend on the same display surfaces being healthy, so #23588 is a useful prerequisite/foundation. But by itself, #23588 would still leave Codex choosing names like Ampere/Lagrange; it would not let the caller request Auditor as the canonical visible label.

  5. iqdoctor commented on Jun 9, 2026

    @iqdoctor

    Minimal $code-review report

    Review version/scope:

    • Repository: openai/codex
    • Branch: main
    • Commit reviewed: fae270932065355b5d7f197b3f1c72912588369b (fae270932065)
    • Date checked: 2026-06-09
    • Diff reviewed: none / current implementation baseline; this is a pre-implementation risk review for the requested display_name capability.
    • Review method: repo-local $code-review using the code-review-* slices (breaking-changes, testing, context, change-size).

    Consolidated findings:

    1. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_spec.rs:557 — v1 and v2 spawn_agent tool schemas are separate, so adding display_name to only one surface would either miss acceptance or reject calls on the other surface.

    2. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_spec.rs:600 — the v2 schema needs its own optional display_name property and docs; it is not automatically inherited from v1.

    3. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs:190 — v2 SpawnAgentArgs uses #[serde(deny_unknown_fields)], so display_name will be rejected until explicitly parsed.

    4. [HIGH] codex-rs/core/src/tools/handlers/multi_agents_spec.rs:363 — existing tool results expose nickname; do not replace or overload it with display_name, because Allow caller-defined display names for spawned subagents #26112 asks to preserve both caller-defined display name and platform nickname.

    5. [LOW] codex-rs/core/src/tools/handlers/multi_agents_spec.rs:381 — the hidden-metadata result shape currently omits nickname-like metadata. Decide whether caller-provided display_name is exempt from this privacy/config flag or whether the acceptance criteria need to mention the flag.

    6. [HIGH] codex-rs/protocol/src/protocol.rs:2583 — SubAgentSource::ThreadSpawn currently stores agent_nickname / agent_role only. A distinct optional display_name field is needed so caller display identity does not overwrite platform nickname.

    7. [MEDIUM] codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:137 — app-server Thread metadata likewise only carries nickname/role. Add additive displayName while preserving existing fields.

    8. [HIGH] codex-rs/core/src/agent/registry.rs:221 — preferred nickname reservation currently accepts arbitrary strings. Caller-provided display names need validation: trim, reject empty/control/newline values, enforce a small max length, and define duplicate/unavailable behavior.

    9. [HIGH] codex-rs/core/src/session_prefix.rs:21 — agent names are formatted into model-visible session context. A caller-controlled display_name must be bounded and safe before being injected.

    10. [HIGH] codex-rs/core/src/context/environment_context.rs:584 — subagent metadata reaches <environment_context>. Add tests/validation for newline, tag-like, and oversized display names to avoid context injection or unbounded context growth.

    11. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_common.rs:137 — validation should live at the spawn parsing/control boundary, not only in UI rendering.

    12. [MEDIUM] codex-rs/state/src/model/thread_metadata.rs:74 — state DB metadata needs an optional/defaulted display-name field so old records deserialize and new records preserve the value.

    13. [MEDIUM] codex-rs/thread-store/src/types.rs:390 — persisted thread metadata stores nickname/role/path only; runtime-only display names would disappear on replay/resume.

    14. [MEDIUM] codex-rs/thread-store/src/types.rs:496 — thread metadata patch/update types need display-name support too, or updates will drop the field.

    15. [MEDIUM] codex-rs/core/src/agent/control/spawn.rs:645 — resume restores nickname/role only; add display-name restore logic and tests.

    16. [MEDIUM] codex-rs/protocol/src/protocol.rs:3838 — CollabAgentSpawnEndEvent lacks display-name metadata. Tool output alone is insufficient because notifications/status surfaces also need the caller-defined label.

    17. [MEDIUM] codex-rs/protocol/src/protocol.rs:3911 — subagent activity/status events also need display-name propagation or activity rendering will remain path/id-based.

    18. [MEDIUM] codex-rs/app-server-protocol/src/protocol/event_mapping.rs:104 — spawn-end event mapping currently builds app-server items without propagating name metadata. Extend the item/state and generated schemas.

    19. [MEDIUM] codex-rs/app-server-protocol/src/protocol/event_mapping.rs:115 — receiver state in collab spawn completion is status-focused; it should carry display metadata for canonical app-server consumers.

    20. [MEDIUM] codex-rs/app-server-protocol/src/protocol/v2/item.rs:340 — SubAgentActivity items carry IDs/path but no display metadata. Add display name or a reliable metadata lookup/hydration path.

    21. [MEDIUM] codex-rs/app-server-protocol/src/protocol/v2/item.rs:1052 — CollabAgentState only has status/message; add optional display metadata for live and replayed collab items.

    22. [MEDIUM] codex-rs/tui/src/multi_agents.rs:84 — TUI label formatting currently knows nickname/role/path, not caller display name. Define display priority, e.g. display_name first, optional platform nickname second, path/id fallback.

    23. [MEDIUM] codex-rs/tui/src/multi_agents.rs:502 — collab transcript rendering can fall back to raw IDs unless display metadata is available in the render path.

    24. [MEDIUM] codex-rs/tui/src/multi_agents.rs:319 — v2 activity rendering uses agent_path; it should prefer caller display name and keep path only as fallback/trace metadata.

    25. [MEDIUM] codex-rs/core/tests/suite/subagent_notifications.rs:1030 — add end-to-end agent logic coverage where the mocked model calls spawn_agent with "display_name": "Research Scout" and the child/output/persistence surfaces carry it.

    26. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_tests.rs:1043 — add a direct handler regression proving SpawnAgentHandlerV2 accepts display_name and returns/persists the expected metadata.

    27. [MEDIUM] codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs:40 — extend tool-schema contract tests so display_name exists in properties, is optional, and has the intended description/output shape.

    28. [MEDIUM] codex-rs/core/src/agent/control_tests.rs:2174 — extend resume/persistence tests for display-name restoration alongside nickname/role.

    29. [MEDIUM] codex-rs/core/src/agent/registry.rs:35 — AgentMetadata currently has only agent_nickname and agent_role; add first-class display identity instead of overloading nickname.

    30. [MEDIUM] codex-rs/core/src/agent/control.rs:493 — generated nickname reservation should remain separate from caller display name, because the requested API wants both identities available.

    31. [MEDIUM] codex-rs/thread-store/src/thread_metadata_sync.rs:70 — thread metadata sync writes nickname/role/path today; include display name so it survives store updates.

    32. [MEDIUM] codex-rs/core/src/hook_runtime.rs:750 — hook context exposes agent id/type but not display name. If spawned agents must identify their assigned display name without relying only on prompt text, this needs a structured, bounded path.

    33. [MEDIUM] codex-rs/core/src/session_prefix.rs:17 — session prefix helper should be display-name-aware or replaced with a bounded context fragment for subagent identity.

    34. [MEDIUM] codex-rs/core/src/session/mod.rs:2924 — spawned-session environment context needs display-name propagation if self-identification is part of acceptance.

    Suggested staging:

    1. Backend/API contract first: optional validated display_name, distinct from generated nickname, plus tool result shape and core tests.
    2. Persistence/resume next: protocol/state/thread-store metadata and old-rollout compatibility.
    3. Notifications/app-server: event mapping, thread history/replay, generated JSON/TS schemas.
    4. TUI/status surfaces last: label priority, snapshots, and activity/transcript rendering.
  6. kennyalive commented on Jul 2, 2026

    @kennyalive

    This would be useful for role-based spawned subagents too.

    Current behavior assigns opaque/fun names like Curie, Jason, Hilbert. For workflows with multiple active roles, it is much easier to scan the sidebar if callers can provide a display name, or at least a prefix/suffix, e.g. Comparator2 Epicurus, Fixer1 Banach, Verifier2 Darwin.

    We can make this work manually by editing local Codex state (threads.agent_nickname) and restarting the app, but it would be much better as a supported spawn/display option.

    Before:

    Image

    After:

    Image
  7. RichardMM commented on Jul 15, 2026

    @RichardMM

    is this coming any time soon. With 10 sub agents spawned each concerning different issues. Time is wasted in remembering context that a particular sub agent was working under

  8. parrfolio commented on Aug 6, 2026

    @parrfolio

    Renaming our subagents with random names is a useless feature for anyone trying to understand what the subagent is doing or what agents have been invoked. Defeats the purpose of multi-agent orchestration architecture or frameworks.

  9. HectaDev-cloud commented on Aug 7, 2026

    @HectaDev-cloud

    Confirmed on Codex Desktop for Windows (app 26.730.8199.0; CLI runtime 0.147.0-alpha.1.2).

    I have custom agents declared under ~/.codex/agents/, including atlas.toml with name = "atlas", gpt-5.6-sol / max, and role-specific developer instructions. A spawned test agent received:

    • agent_role: "atlas"
    • gpt-5.6-sol with max effort
    • the full Atlas developer prompt (ADR ownership, Vigil gate, and atlas-by-clodocapeo identity)

    So role resolution is working correctly. However, the Desktop subagent UI still labels these instances with forced generated nicknames such as Russell and Bohr. The available spawn API exposes no display_name / agent_nickname input, and custom-agent name does not affect the rendered label.

    For governed multi-agent workflows this is more than cosmetic: users need to distinguish Atlas, Forge-1, Forge-2, and Vigil immediately. Please render caller-defined/custom-agent names as the primary label, keeping the generated nickname only as optional secondary trace metadata (for example, Atlas (Russell)).

  10. schulle01 commented on Aug 7, 2026

    @schulle01
    Author

    Still reproducible — additional Desktop evidence

    Thanks for the Windows/Desktop confirmation. This appears to reinforce the original request and remains distinct from the UUID-rendering bug in #23588.

    Current behavior

    • Custom-agent configuration and role resolution work correctly.
    • Spawned agents receive their configured role, model, reasoning effort, and instructions.
    • Codex Desktop still displays an unrelated generated nickname as the primary identity.
    • The spawn API currently exposes no supported display_name input.

    Practical impact

    In workflows with several concurrent subagents, users cannot immediately distinguish responsibilities such as Atlas, Forge-1, Forge-2, and Vigil. They must instead remember which generated nickname belongs to which task.

    Possible display precedence

    1. Explicit caller-provided display_name
    2. Configured custom-agent name or role
    3. Generated platform nickname
    4. Raw agent/thread ID as trace metadata

    The generated nickname could remain available separately, allowing labels such as Atlas (Russell).

    This additional evidence suggests that the requested capability affects both the spawn API/metadata contract and Codex Desktop’s display surfaces.

  11. wuyak commented on Aug 9, 2026

    @wuyak

    A recent Codex App run suggests that this request now intersects with the newer task_name / agent_path model.

    For one spawned child, the recorded metadata was effectively:

    agent_path:     /root/audit_git_cache_cleanliness
    agent_role:     explorer
    agent_nickname: Turing
    

    The App card rendered the humanized task label Audit git cache cleanliness, not Turing. This is better than a random nickname, but it also makes an action word such as “Audit” look like an agent type even though the configured role is Explorer.

    I think the implementation should therefore keep these concepts explicitly separate:

    agent_id          immutable internal identity
    task_name/path    stable machine routing and lane identity
    agent_role        capability/configuration profile
    display_name      caller-defined semantic UI label
    platform_nickname generated secondary trace/personality hint
    

    A useful UI presentation would be:

    Git Cache Cleanliness Audit    [Explorer]
    Turing · /root/audit_git_cache_cleanliness   (detail/tooltip)
    

    This avoids forcing task intent, capability role, routing identity, and generated personality into one label.

    A few additional acceptance details may help:

    • Allow a custom-agent profile to provide a default display name, with an optional per-spawn override.
    • Keep the same display name across follow-ups, resume, replay, and ordinary retries of the same logical lane.
    • Do not require display names to be globally unique; agent_id / agent_path remain the real identity, while the UI can add role, scope, or a short ID when disambiguation is needed.
    • Treat display_name as bounded structured metadata by default rather than injecting arbitrary caller text into the child prompt.
    • Preserve the generated nickname as optional secondary/debug metadata instead of using it as the primary label.

    I also opened #37657 as a complementary request for configurable subagent visual identities (custom icon, color, and shape). That feature should remain separate from naming: #26112 provides the semantic text label, while #37657 would provide fast visual recognition for Explorer, Worker, Reviewer, Monitor, and user-defined agent profiles.

  12. bobrullo commented on Sep 9, 2026

    @bobrullo

    Strong +1 from a Codex App multi-agent workflow. The concrete side-panel experience I want is a stable role name plus assignment, for example: Frank: RBAC target, alongside Frank’s personalized profile avatar and the current status (such as Working).

    It would help to keep these as separate concepts in the API and UI:

    • role/display name: Frank
    • assignment label: RBAC target
    • visual identity: inherited from the custom-agent profile, with an optional per-spawn override
    • runtime status: Working, Waiting, Completed, or Blocked

    This would make recurring agents such as Frank, Scout, and Pixel immediately recognizable while letting their assignment change per task. It also connects naturally with the custom visual-identity proposal in #37657.

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

    enhancementsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions